Class CudaAllocator

class CudaAllocator : public DeviceAllocator

Public Functions

CudaAllocator(Data_Namespace::DataMgr *data_mgr, const int device_id)
~CudaAllocator()
int8_t *alloc(const size_t num_bytes)
void free(Data_Namespace::AbstractBuffer *ab) const
void copyToDevice(void *device_dst, const void *host_src, const size_t num_bytes) const
void copyFromDevice(void *host_dst, const void *device_src, const size_t num_bytes) const
void zeroDeviceMem(int8_t *device_ptr, const size_t num_bytes) const
void setDeviceMem(int8_t *device_ptr, unsigned char uc, const size_t num_bytes) const

Public Static Functions

Data_Namespace::AbstractBuffer *allocGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, const size_t num_bytes, const int device_id)
void freeGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, Data_Namespace::AbstractBuffer *ab)

Private Members

std::vector<Data_Namespace::AbstractBuffer *> owned_buffers_
Data_Namespace::DataMgr *data_mgr_
int device_id_