mgcpp
A C++ Math Library Based on CUDA
Namespaces | Typedefs | Enumerations | Functions
memory.hpp File Reference
#include <mgcpp/system/error_code.hpp>
#include <mgcpp/system/outcome.hpp>
#include <complex>
#include <cstdlib>
#include <new>
#include <type_traits>
#include <mgcpp/cuda/memory.tpp>
Include dependency graph for memory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mgcpp
 

Typedefs

using mgcpp::free_mem_t = size_t
 
using mgcpp::total_mem_t = size_t
 

Enumerations

enum  mgcpp::cuda_memcpy_kind { mgcpp::cuda_memcpy_kind::host_to_device = cudaMemcpyKind::cudaMemcpyHostToDevice, mgcpp::cuda_memcpy_kind::device_to_host = cudaMemcpyKind::cudaMemcpyDeviceToHost, mgcpp::cuda_memcpy_kind::device_to_device = cudaMemcpyKind::cudaMemcpyDeviceToDevice }
 

Functions

template<typename ElemType >
outcome::result< ElemType * > mgcpp::cuda_malloc (size_t size) noexcept
 
template<typename ElemType >
outcome::result< void > mgcpp::cuda_free (ElemType *ptr) noexcept
 
template<typename ElemType >
outcome::result< void > mgcpp::cuda_memset_to_zero (ElemType *ptr, size_t count) noexcept
 
template<typename ElemType >
outcome::result< ElemType * > mgcpp::malloc_pinned (size_t count) noexcept
 
template<typename ElemType >
outcome::result< void > mgcpp::free_pinned (ElemType *ptr) noexcept
 
template<typename ElemType >
outcome::result< void > mgcpp::cuda_memcpy (ElemType *to, ElemType const *from, size_t count, cuda_memcpy_kind kind) noexcept
 
outcome::result< void > mgcpp::cuda_memcpy (cuComplex *to, std::complex< float > const *from, size_t count, cuda_memcpy_kind kind) noexcept
 
outcome::result< void > mgcpp::cuda_memcpy (std::complex< float > *to, cuComplex const *from, size_t count, cuda_memcpy_kind kind) noexcept
 
outcome::result< void > mgcpp::cuda_memcpy (cuDoubleComplex *to, std::complex< double > const *from, size_t count, cuda_memcpy_kind kind) noexcept
 
outcome::result< void > mgcpp::cuda_memcpy (std::complex< double > *to, cuDoubleComplex const *from, size_t count, cuda_memcpy_kind kind) noexcept
 
outcome::result< std::pair< free_mem_t, total_mem_t > > mgcpp::cuda_mem_get_info () noexcept