21.08
|
Basic function to execute GEMM. More...
#include <NEGEMM.h>
Public Member Functions | |
NEGEMM (std::shared_ptr< IMemoryManager > memory_manager=nullptr, IWeightsManager *weights_manager=nullptr) | |
Constructor. More... | |
NEGEMM (const NEGEMM &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMM (NEGEMM &&)=default | |
Default move constructor. More... | |
NEGEMM & | operator= (const NEGEMM &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMM & | operator= (NEGEMM &&)=default |
Default move assignment operator. More... | |
~NEGEMM () | |
Default destructor. More... | |
void | configure (const ITensor *a, const ITensor *b, const ITensor *c, ITensor *d, float alpha, float beta, const GEMMInfo &gemm_info=GEMMInfo()) |
Initialise the kernel's inputs, output. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *a, const ITensorInfo *b, const ITensorInfo *c, const ITensorInfo *output, float alpha, float beta, const GEMMInfo &gemm_info=GEMMInfo()) |
Static function to check if given info will lead to a valid configuration of NEGEMM. More... | |
Basic function to execute GEMM.
This function calls the following kernels:
NEGEMM | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr , |
IWeightsManager * | weights_manager = nullptr |
||
) |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default destructor.
Referenced by NEGEMM::NEGEMM().
void configure | ( | const ITensor * | a, |
const ITensor * | b, | ||
const ITensor * | c, | ||
ITensor * | d, | ||
float | alpha, | ||
float | beta, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs, output.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
F32 | F32 | F32 | F32 |
F16 | F16 | F16 | F16 |
BFLOAT16 | BFLOAT16 | BFLOAT16 | BFLOAT16 |
[in] | a | First input tensor (Matrix A or Vector A). Data type supported: BFLOAT16/F16/F32 |
[in] | b | Second input tensor (Matrix B). Data type supported: same as a |
[in] | c | Third input tensor (Matrix C). It can be a nullptr if just the multiplication between a and b is needed. Data type supported: same as a |
[out] | d | Output tensor. Data type supported: same as a |
[in] | alpha | Weight of the matrix product |
[in] | beta | Weight of matrix C |
[in] | gemm_info | (Optional) Specifies if the matrix A and/or matrix B have been reshaped and if the reshape of matrix B should happen only for the first run |
Definition at line 64 of file NEGEMM.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::test::validation::b, ITensor::info(), and CpuGemm::validate().
Referenced by NERNNLayer::configure(), and NELSTMLayer::configure().
Prevent instances of this class from being copied (As this class contains pointers)
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
Reimplemented from IFunction.
Definition at line 95 of file NEGEMM.cpp.
References arm_compute::ACL_SRC_1, and arm_compute::mlgo::parser::end().
Referenced by NERNNLayer::prepare(), and NEGEMM::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 87 of file NEGEMM.cpp.
References NEGEMM::prepare().
Referenced by NERNNLayer::run(), and NELSTMLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of NEGEMM.
Similar to NEGEMM::configure()
Definition at line 82 of file NEGEMM.cpp.
References CpuGemm::validate().
Referenced by NELSTMLayer::validate().