32 :
ICLDistribution1D(num_bins, offset, range), _mem(
CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, num_bins * sizeof(int32_t))
46 uint32_t *CLDistribution1D::do_map(cl::CommandQueue &q,
bool blocking)
49 return static_cast<uint32_t *
>(q.enqueueMapBuffer(_mem, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, 0,
size()));
52 void CLDistribution1D::do_unmap(cl::CommandQueue &q)
55 q.enqueueUnmapMemObject(_mem, _mapping);
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
static CLScheduler & get()
Access the scheduler singleton.
void unmap(cl::CommandQueue &q)
Enqueue an unmap operation of the allocated and mapped buffer on the given queue. ...
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
cl::Buffer & cl_buffer() override
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing ...
Copyright (c) 2017-2021 Arm Limited.
void map(cl::CommandQueue &q, bool blocking=true)
Enqueue a map operation of the allocated buffer on the given queue.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
CLDistribution1D(size_t num_bins, int32_t offset, uint32_t range)
Constructor: Creates a 1D CLDistribution of a consecutive interval [offset, offset + range - 1] defin...
SimpleTensor< T > range(SimpleTensor< T > &dst, float start, const size_t num_of_elements, float step)
void map(bool blocking=true)
Enqueue a map operation of the allocated buffer.
void unmap()
Enqueue an unmap operation of the allocated and mapped buffer.
ICLDistribution1D interface class.
Provides global access to a CL context and command queue.
size_t size() const override
Returns the total size in bytes of the distribution.