25 namespace Buffer_Namespace {
28 BufferList::iterator segment_iter,
31 const size_t page_size,
32 const size_t num_bytes)
33 :
Buffer(bm, segment_iter, device_id, page_size, num_bytes), cuda_mgr_(cuda_mgr) {}
36 const size_t num_bytes,
39 const int dst_device_id) {
41 memcpy(dst,
mem_ + offset, num_bytes);
42 }
else if (dst_memory_level ==
GPU_LEVEL) {
46 LOG(
FATAL) <<
"Unsupported buffer type";
51 const size_t num_bytes,
54 const int src_device_id) {
57 memcpy(
mem_ + offset, src, num_bytes);
58 }
else if (src_memory_level ==
GPU_LEVEL) {
63 LOG(
FATAL) <<
"Unsupported buffer type";
void copyHostToDevice(int8_t *device_ptr, const int8_t *host_ptr, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
void readData(int8_t *const dst, const size_t num_bytes, const size_t offset=0, const MemoryLevel dst_memory_level=CPU_LEVEL, const int dst_device_id=-1) override
Note(s): Forbid Copying Idiom 4.1.
CpuBuffer(BufferMgr *bm, BufferList::iterator segment_iter, const int device_id, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t page_size=512, const size_t num_bytes=0)
void copyDeviceToHost(int8_t *host_ptr, const int8_t *device_ptr, const size_t num_bytes, CUstream cuda_stream=0)
CudaMgr_Namespace::CudaMgr * cuda_mgr_
void writeData(int8_t *const src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_memory_level=CPU_LEVEL, const int src_device_id=-1) override
Note(s): Forbid Copying Idiom 4.1.