Commit e5d5d31a authored by incardon's avatar incardon

Fixing copy of cuda memory for temporary

parent b61d7f9c
Pipeline #408 passed with stages
in 47 seconds
......@@ -132,7 +132,7 @@ public:
return false;
}
// Copy the Heap memory
// Copy the memory (device and host)
CudaMemory & operator=(const CudaMemory & mem)
{
copy(mem);
......@@ -149,24 +149,18 @@ public:
CudaMemory(CudaMemory && mem) EXCEPT_MC
{
bool t_is_hm_sync = is_hm_sync;
size_t t_sz = sz;
void * t_dm = dm;
void * t_hm = hm;
long int t_ref_cnt = ref_cnt;
is_hm_sync = mem.is_hm_sync;
sz = mem.sz;
dm = mem.dm;
hm = mem.hm;
ref_cnt = mem.ref_cnt;
// reset mem
mem.is_hm_sync = t_is_hm_sync;
mem.sz = t_sz;
mem.dm = t_dm;
mem.hm = t_hm;
mem.ref_cnt = t_ref_cnt;
mem.is_hm_sync = false;
mem.sz = 0;
mem.dm = NULL;
mem.hm = NULL;
mem.ref_cnt = 0;
}
//! Constructor
......
......@@ -236,6 +236,8 @@ bool HeapMemory::resize(size_t sz)
void * HeapMemory::getDevicePointer()
{
std::cout << __FILE__ << ":" << __LINE__ << " Warning: you are trying to use this buffer on device (example GPU). The most probable cause to produce this message is that you are trying to offload a data-structure on device (example: GPU), but the data-structure is not supposed to work on device" << std::endl;
return dm;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment