Compute Library
 23.11
ClGemmLowpMatrixMultiplyReshapedKernel Class Reference

OpenCL kernel to multiply matrices when both the input matrices LHS (src0) and RHS (src1) have been reshaped. More...

#include <ClGemmLowpMatrixMultiplyReshapedKernel.h>

Collaboration diagram for ClGemmLowpMatrixMultiplyReshapedKernel:
[legend]

Public Member Functions

 ClGemmLowpMatrixMultiplyReshapedKernel ()
 
 ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (ClGemmLowpMatrixMultiplyReshapedKernel)
 
void configure (const CLCompileContext &compile_context, const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, const GEMMLHSMatrixInfo &lhs_info, const GEMMRHSMatrixInfo &rhs_info, const GEMMReshapeInfo &gemm_info)
 Initialise the kernel's input and dst. More...
 
void run_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
- Public Member Functions inherited from ICLKernel
 ICLKernel ()
 Constructor. More...
 
cl::Kernel & kernel ()
 Returns a reference to the OpenCL kernel of this object. More...
 
CLKernelType type () const
 Returns the CL kernel type. More...
 
template<typename T >
void add_1D_array_argument (unsigned int &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed 1D array's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_2D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_2D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_3D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_4D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 4D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_5D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 5D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_3d_tensor_nhw_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHW 3D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
void add_4d_tensor_nhwc_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHWC 4D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
virtual void run (const Window &window, cl::CommandQueue &queue)
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
template<typename T >
void add_argument (unsigned int &idx, T value)
 Add the passed parameters to the object's kernel's arguments starting from the index idx. More...
 
void set_lws_hint (const cl::NDRange &lws_hint)
 Set the Local-Workgroup-Size hint. More...
 
cl::NDRange lws_hint () const
 Return the Local-Workgroup-Size hint. More...
 
void set_wbsm_hint (const cl_int &wbsm_hint)
 Set the workgroup batch size modifier hint. More...
 
cl_int wbsm_hint () const
 Return the workgroup batch size modifier hint. More...
 
const std::string & config_id () const
 Get the configuration ID. More...
 
void set_target (GPUTarget target)
 Set the targeted GPU architecture. More...
 
void set_target (cl::Device &device)
 Set the targeted GPU architecture according to the CL device. More...
 
GPUTarget get_target () const
 Get the targeted GPU architecture. More...
 
size_t get_max_workgroup_size ()
 Get the maximum workgroup size for the device the CLKernelLibrary uses. More...
 
cl::NDRange get_cached_gws () const
 Get the cached gws used to enqueue this kernel. More...
 
void cache_gws (const cl::NDRange &gws)
 Cache the latest gws used to enqueue this kernel. More...
 
template<unsigned int dimension_size>
void add_tensor_argument (unsigned &idx, const ICLTensor *tensor, const Window &window)
 
template<typename T , unsigned int dimension_size>
void add_array_argument (unsigned &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed array's parameters to the object's kernel's arguments starting from the index idx. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 
bool is_window_configured () const
 Function to check if the embedded window of this kernel has been configured. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst, const GEMMLHSMatrixInfo &lhs_info, const GEMMRHSMatrixInfo &rhs_info, const GEMMReshapeInfo &gemm_info)
 Static function to check if given info will lead to a valid configuration. More...
 
- Static Public Member Functions inherited from ICLKernel
constexpr static unsigned int num_arguments_per_3d_tensor_nhw ()
 Returns the number of arguments enqueued per NHW 3D Tensor object. More...
 
constexpr static unsigned int num_arguments_per_4d_tensor_nhwc ()
 Returns the number of arguments enqueued per NHWC 4D Tensor object. More...
 
constexpr static unsigned int num_arguments_per_1D_array ()
 Returns the number of arguments enqueued per 1D array object. More...
 
constexpr static unsigned int num_arguments_per_1D_tensor ()
 Returns the number of arguments enqueued per 1D tensor object. More...
 
constexpr static unsigned int num_arguments_per_2D_tensor ()
 Returns the number of arguments enqueued per 2D tensor object. More...
 
constexpr static unsigned int num_arguments_per_3D_tensor ()
 Returns the number of arguments enqueued per 3D tensor object. More...
 
constexpr static unsigned int num_arguments_per_4D_tensor ()
 Returns the number of arguments enqueued per 4D tensor object. More...
 
static cl::NDRange gws_from_window (const Window &window, bool use_dummy_work_items)
 Get the global work size given an execution window. More...
 

Detailed Description

OpenCL kernel to multiply matrices when both the input matrices LHS (src0) and RHS (src1) have been reshaped.

Note
The input matrices src0 and src1 must be reshaped through:

Definition at line 45 of file ClGemmLowpMatrixMultiplyReshapedKernel.h.

Constructor & Destructor Documentation

◆ ClGemmLowpMatrixMultiplyReshapedKernel()

Definition at line 153 of file ClGemmLowpMatrixMultiplyReshapedKernel.cpp.

154 {
155  _type = CLKernelType::GEMM;
156 }

References arm_compute::GEMM.

Member Function Documentation

◆ ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE()

ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE ( ClGemmLowpMatrixMultiplyReshapedKernel  )

◆ configure()

void configure ( const CLCompileContext compile_context,
const ITensorInfo src0,
const ITensorInfo src1,
ITensorInfo dst,
const GEMMLHSMatrixInfo lhs_info,
const GEMMRHSMatrixInfo rhs_info,
const GEMMReshapeInfo gemm_info 
)

Initialise the kernel's input and dst.

Parameters
[in]compile_contextThe compile context to be used.
[in]src0Source tensor containing the LHS reshaped matrix. Data type supported: QASYMM8/QASYMM8_SIGNED. The number of dimensions for the LHS matrix must be less or equal than 4.
[in]src1Source tensor containing the RHS reshaped matrix. Data type supported: same as src0. The number of dimensions for the RHS matrix must be less or equal than 3.
[out]dstDestination tensor to store the result of matrix multiplication. Data type supported: S32
[in]lhs_infoLHS matrix information used for reshaping the src0 tensor. Only the following values are supported: lhs_info.m0: 2,3,4,5,6,7,8 lhs_info.k0: 2,3,4,8,16 lhs_info.transpose: false
[in]rhs_infoRHS matrix information used for reshaping the src1 tensor. Only the following values are supported: rhs_info.n0: 2,3,4,8,16 rhs_info.k0: same as lhs_info.k0 rhs_info.transpose: true
[in]gemm_infoGEMM information used to retrieve the original dimensions of the input matrices
Note
lhs_info.k0 must be equal to rhs_info.k0

Definition at line 158 of file ClGemmLowpMatrixMultiplyReshapedKernel.cpp.

165 {
166  ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst);
167  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src0, src1, dst, lhs_info, rhs_info, gemm_info));
168 
169  _reinterpret_output_as_3d = (gemm_info.depth_output_gemm3d() != 0);
170  _k = gemm_info.k();
171  _use_dummy_work_items = preferred_dummy_work_items_support(CLKernelLibrary::get().get_device());
172 
173  // Check if we need to slide the matrix B
174  const unsigned int num_dimensionssrc0 = src0->num_dimensions();
175  _slide_matrix_b = (src1->num_dimensions() >= num_dimensionssrc0);
176 
177  auto padding_info = get_padding_info({src0, src1, dst});
178  ElementsProcessed num_elements_processed{};
179 
180  // Configure kernel window
181  auto win_config =
182  validate_and_configure_window(src0, src1, dst, lhs_info, rhs_info, gemm_info, num_elements_processed);
183  ARM_COMPUTE_ERROR_THROW_ON(win_config.first);
184  ICLKernel::configure_internal(win_config.second);
185 
186  // Calculate partial (store instead of load) M0 and partial N0 for the partial blocks at the end of a row/column if any. This is to avoid padding.
187  const unsigned int internal_m = _reinterpret_output_as_3d ? gemm_info.m() : dst->dimension(1);
188 
189  const unsigned int partial_store_m0 = internal_m % lhs_info.m0;
190  const unsigned int partial_store_n0 = gemm_info.n() % rhs_info.n0;
191 
192  // Create build options
193  CLBuildOptions build_opts;
194  build_opts.add_option_if(_reinterpret_output_as_3d, "-DREINTERPRET_OUTPUT_AS_3D");
195  build_opts.add_option_if(_reinterpret_output_as_3d,
196  "-DHEIGHT_GEMM3D=" + support::cpp11::to_string(dst->dimension(1)));
197  build_opts.add_option_if(_reinterpret_output_as_3d,
198  "-DDEPTH_GEMM3D=" + support::cpp11::to_string(dst->dimension(2)));
199  build_opts.add_option_if(!_slide_matrix_b, "-DMATRIX_B_DEPTH=" + support::cpp11::to_string(src1->dimension(2)));
200  build_opts.add_option_if(lhs_info.interleave, "-DLHS_INTERLEAVE");
201  build_opts.add_option_if(rhs_info.interleave, "-DRHS_INTERLEAVE");
202  build_opts.add_option_if(_use_dummy_work_items, "-DDUMMY_WORK_ITEMS");
203  build_opts.add_option("-DM=" + support::cpp11::to_string(gemm_info.m()));
204  build_opts.add_option("-DN=" + support::cpp11::to_string(gemm_info.n()));
205  build_opts.add_option("-DM0=" + support::cpp11::to_string(lhs_info.m0));
206  build_opts.add_option("-DN0=" + support::cpp11::to_string(rhs_info.n0));
207  build_opts.add_option("-DK0=" + support::cpp11::to_string(lhs_info.k0));
208  build_opts.add_option("-DV0=" + support::cpp11::to_string(lhs_info.v0));
209  build_opts.add_option("-DH0=" + support::cpp11::to_string(rhs_info.h0));
210  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(src0->data_type()));
211  build_opts.add_option("-DACC_DATA_TYPE=" + get_cl_dot8_acc_type_from_data_type(src0->data_type()));
212  build_opts.add_option("-DPARTIAL_STORE_M0=" + support::cpp11::to_string(partial_store_m0));
213  build_opts.add_option("-DPARTIAL_STORE_N0=" + support::cpp11::to_string(partial_store_n0));
214 
215  std::string kernel_name("gemmlowp_mm_reshaped_");
216  kernel_name += lhs_info.transpose ? "lhs_t_" : "lhs_nt_";
217  kernel_name += rhs_info.transpose ? "rhs_t" : "rhs_nt";
218 
219  // A macro guard to compile ONLY the kernel of interest
220  build_opts.add_option("-D" + upper_string(kernel_name));
221 
222  // Create kernel
223  _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
224 
225  // Set config_id for enabling LWS tuning
226  _config_id = kernel_name;
227  _config_id += "_";
228  _config_id += dot8_supported(CLKernelLibrary::get().get_device()) ? "_dot8" : "";
229  _config_id += "_";
230  _config_id += (_reinterpret_output_as_3d ? "3do_" : "");
231  _config_id += support::cpp11::to_string(dst->dimension(1));
232  _config_id += "_";
233  _config_id += support::cpp11::to_string(dst->dimension(0));
234  _config_id += "_";
235  _config_id += support::cpp11::to_string(gemm_info.k());
236  _config_id += "_";
237  _config_id += support::cpp11::to_string(dst->dimension(2));
238  _config_id += "_";
239  _config_id += support::cpp11::to_string(lhs_info.m0);
240  _config_id += "_";
241  _config_id += support::cpp11::to_string(rhs_info.n0);
242  _config_id += "_";
243  _config_id += support::cpp11::to_string(lhs_info.k0);
244  _config_id += "_";
245  _config_id += support::cpp11::to_string(lhs_info.v0);
246  _config_id += "_";
247  _config_id += support::cpp11::to_string(rhs_info.h0);
248  _config_id += "_";
249  _config_id += support::cpp11::to_string(lhs_info.interleave);
250  _config_id += "_";
251  _config_id += support::cpp11::to_string(rhs_info.interleave);
252 
254 }

References CLBuildOptions::add_option(), CLBuildOptions::add_option_if(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::create_kernel(), ITensorInfo::data_type(), GEMMReshapeInfo::depth_output_gemm3d(), ITensorInfo::dimension(), arm_compute::dot8_supported(), arm_compute::test::validation::dst, CLKernelLibrary::get(), arm_compute::get_cl_dot8_acc_type_from_data_type(), arm_compute::get_cl_type_from_data_type(), arm_compute::get_padding_info(), GEMMRHSMatrixInfo::h0, arm_compute::has_padding_changed(), GEMMLHSMatrixInfo::interleave, GEMMRHSMatrixInfo::interleave, GEMMReshapeInfo::k(), GEMMLHSMatrixInfo::k0, kernel_name, GEMMReshapeInfo::m(), GEMMLHSMatrixInfo::m0, GEMMReshapeInfo::n(), GEMMRHSMatrixInfo::n0, ITensorInfo::num_dimensions(), CLBuildOptions::options(), arm_compute::preferred_dummy_work_items_support(), arm_compute::support::cpp11::to_string(), GEMMLHSMatrixInfo::transpose, GEMMRHSMatrixInfo::transpose, arm_compute::upper_string(), GEMMLHSMatrixInfo::v0, arm_compute::cpu::kernels::validate_and_configure_window(), and arm_compute::cpu::kernels::validate_arguments().

◆ run_op()

void run_op ( ITensorPack tensors,
const Window window,
cl::CommandQueue &  queue 
)
overridevirtual

Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue.

Note
The queue is not flushed by this method, and therefore the kernel will not have been executed by the time this method returns.
Parameters
[in]tensorsA vector containing the tensors to operato on.
[in]windowRegion on which to execute the kernel. (Must be a valid region of the window returned by window()).
[in,out]queueCommand queue on which to enqueue the kernel.

Reimplemented from ICLKernel.

Definition at line 273 of file ClGemmLowpMatrixMultiplyReshapedKernel.cpp.

274 {
277 
278  const auto src0 =
279  utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0));
280  const auto src1 =
281  utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_1));
282  auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST));
283 
284  if (src1->info()->num_dimensions() < 3)
285  {
286  // The stride_z for matrix B must be zero if we do not slice
287  ARM_COMPUTE_ERROR_ON(src1->info()->strides_in_bytes()[3] != 0);
288  }
289 
291  Window slice_matrix_b = slice;
292 
293  slice_matrix_b.set(Window::DimX, Window::Dimension(0, 1, 1));
294  slice_matrix_b.set(Window::DimY, Window::Dimension(0, 1, 1));
295 
296  if (_reinterpret_output_as_3d)
297  {
298  // Pass bottom paddings to the kernel if the dst has to be reinterpreted as 3D tensor
299  const unsigned int idx0 = 3 * num_arguments_per_2D_tensor() + 4;
300  const unsigned int total_cross_plane_pad = dst->info()->padding().top + dst->info()->padding().bottom;
301  _kernel.setArg<cl_uint>(idx0, static_cast<unsigned int>(total_cross_plane_pad));
302  }
303 
304  do
305  {
306  Window slice_b = slice;
307  // Don't slice matrix B along the z dimension if matrix B has just 2 dimensions and matrix A more than 2
308  // This scenario can happen when the matrix multiplication is used to perform a convolution operation
309  if (!_slide_matrix_b)
310  {
311  slice_b = slice_matrix_b;
312  }
313 
314  unsigned int idx = 0;
315  add_2D_tensor_argument(idx, src0, slice);
316  add_2D_tensor_argument(idx, src1, slice_b);
318  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(_k));
319  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(src0->info()->strides_in_bytes()[2]));
320  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(src1->info()->strides_in_bytes()[2]));
321  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(dst->info()->strides_in_bytes()[2]));
322  enqueue(queue, *this, slice, lws_hint(), _use_dummy_work_items);
324 }

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::DimX, Window::DimY, arm_compute::test::validation::dst, arm_compute::enqueue(), Window::first_slice_window_3D(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), Window::set(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), and IKernel::window().

◆ validate()

Status validate ( const ITensorInfo src0,
const ITensorInfo src1,
const ITensorInfo dst,
const GEMMLHSMatrixInfo lhs_info,
const GEMMRHSMatrixInfo rhs_info,
const GEMMReshapeInfo gemm_info 
)
static

Static function to check if given info will lead to a valid configuration.

Similar to ClGemmLowpMatrixMultiplyReshapedKernel::configure()

Returns
a status

Definition at line 256 of file ClGemmLowpMatrixMultiplyReshapedKernel.cpp.

262 {
263  ElementsProcessed num_elements_processed{};
264  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(src0, src1, dst, lhs_info, rhs_info, gemm_info));
265  ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(src0->clone().get(), src1->clone().get(),
266  dst->clone().get(), lhs_info, rhs_info, gemm_info,
267  num_elements_processed)
268  .first);
269 
270  return Status{};
271 }

References ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), arm_compute::test::validation::dst, arm_compute::cpu::kernels::validate_and_configure_window(), and arm_compute::cpu::kernels::validate_arguments().


The documentation for this class was generated from the following files:
arm_compute::support::cpp11::to_string
std::string to_string(T &&value)
Convert integer and float values to string.
Definition: StringSupport.h:168
arm_compute::dot8_supported
bool dot8_supported(const cl::Device &device)
Helper function to check whether the cl_arm_integer_dot_product_int8 extension is supported.
Definition: CLHelpers.cpp:242
arm_compute::preferred_dummy_work_items_support
bool preferred_dummy_work_items_support(const cl::Device &device)
Helper function to check if "dummy work-items" are preferred to have a power of two NDRange In case d...
Definition: CLHelpers.cpp:370
arm_compute::get_cl_dot8_acc_type_from_data_type
std::string get_cl_dot8_acc_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL dot8 accumulator type.
Definition: CLHelpers.cpp:176
arm_compute::test::validation::dst
auto dst
Definition: DFT.cpp:170
arm_compute::cpu::kernels::validate_arguments
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
Definition: CpuDirectConv2dKernel.cpp:57
arm_compute::ICLKernel::num_arguments_per_2D_tensor
constexpr static unsigned int num_arguments_per_2D_tensor()
Returns the number of arguments enqueued per 2D tensor object.
Definition: ICLKernel.h:313
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:1079
arm_compute::Window::DimX
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
arm_compute::ACL_SRC_0
@ ACL_SRC_0
Definition: Types.h:45
arm_compute::upper_string
std::string upper_string(const std::string &val)
Raise a given string to upper case.
Definition: StringUtils.cpp:45
arm_compute::ACL_SRC_1
@ ACL_SRC_1
Definition: Types.h:46
arm_compute::CLKernelLibrary::get
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Definition: CLKernelLibrary.cpp:41
arm_compute::ICLKernel::add_2D_tensor_argument
void add_2D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx.
Definition: ICLKernel.h:210
ARM_COMPUTE_RETURN_ON_ERROR
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:205
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:159
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
ARM_COMPUTE_ERROR_THROW_ON
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
arm_compute::ACL_DST
@ ACL_DST
Definition: Types.h:55
arm_compute::create_kernel
cl::Kernel create_kernel(const CLCompileContext &ctx, const std::string &kernel_name, const std::set< std::string > &build_opts=std::set< std::string >())
Creates an opencl kernel using a compile context.
Definition: CLHelpers.cpp:409
ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:203
arm_compute::Window::slide_window_slice_3D
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
Definition: Window.h:350
arm_compute::cpu::kernels::validate_and_configure_window
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
Definition: CpuDirectConv2dKernel.cpp:92
arm_compute::Window::DimY
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
arm_compute::Window::first_slice_window_3D
Window first_slice_window_3D() const
First 3D slice of the window.
Definition: Window.h:306
arm_compute::IKernel::window
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
arm_compute::get_cl_type_from_data_type
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:41
arm_compute::has_padding_changed
bool has_padding_changed(const std::unordered_map< const ITensorInfo *, PaddingSize > &padding_map)
Check if the previously stored padding info has changed after configuring a kernel.
Definition: Utils.cpp:491
arm_compute::ICLKernel::lws_hint
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:383
arm_compute::GEMM
@ GEMM
GEMM CL kernel type.
Definition: CLTypes.h:84
arm_compute::get_padding_info
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo * > infos)
Stores padding information before configuring a kernel.
Definition: Utils.cpp:476
arm_compute::test::validation::reference::slice
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
Definition: SliceOperations.cpp:38
kernel_name
std::string kernel_name
Definition: ClIm2ColKernel.cpp:58
arm_compute::enqueue
void enqueue(cl::CommandQueue &queue, ICLKernel &kernel, const Window &window, const cl::NDRange &lws_hint=CLKernelLibrary::get().default_ndrange(), bool use_dummy_work_items=false)
Add the kernel to the command queue with the given window.
Definition: ICLKernel.cpp:33