23.08
|
Basic function to execute GEMM on OpenCL. More...
#include <CLGEMM.h>
Public Member Functions | |
CLGEMM (std::shared_ptr< IMemoryManager > memory_manager=nullptr, IWeightsManager *weights_manager=nullptr) | |
Default constructor. More... | |
~CLGEMM () | |
Default destructor. More... | |
CLGEMM (const CLGEMM &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLGEMM (CLGEMM &&) | |
Default move constructor. More... | |
CLGEMM & | operator= (const CLGEMM &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLGEMM & | operator= (CLGEMM &&) |
Default move assignment operator. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, float alpha, float beta, const GEMMInfo &gemm_info=GEMMInfo()) |
Initialise the kernel's inputs and output. More... | |
void | configure (const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, float alpha, float beta, const GEMMInfo &gemm_info=GEMMInfo()) |
Initialise the kernel's inputs and output. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
![]() | |
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 CLGEMM. More... | |
CLGEMM | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr , |
IWeightsManager * | weights_manager = nullptr |
||
) |
Default constructor.
[in] | memory_manager | (Optional) Memory manager. |
[in] | weights_manager | (Optional) Weights manager. |
Definition at line 54 of file CLGEMM.cpp.
|
default |
Default destructor.
Prevent instances of this class from being copied (As this class contains pointers)
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | a, | ||
const ICLTensor * | b, | ||
const ICLTensor * | c, | ||
ICLTensor * | output, | ||
float | alpha, | ||
float | beta, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs and output.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
F32 | F32 | F32 | F32 |
F16 | F16 | F16 | F16 |
[in] | compile_context | The compile context to be used. |
[in] | a | First input tensor (Matrix or Vector A). Data types supported: 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] | output | 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. GEMMInfo also contains information about the reshaping in case matrix A and matrix B have been already transformed. |
Definition at line 68 of file CLGEMM.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::test::validation::b, arm_compute::test::validation::gemm_info, and ITensor::info().
Referenced by CLRNNLayer::configure(), CLGEMM::configure(), CLGEMMDeconvolutionLayer::configure(), and CLLSTMLayer::configure().
void configure | ( | const ICLTensor * | a, |
const ICLTensor * | b, | ||
const ICLTensor * | c, | ||
ICLTensor * | output, | ||
float | alpha, | ||
float | beta, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs and output.
Similar to CLGEMM::configure()
Definition at line 63 of file CLGEMM.cpp.
References arm_compute::test::validation::b, CLGEMM::configure(), arm_compute::test::validation::gemm_info, and CLKernelLibrary::get().
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 108 of file CLGEMM.cpp.
References arm_compute::ACL_SRC_1, arm_compute::mlgo::parser::end(), and arm_compute::test::validation::m.
Referenced by CLRNNLayer::prepare(), CLGEMMDeconvolutionLayer::prepare(), and CLGEMM::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 99 of file CLGEMM.cpp.
References CLGEMM::prepare().
Referenced by CLRNNLayer::run(), CLGEMMDeconvolutionLayer::run(), and CLLSTMLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of CLGEMM.
Similar to CLGEMM::configure()
Definition at line 94 of file CLGEMM.cpp.
References arm_compute::test::validation::b, arm_compute::test::validation::gemm_info, and ClGemm::validate().
Referenced by CLRNNLayer::validate(), CLGEMMDeconvolutionLayer::validate(), and CLLSTMLayer::validate().