24.08
|
Go to the documentation of this file.
23 void*
allocate(
size_t size,
size_t alignment = 0)
override
26 cl_mem buf{ clCreateBuffer(arm_compute::CLScheduler::get().context().get(),
27 CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE,
31 return static_cast<void *
>(buf);
34 void free(
void* ptr)
override
36 ARM_COMPUTE_ERROR_ON(ptr ==
nullptr);
37 clReleaseMemObject(
static_cast<cl_mem
>(ptr));
48 return static_cast<char*
>(buffer) + offset;
MemorySource GetMemorySourceType() override
Used to specify what type of memory is being allocated by this allocator.
Custom Allocator interface.
void free(void *ptr) override
Interface to be implemented by the child class to free the allocated bytes.
void * allocate(size_t size, size_t alignment=0) override
Interface to be implemented by the child class to allocate bytes.
void IgnoreUnused(Ts &&...)
MemorySource
Define the Memory Source to reduce copies.
Copyright (c) 2021 ARM Limited and Contributors.
GpuFsaBackendDefaultAllocator()=default
Default Memory Allocator class returned from IBackendInternal::GetDefaultAllocator(MemorySource)
void * GetMemoryRegionAtOffset(void *buffer, size_t offset, size_t alignment=0) override
Interface that may be implemented to allow retrieval of Memory Region from allocated buffer at a cert...