53 "window x end =%d, start=%d, step=%d, lws x=%zu", window.
x().
end(), window.
x().
start(), window.
x().
step(), lws[0]);
55 "window y end =%d, start=%d, step=%d, lws y=%zu", window.
y().
end(), window.
y().
start(), window.
y().
step(), lws[1]);
57 "window z end =%d, start=%d, step=%d, lws z=%zu", window.
z().
end(), window.
z().
start(), window.
z().
step(), lws[2]);
61 ((window.
z().
end() - window.
z().
start()) / window.
z().
step()) / lws[2]));
74 template <
unsigned int dimension_size>
75 unsigned int IGCKernel::num_arguments_per_tensor()
const 81 template <
unsigned int dimension_size>
82 void IGCKernel::add_tensor_argument(
unsigned int &idx,
const IGCTensor *tensor,
const unsigned int binding_point,
const Window &
window)
94 offset_first_element += window[n].start() * strides[n];
97 unsigned int idx_start = idx;
99 for(
unsigned int dimension = 0; dimension < dimension_size; dimension++)
109 for(
unsigned int i = idx; i < idx_end; ++i)
118 "add_%dD_tensor_argument() is supposed to add exactly %d arguments to the kernel", dimension_size, num_arguments_per_tensor<dimension_size>());
124 add_tensor_argument<1>(idx, tensor, binding_point,
window);
129 add_tensor_argument<2>(idx, tensor, binding_point,
window);
134 add_tensor_argument<3>(idx, tensor, binding_point,
window);
139 return num_arguments_per_tensor<1>();
144 return num_arguments_per_tensor<2>();
149 return num_arguments_per_tensor<3>();
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
#define ARM_COMPUTE_GL_CHECK(x)
const Window & window() const
The maximum window the kernel can be executed on.
unsigned int num_arguments_per_2D_tensor() const
Returns the number of arguments enqueued per 2D tensor object.
void add_3D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx...
void enqueue(IGCKernel &kernel, const Window &window, const gles::NDRange &lws=gles::NDRange(1U, 1U, 1U))
Add the kernel to the command queue with the given window.
constexpr int step() const
Return the step of the dimension.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
Interface for GLES Compute tensor.
#define ARM_COMPUTE_ERROR_ON_MSG_VAR(cond, msg,...)
unsigned int num_arguments_per_1D_tensor() const
Returns the number of arguments enqueued per 1D tensor object.
constexpr const Dimension & z() const
Alias to access the third dimension of the window.
unsigned int num_arguments_per_3D_tensor() const
Returns the number of arguments enqueued per 3D tensor object.
GCKernel & kernel()
Returns a reference to the GLES kernel of this object.
Copyright (c) 2017-2021 Arm Limited.
virtual GLuint gc_buffer() const =0
Interface to be implemented by the child class to return the tensor's gles compute buffer id...
void GL_APIENTRY glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
auto ceil_to_multiple(S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
Computes the smallest number larger or equal to value that is a multiple of divisor.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void add_2D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx...
void GL_APIENTRY glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
Strides of an item in bytes.
virtual size_t offset_first_element_in_bytes() const =0
The offset from the beginning of the memory allocation to the first element of the tensor...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
GPUTarget
Available GPU Targets.
GLuint get_program() const
Get program id.
Common interface for all the GLES kernels.
constexpr const Dimension & y() const
Alias to access the second dimension of the window.
Class interface for specifying NDRange values.
Interface to enqueue GLES kernels and get/set the GLES CommandQueue.
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
constexpr int end() const
Return the end of the dimension.
constexpr int start() const
Return the start of the dimension.
Describe a multidimensional execution window.
void set_argument(unsigned int idx, T value)
Set argument value at index of shader params.
void add_1D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window)
Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx...
constexpr const Dimension & x() const
Alias to access the first dimension of the window.