43 : _accum(nullptr), _biases(nullptr), _lws(gles::NDRange(1
U, 1
U, 1
U))
56 std::set<std::string> build_opts;
62 build_opts.emplace(
"#define GEMM_ACCUMULATE_BIASES");
64 #define ACCUM_PROCESS_4X 66 #if defined(ACCUM_PROCESS_4X) 67 build_opts.emplace(
"#define ACCUM_PROCESS_4X");
68 #elif defined(ACCUM_PROCESS_8X) 69 build_opts.emplace(
"#define ACCUM_PROCESS_8X");
72 build_opts.emplace((
"#define " + dt_name));
81 num_elems_processed_per_iteration = 16;
85 #if defined(ACCUM_PROCESS_4X) 86 num_elems_processed_per_iteration = 4;
87 #elif defined(ACCUM_PROCESS_8X) 88 num_elems_processed_per_iteration = 8;
93 const int accum_padding_right =
ceil_to_multiple(accum_width, num_elems_processed_per_iteration * _lws[0]) - accum_width;
103 IGCKernel::configure(win);
115 Window biases_slice(accum_slice);
122 unsigned int idx = 0;
126 _kernel.update_shader_params();
128 enqueue(*
this, accum_slice, _lws);
Window first_slice_window_2D() const
First 2D slice of the window.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
const Window & window() const
The maximum window the kernel can be executed on.
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.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
Container for 2D border size.
std::string to_string(T &&value)
Convert integer and float values to string.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
1 channel, 1 F32 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
GCGEMMMatrixAccumulateBiasesKernel()
Default constructor.
Interface for GLES Compute tensor.
Describe one of the image's dimensions with a start, end and step.
void run(const Window &window) override
Enqueue the OpenGL ES shader to process the given window.
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
Implementation of a static rectangular access pattern.
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w)
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...)
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.
Manages all the GLES kernels compilation and caching, provides accessors for the GLES Context...
Class to describe a number of elements in each dimension.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
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...
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Wrapper to configure the Khronos EGL and OpenGL ES C header.
static GCKernelLibrary & get()
Get the static instance of GCKernelLibrary.
Window calculate_max_enlarged_window(const ValidRegion &valid_region, const Steps &steps, BorderSize border_size)
GCKernel create_kernel(const std::string &shader_name, const StringSet &build_options_set={}) const
Creates a kernel from the kernel library.
unsigned int num_elems_processed_per_iteration
void configure(IGCTensor *accum, const IGCTensor *biases)
Set the accumulate buffer and the biases of the kernel.
Describe a multidimensional execution window.
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...