6 #if defined(CUFFT) || defined(CUFFTW)
7 #include "cuda_runtime.h"
9 #include "cuda/cuda_error_check.cuh"
13 template <typename T> class DynMem_ {
23 CudaSafeCall(cudaHostAlloc(reinterpret_cast<void **>(&this->ptr), size, cudaHostAllocMapped));
25 cudaHostGetDevicePointer(reinterpret_cast<void **>(&this->ptr_d), reinterpret_cast<void *>(this->ptr), 0));
27 this->ptr = new float[size];
33 CudaSafeCall(cudaFreeHost(this->ptr));
38 T *hostMem() { return ptr; }
39 T *deviceMem() { return ptr_d; }
41 void operator=(DynMem_ &&rhs)
44 this->ptr_d = rhs.ptr_d;
50 typedef DynMem_<float> DynMem;