Class ThrustAllocator

class ThrustAllocator

Public Types

using value_type = int8_t

Public Functions

ThrustAllocator(Data_Namespace::DataMgr *mgr, const int id)
~ThrustAllocator()
int8_t *allocate(std::ptrdiff_t num_bytes)
void deallocate(int8_t *ptr, size_t num_bytes)
int8_t *allocateScopedBuffer(std::ptrdiff_t num_bytes)
Data_Namespace::DataMgr *getDataMgr() const
int getDeviceId() const

Private Types

using PtrMapperType = std::unordered_map<int8_t *, Data_Namespace::AbstractBuffer *>

Private Members

Data_Namespace::DataMgr *data_mgr_
const int device_id_
PtrMapperType raw_to_ab_ptr_
std::vector<Data_Namespace::AbstractBuffer *> scoped_buffers_
std::vector<int8_t *> default_alloc_scoped_buffers_
size_t num_allocations_ = {0}