5 #ifndef THUNDERSVM_SYNCMEM_H 6 #define THUNDERSVM_SYNCMEM_H 8 #include <thundersvm/thundersvm.h> 11 inline void malloc_host(
void **ptr,
size_t size) {
13 CUDA_CHECK(cudaMallocHost(ptr, size));
19 inline void free_host(
void *ptr) {
21 CUDA_CHECK(cudaFreeHost(ptr));
27 inline void device_mem_copy(
void *dst,
const void *src,
size_t size) {
29 CUDA_CHECK(cudaMemcpy(dst, src, size, cudaMemcpyDefault));
80 HOST, DEVICE, UNINITIALIZED
95 #endif //THUNDERSVM_SYNCMEM_H void set_device_data(void *data)
Definition: syncmem.cpp:114
size_t size() const
return the size of memory
Definition: syncmem.cpp:46
void * host_data()
return raw host pointer
Definition: syncmem.cpp:32
void to_device()
transfer data to device
Definition: syncmem.cpp:79
void * device_data()
return raw device pointer
Definition: syncmem.cpp:37
void set_host_data(void *data)
Definition: syncmem.cpp:104
HEAD
to determine the where the newest data locates in
Definition: syncmem.h:79
void to_host()
transfer data to host
Definition: syncmem.cpp:54
Auto-synced memory for CPU and GPU.
Definition: syncmem.h:38