35 namespace Data_Namespace {
52 const size_t num_bytes,
58 int8_t*
alloc(
const size_t num_bytes)
override;
64 const size_t num_bytes)
const override;
67 const void* device_src,
68 const size_t num_bytes)
const override;
70 void zeroDeviceMem(int8_t* device_ptr,
const size_t num_bytes)
const override;
74 const size_t num_bytes)
const override;
void zeroDeviceMem(int8_t *device_ptr, const size_t num_bytes) const override
CudaAllocator(Data_Namespace::DataMgr *data_mgr, const int device_id, CUstream cuda_stream)
Data_Namespace::DataMgr * data_mgr_
An AbstractBuffer is a unit of data management for a data manager.
void free(Data_Namespace::AbstractBuffer *ab) const override
void copyToDevice(void *device_dst, const void *host_src, const size_t num_bytes) const override
int8_t * alloc(const size_t num_bytes) override
std::vector< Data_Namespace::AbstractBuffer * > owned_buffers_
static void freeGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, Data_Namespace::AbstractBuffer *ab)
void setDeviceMem(int8_t *device_ptr, unsigned char uc, const size_t num_bytes) const override
Abstract class for managing device memory allocations.
~CudaAllocator() override
static Data_Namespace::AbstractBuffer * allocGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, const size_t num_bytes, const int device_id)
void copyFromDevice(void *host_dst, const void *device_src, const size_t num_bytes) const override