24.04
|
Function to execute MatMul Operation. More...
#include <CpuMatMul.h>
Public Member Functions | |
CpuMatMul () | |
~CpuMatMul ()=default | |
ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (CpuMatMul) | |
void | configure (ITensorInfo *lhs, ITensorInfo *rhs, ITensorInfo *dst, const MatMulInfo &info, const CpuMatMulSettings &settings, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Configure operator for a given list of arguments. More... | |
void | run (ITensorPack &tensors) override |
Run the kernels contained in the function. More... | |
experimental::MemoryRequirements | workspace () const override |
Return the memory requirements required by the workspace. More... | |
Public Member Functions inherited from INEOperator | |
INEOperator (IRuntimeContext *ctx=nullptr) | |
Constructor. More... | |
INEOperator (const INEOperator &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator (INEOperator &&)=default | |
Default move constructor. More... | |
INEOperator & | operator= (const INEOperator &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator & | operator= (INEOperator &&)=default |
Default move assignment operator. More... | |
~INEOperator () | |
Default destructor. More... | |
void | prepare (ITensorPack &constants) override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IOperator | |
virtual | ~IOperator ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *lhs, const ITensorInfo *rhs, const ITensorInfo *dst, const MatMulInfo &info, const CpuMatMulSettings &settings, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration. More... | |
Function to execute MatMul Operation.
This function calls the following functions/kernels:
If adjoint/adj flag is enabled for either input lhs or rhs (or both) :
Definition at line 49 of file CpuMatMul.h.
CpuMatMul | ( | ) |
Definition at line 85 of file CpuMatMul.cpp.
|
default |
ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE | ( | CpuMatMul | ) |
void configure | ( | ITensorInfo * | lhs, |
ITensorInfo * | rhs, | ||
ITensorInfo * | dst, | ||
const MatMulInfo & | info, | ||
const CpuMatMulSettings & | settings, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() |
||
) |
Configure operator for a given list of arguments.
Note: Check documentation of NEMatMul for a list of supported datatypes and layouts
[in] | lhs | Left-hand side tensor info. |
[in] | rhs | Right-hand side tensor info. |
[out] | dst | Output tensor to store the result of the batched matrix multiplication. Data types supported: same as lhs / rhs . |
[in] | info | Contains MatMul operation information described in MatMulInfo. |
[in] | settings | The settings for matmul operation (i.e fast math) |
[in] | act_info | Class containing information about fused activation function. |
Definition at line 174 of file CpuMatMul.cpp.
References arm_compute::test::validation::act_info, AsmGemmInfo::activation_info, arm_compute::ANY, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, ICloneable< T >::clone(), TensorShape::collapsed_from(), ITensorInfo::data_type(), arm_compute::test::validation::dst, CpuMatMulSettings::fast_math(), AsmGemmInfo::fast_mode, CpuMatMulSettings::fixed_format(), AsmGemmInfo::fixed_format, CpuGemmAssemblyDispatch::has_opt_impl(), arm_compute::test::validation::info, arm_compute::is_data_type_quantized(), arm_compute::is_fixed_format_fast_math(), AsmGemmInfo::negated_offsets, arm_compute::offset_int_vec(), AsmGemmInfo::output_stage, TensorInfo::set_tensor_shape(), TensorInfo::tensor_shape(), ITensorInfo::total_size(), CpuMatMul::validate(), AsmGemmInfo::weight_format, Dimensions< T >::x(), Dimensions< T >::y(), and Dimensions< T >::z().
|
overridevirtual |
Run the kernels contained in the function.
[in] | tensors | Vector that contains the tensors to operate on. |
Reimplemented from INEOperator.
Definition at line 277 of file CpuMatMul.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, ITensorPack::add_const_tensor(), TensorShape::collapsed_from(), Window::DimY, arm_compute::test::validation::dst, Scheduler::get(), CpuAuxTensorHandler::get(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), ITensor::info(), arm_compute::offset_int_vec(), IScheduler::schedule_op(), ITensorInfo::set_tensor_shape(), Dimensions< T >::x(), Dimensions< T >::y(), and Dimensions< T >::z().
|
static |
Static function to check if given info will lead to a valid configuration.
Similar to CpuMatMul::configure()
Definition at line 97 of file CpuMatMul.cpp.
References arm_compute::test::validation::act_info, arm_compute::ANY, ITensorInfo::are_values_constant(), ARM_COMPUTE_RETURN_ERROR_ON_CPU_BF16_UNSUPPORTED, ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::auto_init_if_empty(), arm_compute::BFLOAT16, ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_transposed_shape(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::test::validation::dst, arm_compute::F16, arm_compute::F32, CpuMatMulSettings::fast_math(), CpuMatMulSettings::fixed_format(), CpuGemmAssemblyDispatch::has_opt_impl(), arm_compute::test::validation::info, arm_compute::is_data_type_quantized(), Dimensions< int >::num_max_dimensions, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, CpuTransposeKernel::validate(), and CpuGemmAssemblyDispatch::validate().
Referenced by CpuMatMul::configure(), and NEMatMul::validate().
|
overridevirtual |
Return the memory requirements required by the workspace.
Reimplemented from INEOperator.
Definition at line 326 of file CpuMatMul.cpp.