19 #define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED 1
30 VLOG(1) <<
"Thrust allocation: Device #" <<
device_id_ <<
" Allocation #"
35 const auto err = cuMemAlloc(&ptr, num_bytes);
37 return reinterpret_cast<int8_t*
>(ptr);
46 int8_t* raw_ptr =
reinterpret_cast<int8_t*
>(ab->
getMemoryPtr());
55 const auto err = cuMemFree(reinterpret_cast<CUdeviceptr>(ptr));
70 const auto err = cuMemAlloc(&ptr, num_bytes);
73 return reinterpret_cast<int8_t*
>(ptr);
92 const auto err = cuMemFree(reinterpret_cast<CUdeviceptr>(ptr));
97 LOG(
ERROR) <<
"Not all GPU buffers deallocated before destruction of Thrust "
98 "allocator for device "
101 auto& ab = kv.second;
103 LOG(
ERROR) << (ab->pageCount() * ab->pageSize()) / (1024. * 1024.) <<
" MB";
105 VLOG(1) << boost::stacktrace::stacktrace();
int8_t * allocate(std::ptrdiff_t num_bytes)
std::vector< Data_Namespace::AbstractBuffer * > scoped_buffers_
virtual int8_t * getMemoryPtr()=0
unsigned long long CUdeviceptr
void deallocate(int8_t *ptr, size_t num_bytes)
virtual int getPinCount()
std::vector< int8_t * > default_alloc_scoped_buffers_
Data_Namespace::DataMgr * data_mgr_
PtrMapperType raw_to_ab_ptr_
int8_t * allocateScopedBuffer(std::ptrdiff_t num_bytes)
An AbstractBuffer is a unit of data management for a data manager.
static Data_Namespace::AbstractBuffer * allocGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, const size_t num_bytes, const int device_id)
Allocate GPU memory using GpuBuffers via DataMgr.
void free(AbstractBuffer *buffer)
AbstractBuffer * alloc(const MemoryLevel memoryLevel, const int deviceId, const size_t numBytes)