Compute Library
 22.11
ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel Class Reference

OpenCL kernel to multiply matrices with QASYMM8/QASYMM8_SIGNED data types when only the input matrix RHS (src1) has been reshaped using the MMUL instruction. More...

#include <ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel.h>

Collaboration diagram for ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel:
[legend]

Public Member Functions

 ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel ()
 
 ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel)
 
void configure (const CLCompileContext &compile_context, const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, const GEMMKernelInfo &gemm_info, ITensorInfo *vector_sum_col=nullptr, const ITensorInfo *vector_sum_row=nullptr, ITensorInfo *bias=nullptr, ITensorInfo *output_multipliers=nullptr, ITensorInfo *output_shifts=nullptr)
 Initialise the kernel's source and destination. 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...
 
virtual void run_composite_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue, const experimental::dynamic_fusion::ClExecutionDescriptor &exec_desc)
 The execution is carried out through run_op method. But the run_op method needs to be extended to include ClExecutionDescriptor as now LWS GWS tuning will be separated from the IKernel. 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...
 
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 GEMMKernelInfo &gemm_info, const ITensorInfo *vector_sum_col=nullptr, const ITensorInfo *vector_sum_row=nullptr, const ITensorInfo *bias=nullptr, const ITensorInfo *output_multipliers=nullptr, const ITensorInfo *output_shifts=nullptr)
 Static function to check if given info will lead to a valid configuration. More...
 
- Static Public Member Functions inherited from ICLKernel
static constexpr unsigned int num_arguments_per_3d_tensor_nhw ()
 Returns the number of arguments enqueued per NHW 3D Tensor object. More...
 
static constexpr unsigned int num_arguments_per_4d_tensor_nhwc ()
 Returns the number of arguments enqueued per NHWC 4D Tensor object. More...
 
static constexpr unsigned int num_arguments_per_1D_array ()
 Returns the number of arguments enqueued per 1D array object. More...
 
static constexpr unsigned int num_arguments_per_1D_tensor ()
 Returns the number of arguments enqueued per 1D tensor object. More...
 
static constexpr unsigned int num_arguments_per_2D_tensor ()
 Returns the number of arguments enqueued per 2D tensor object. More...
 
static constexpr unsigned int num_arguments_per_3D_tensor ()
 Returns the number of arguments enqueued per 3D tensor object. More...
 
static constexpr 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)
 Get the global work size given an execution window. More...
 

Detailed Description

OpenCL kernel to multiply matrices with QASYMM8/QASYMM8_SIGNED data types when only the input matrix RHS (src1) has been reshaped using the MMUL instruction.

Note
The input matrix src1 must be reshaped through opencl::kernels::ClGemmReshapeRhsMatrixKernel
For fused output stage, only GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT type is supported

Definition at line 42 of file ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel.h.

Constructor & Destructor Documentation

◆ ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel()

Member Function Documentation

◆ ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE()

ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE ( ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel  )

◆ configure()

void configure ( const CLCompileContext compile_context,
const ITensorInfo src0,
const ITensorInfo src1,
ITensorInfo dst,
const GEMMKernelInfo gemm_info,
ITensorInfo vector_sum_col = nullptr,
const ITensorInfo vector_sum_row = nullptr,
ITensorInfo bias = nullptr,
ITensorInfo output_multipliers = nullptr,
ITensorInfo output_shifts = nullptr 
)

Initialise the kernel's source and destination.

Parameters
[in]compile_contextThe compile context to be used.
[in]src0Input tensor containing the LHS matrix. Data type supported: QASYMM8/QASYMM8_SIGNED
[in]src1Input tensor containing the RHS reshaped matrix. Data type supported: same as src0
[out]dstDestination tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/S32.
[in]gemm_infoGEMM information used to retrieve the original dimensions of the input matrices, output stage information and RHS/LHS info. lhs_info.m0: 1,2,4 Only the following values are supported for RHS info: rhs_info.n0: 1,4,8 rhs_info.k0: same as lhs_info.k0: 4 rhs_info.transpose: true
[in]vector_sum_col(Optional) Input row-vector of sums of all the entries in each column of matrix B. Note: vector_sum_col can be a nullptr in case a_offset = 0. Data type supported: S32
[in]vector_sum_row(Optional) Input row-vector of sums of all the entries in each row of matrix A. Note: vector_sum_row can be a nullptr in case b_offset = 0. Data type supported: S32
[in]bias(Optional) Biases tensor. Can be a nullptr if the addition of biases is not required. Biases are 1D tensor with dimensions [OFM] or same dimensionality as dst if gemm_info.broadcast_bias is false. Data type supported: S32.
[in]output_multipliers(Optional) Output multipliers tensor. Supported data types: S32.
[in]output_shifts(Optional) Output shifts tensor. Supported data types: S32.

Definition at line 289 of file ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp.

References GEMMKernelInfo::a_offset, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, GEMMKernelInfo::b_offset, arm_compute::test::validation::dst, arm_compute::get_padding_info(), GEMMKernelInfo::lhs_info, GEMMKernelInfo::output_stage, GEMMKernelInfo::rhs_info, and arm_compute::cpu::kernels::validate_arguments().

293 {
294  ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst);
295  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src0, src1, dst, gemm_info, vector_sum_col, vector_sum_row, bias, output_multipliers, output_shifts));
296 
297  auto padding_info = get_padding_info({ src0, src1, dst, vector_sum_row });
298  const GEMMRHSMatrixInfo rhs_info = gemm_info.rhs_info;
299  const GEMMLHSMatrixInfo lhs_info = gemm_info.lhs_info;
300  const GEMMLowpOutputStageInfo output_stage = gemm_info.output_stage;
301  const int32_t a_offset = gemm_info.a_offset;
302  const int32_t b_offset = gemm_info.b_offset;
303  constexpr int mmul_m0 = 4;
304  constexpr int mmul_n0 = 4;
305  constexpr int mmul_k0 = 16;
306 
307  _m = gemm_info.m;
308  _n = gemm_info.n;
309  _k = gemm_info.k;
310 
311  ElementsProcessed num_elements_processed{};
312 
313  // Configure kernel window
314  auto win_config = validate_and_configure_window(src0, src1, dst, gemm_info, vector_sum_col, vector_sum_row, bias, output_multipliers, output_shifts, num_elements_processed);
315  ARM_COMPUTE_ERROR_THROW_ON(win_config.first);
316  ICLKernel::configure_internal(win_config.second);
317 
318  const unsigned int m0_leftover = _m % lhs_info.m0;
319  const unsigned int n0_leftover = _n % rhs_info.n0;
320 
321  // Create build options
322  CLBuildOptions build_opts;
323  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(src0->data_type()));
324  build_opts.add_option("-DVEC_TYPE=" + get_cl_type_from_data_type(src0->data_type()) + "4");
325  build_opts.add_option("-DACC_DATA_TYPE=int");
326  build_opts.add_option("-DOUT_DATA_TYPE=" + get_cl_type_from_data_type(dst->data_type()));
327  build_opts.add_option("-DM0=" + support::cpp11::to_string(lhs_info.m0));
328  build_opts.add_option("-DN0=" + support::cpp11::to_string(rhs_info.n0));
329  build_opts.add_option("-DK0=" + support::cpp11::to_string(rhs_info.k0));
330  build_opts.add_option("-DM0_LEFTOVER=" + support::cpp11::to_string(m0_leftover));
331  build_opts.add_option("-DN0_LEFTOVER=" + support::cpp11::to_string(n0_leftover));
332  build_opts.add_option("-DMMUL_M0=" + support::cpp11::to_string(mmul_m0));
333  build_opts.add_option("-DMMUL_N0=" + support::cpp11::to_string(mmul_n0));
334  build_opts.add_option("-DMMUL_K0=" + support::cpp11::to_string(mmul_k0));
335  build_opts.add_option("-DACTIVATION_TYPE=" + lower_string(string_from_activation_func(gemm_info.activation_info.activation())));
336  build_opts.add_option("-DA_VAL=" + float_to_string_with_full_precision(gemm_info.activation_info.a()));
337  build_opts.add_option("-DB_VAL=" + float_to_string_with_full_precision(gemm_info.activation_info.b()));
338 
339  std::string kernel_name("gemmlowp_mm_reshaped_only_rhs_mmul");
340 
342  {
343  build_opts.add_option("-DFUSED_OUTPUT_STAGE_FIXED_POINT");
344  _fuse_output_stage = true;
345  // If a_offset == 0, vector_sum_col can be a nullptr
346  if(a_offset != 0 && vector_sum_col != nullptr)
347  {
348  build_opts.add_option("-DA_OFFSET=" + support::cpp11::to_string(a_offset));
349  build_opts.add_option_if(vector_sum_col->tensor_shape().num_dimensions() > 1, "-DSUM_COL_HAS_BATCHES");
350  }
351  // If b_offset == 0, vector_sum_row can be a nullptr
352  build_opts.add_option_if(b_offset != 0, "-DB_OFFSET=" + support::cpp11::to_string(b_offset));
353  build_opts.add_option("-DK_OFFSET=" + support::cpp11::to_string(a_offset * b_offset * src0->dimension(0)));
354  build_opts.add_option_if(bias != nullptr, "-DADD_BIAS");
355  build_opts.add_option_if(gemm_info.broadcast_bias == true, "-DBROADCAST_BIAS");
356  build_opts.add_option("-DRESULT_OFFSET=" + support::cpp11::to_string(output_stage.gemmlowp_offset));
357  build_opts.add_option("-DRESULT_MULTIPLIER=" + support::cpp11::to_string(output_stage.gemmlowp_multipliers[0]));
358  build_opts.add_option("-DRESULT_SHIFT=" + support::cpp11::to_string(output_stage.gemmlowp_shifts[0]));
359 
360  const int min = output_stage.gemmlowp_min_bound;
361  const int max = output_stage.gemmlowp_max_bound;
362 
363  PixelValue min_val{};
364  PixelValue max_val{};
365  std::tie(min_val, max_val) = get_min_max(dst->data_type());
366  build_opts.add_option_if(min != min_val.get<int32_t>(), "-DMIN_BOUND=" + support::cpp11::to_string(min));
367  build_opts.add_option_if(max != max_val.get<int32_t>(), "-DMAX_BOUND=" + support::cpp11::to_string(max));
368  }
369 
370  // A macro guard to compile ONLY the kernel of interest
371  build_opts.add_option("-D" + upper_string(kernel_name));
372 
373  // Create kernel
374  _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
375 
376  // Set config_id for enabling LWS tuning
377  _config_id = kernel_name;
378  _config_id += "_";
379  _config_id += (bias != nullptr ? "add_bias_" : "");
380  _config_id += (gemm_info.broadcast_bias ? "broadcast_bias_" : "");
381  _config_id += (gemm_info.activation_info.enabled() ? "fused_activation_" : "");
382  _config_id += lower_string(string_from_data_type(src0->data_type()));
383  _config_id += "_";
384  _config_id += support::cpp11::to_string(_m);
385  _config_id += "_";
386  _config_id += support::cpp11::to_string(_n);
387  _config_id += "_";
388  _config_id += support::cpp11::to_string(_k);
389  _config_id += "_";
390  _config_id += support::cpp11::to_string(lhs_info.m0);
391  _config_id += "_";
392  _config_id += support::cpp11::to_string(rhs_info.n0);
393 
395 }
Quantize using a fixed point multiplication.
std::string to_string(T &&value)
Convert integer and float values to string.
#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
const std::string & string_from_activation_func(ActivationLayerInfo::ActivationFunction act)
Translates a given activation function to a string.
Definition: Utils.cpp:163
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
std::string lower_string(const std::string &val)
Lower a given string.
Definition: Utils.cpp:353
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
const OutputStage & output_stage
std::string upper_string(const std::string &val)
Raise a given string to upper case.
Definition: Utils.cpp:360
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:404
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
Definition: Utils.cpp:135
std::string float_to_string_with_full_precision(float val)
Create a string with the float in full precision.
Definition: Utils.h:1124
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:39
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:603
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
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:588
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157
std::string kernel_name
std::tuple< PixelValue, PixelValue > get_min_max(DataType dt)
Compute the mininum and maximum values a data type can take.
Definition: Utils.h:564
const int32_t * bias

◆ 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 418 of file ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, arm_compute::ACL_VEC_COL_SUM, arm_compute::ACL_VEC_ROW_SUM, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::first_slice_window_3D(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), arm_compute::test::validation::reference::slice(), and IKernel::window().

419 {
422 
423  const auto src0 = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0));
424  const auto src1 = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_1));
425  const auto src2 = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_2));
426  const auto vector_sum_col = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_VEC_COL_SUM));
427  const auto vector_sum_row = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_VEC_ROW_SUM));
428  auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST));
429 
430  ARM_COMPUTE_ERROR_ON_NULLPTR(src0, src1, dst);
431 
432  if(src1->info()->num_dimensions() < 3)
433  {
434  // The stride_z for matrix B must be zero if we do not slice
435  ARM_COMPUTE_ERROR_ON(src1->info()->strides_in_bytes()[3] != 0);
436  }
437 
438  cl::Image2D src1_image2d;
439 
441 
442  do
443  {
444  unsigned int idx = 0;
445 
446  add_3d_tensor_nhw_argument(idx, src0);
447  add_3d_tensor_nhw_argument(idx, src1);
448 
449  // Bias buffer (_add_bias == true)
450  if(src2 != nullptr)
451  {
452  add_3d_tensor_nhw_argument(idx, src2);
453  }
454  // dst buffer
455  add_3d_tensor_nhw_argument(idx, dst);
456 
457  // Pass m, n and k at runtime as signed ints, to ensure results of any subtraction they could be operand in, would still be signed.
458  _kernel.setArg<cl_int>(idx++, _m);
459  _kernel.setArg<cl_int>(idx++, _n);
460  _kernel.setArg<cl_int>(idx++, _k);
461 
462  if(_fuse_output_stage)
463  {
464  if(vector_sum_col != nullptr)
465  {
466  add_3d_tensor_nhw_argument(idx, vector_sum_col);
467  }
468  if(vector_sum_row != nullptr)
469  {
470  add_3d_tensor_nhw_argument(idx, vector_sum_row);
471  }
472  }
473 
474  enqueue(queue, *this, slice, cl::NDRange(32, 2), false);
475  }
476  while(window.slide_window_slice_3D(slice));
477 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
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:32
void add_3d_tensor_nhw_argument(unsigned int &idx, const ICLTensor *tensor)
Add the passed NHW 3D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments by passing strides...
Definition: ICLKernel.cpp:119
#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
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
Definition: Window.h:349
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:915
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157
Window first_slice_window_3D() const
First 3D slice of the window.
Definition: Window.h:305
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:201
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

◆ validate()

Status validate ( const ITensorInfo src0,
const ITensorInfo src1,
const ITensorInfo dst,
const GEMMKernelInfo gemm_info,
const ITensorInfo vector_sum_col = nullptr,
const ITensorInfo vector_sum_row = nullptr,
const ITensorInfo bias = nullptr,
const ITensorInfo output_multipliers = nullptr,
const ITensorInfo output_shifts = nullptr 
)
static

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

Similar to ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel::configure()

Returns
a status

Definition at line 397 of file ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel.cpp.

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

400 {
401  ElementsProcessed num_elements_processed{};
402  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(src0, src1, dst, gemm_info, vector_sum_col, vector_sum_row, bias, output_multipliers, output_shifts));
404  src1->clone().get(),
405  dst->clone().get(),
406  gemm_info,
407  vector_sum_col != nullptr ? vector_sum_col->clone().get() : nullptr,
408  vector_sum_row != nullptr ? vector_sum_row->clone().get() : nullptr,
409  bias != nullptr ? bias->clone().get() : nullptr,
410  output_multipliers != nullptr ? output_multipliers->clone().get() : nullptr,
411  output_shifts != nullptr ? output_shifts->clone().get() : nullptr,
412  num_elements_processed)
413  .first);
414 
415  return Status{};
416 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
const int32_t * bias

The documentation for this class was generated from the following files: