51 buf =
clCreateBuffer(_ctx->
context().get(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size,
nullptr,
nullptr);
53 return static_cast<void *
>(buf);
65 return std::make_unique<CLBufferMemoryRegion>(_ctx, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size);
cl::Context context()
OpenCL context accessor.
static CLScheduler & get()
Access the scheduler singleton.
void free(void *ptr) override
Interface to be implemented by the child class to free the allocated tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
CLBufferAllocator(CLCoreRuntimeContext *ctx=nullptr)
Default constructor.
std::unique_ptr< IMemoryRegion > make_region(size_t size, size_t alignment) override
Create self-managed memory region.
Copyright (c) 2017-2021 Arm Limited.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
void * allocate(size_t size, size_t alignment) override
Interface to be implemented by the child class to allocate bytes.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Core runtime context for OpenCL.
cl_mem clCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)
Wrapper to configure the Khronos OpenCL C++ header.
cl_int clReleaseMemObject(cl_mem memobj)