21.02
|
Neon kernel to multiply two input matrices "A" and "B". More...
#include <NEGEMMMatrixMultiplyKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEGEMMMatrixMultiplyKernel () | |
Constructor. More... | |
NEGEMMMatrixMultiplyKernel (const NEGEMMMatrixMultiplyKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMMatrixMultiplyKernel & | operator= (const NEGEMMMatrixMultiplyKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMMatrixMultiplyKernel (NEGEMMMatrixMultiplyKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NEGEMMMatrixMultiplyKernel & | operator= (NEGEMMMatrixMultiplyKernel &&)=default |
Allow instances of this class to be moved. More... | |
void | configure (const ITensor *input0, const ITensor *input1, ITensor *output, float alpha, bool is_interleaved, const GEMMReshapeInfo &reshape_info=GEMMReshapeInfo()) |
Initialise the kernel's input and output. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. 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 Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input0, const ITensorInfo *input1, const ITensorInfo *output, float alpha, bool is_interleaved, const GEMMReshapeInfo &reshape_info) |
Static function to check if given info will lead to a valid configuration of NEGEMMMatrixMultiplyKernel. More... | |
Neon kernel to multiply two input matrices "A" and "B".
All elements of the output matrix/vector will be multiplied by alpha after the matrix multiplication
input0
and input1
are both matrices and reshaped respectively with NEGEMMInterleave4x4Kernel" and NEGEMMTranspose1xWKernel input0
is a vector and the second input tensor input1
a matrix. The implementation also assumes that both tensors have not been reshaped Definition at line 39 of file NEGEMMMatrixMultiplyKernel.h.
Constructor.
Definition at line 1088 of file NEGEMMMatrixMultiplyKernel.cpp.
Referenced by NEGEMMMatrixMultiplyKernel::name().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
void configure | ( | const ITensor * | input0, |
const ITensor * | input1, | ||
ITensor * | output, | ||
float | alpha, | ||
bool | is_interleaved, | ||
const GEMMReshapeInfo & | reshape_info = GEMMReshapeInfo() |
||
) |
Initialise the kernel's input and output.
input0
and input1
should be the output of the kernels: NEGEMMInterleave4x4Kernel and NEGEMMTranspose1xWKernel These two kernels change the layout of the original matrices to be more cache-friendly.[in] | input0 | Input tensor containing the interleaved Matrix A or the vector A. Data types supported: F16/F32 |
[in] | input1 | Input tensor containing the transposed Matrix B if the first input tensor A is not a vector. If the output tensor is a vector, input1 must contain the matrix B not reshaped. Data type supported: same as input0 |
[out] | output | Output tensor to store the result of matrix multiplication. Data type supported: same as input0 . |
[in] | alpha | Weight of the matrix product |
[in] | is_interleaved | (Optional) True if input0 and input1 have been reshaped respectively using NEGEMMInterleave4x4Kernel and NEGEMMTranspose1xWKernel |
[in] | reshape_info | (Optional) GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped |
Definition at line 1093 of file NEGEMMMatrixMultiplyKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), ICloneable< T >::clone(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F32, ITensor::info(), GEMMReshapeInfo::m(), GEMMReshapeInfo::n(), ITensorInfo::num_dimensions(), TensorShape::set(), Dimensions< T >::set_num_dimensions(), ITensorInfo::set_valid_region(), ITensorInfo::tensor_shape(), and arm_compute::validate_arguments().
Referenced by NEGEMMMatrixMultiplyKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 42 of file NEGEMMMatrixMultiplyKernel.h.
References NEGEMMMatrixMultiplyKernel::configure(), arm_compute::test::validation::info, NEGEMMMatrixMultiplyKernel::NEGEMMMatrixMultiplyKernel(), NEGEMMMatrixMultiplyKernel::operator=(), NEGEMMMatrixMultiplyKernel::run(), NEGEMMMatrixMultiplyKernel::validate(), and IKernel::window().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NEGEMMMatrixMultiplyKernel::name().
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 1144 of file NEGEMMMatrixMultiplyKernel.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, ITensor::info(), and IKernel::window().
Referenced by NEGEMMMatrixMultiplyKernel::name().
|
static |
Static function to check if given info will lead to a valid configuration of NEGEMMMatrixMultiplyKernel.
[in] | input0 | Input tensor containing the interleaved Matrix A or the vector A. Data types supported: F16/F32 |
[in] | input1 | Input tensor containing the transposed Matrix B if the first input tensor A is not a vector. If the output tensor is a vector, input1 must contain the matrix B not reshaped. Data type supported: same as input0 |
[in] | output | Output tensor to store the result of matrix multiplication. Data type supported: same as input0 . |
[in] | alpha | Weight of the matrix product |
[in] | is_interleaved | (Optional) True if input0 and input1 have been reshaped respectively using NEGEMMInterleave4x4Kernel and NEGEMMTranspose1xWKernel |
[in] | reshape_info | (Optional) GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped |
Definition at line 1136 of file NEGEMMMatrixMultiplyKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::validate_arguments().
Referenced by NEGEMMMatrixMultiplyKernel::name(), and NEGEMM::validate().