class simple_memory_pool_t
class simple_memory_pool_t
{
public:
// fields
void size_t alignment;
void size_t cl_device_id dev;
void size_t cl_device_id cl_context ctx { std::lock_guard<std::mutex> pool_guard(pool_lock);
void* ptr {nullptr};
bool need_alloc_new_mm = true;
const auto cnt = map_size_ptr_.count(size);
return ptr;
// methods
void* allocate(size_t size, size_t alignment, const void* dev, const void* ctx);
if(size = =0);
if(cnt, 0);
if(need_alloc_new_mm);
void* allocate_host(size_t size, size_t alignment);
void deallocate(void* ptr, const void* device, const void* context, void* event);
void deallocate(
void* ptr,
cl_device_id dev,
const cl_context ctx,
cl_event event
);
void deallocate_host(void* ptr);
void clear();
};