21.02
|
Basic function to execute GEMM on OpenGLES Compute. More...
#include <GCGEMM.h>
Public Member Functions | |
GCGEMM (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
GCGEMM (const GCGEMM &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCGEMM (GCGEMM &&)=default | |
Default move constructor. More... | |
GCGEMM & | operator= (const GCGEMM &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCGEMM & | operator= (GCGEMM &&)=default |
Default move assignment operator. More... | |
void | configure (const IGCTensor *a, const IGCTensor *b, const IGCTensor *c, IGCTensor *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... | |
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 IGCTensor *c, const ITensorInfo *output, const float alpha, const float beta, const GEMMInfo &gemm_info=GEMMInfo()) |
Static function to check if given info will lead to a valid configuration of GCGEMM. More... | |
Basic function to execute GEMM on OpenGLES Compute.
This function calls the following kernels:
GCGEMM | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 75 of file GCGEMM.cpp.
Prevent instances of this class from being copied (As this class contains pointers)
void configure | ( | const IGCTensor * | a, |
const IGCTensor * | b, | ||
const IGCTensor * | c, | ||
IGCTensor * | output, | ||
float | alpha, | ||
float | beta, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs and output.
[in] | a | First input tensor (Matrix or Vector A). Data types supported: 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 |
Definition at line 81 of file GCGEMM.cpp.
References ITensorAllocator::allocate(), GCTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::test::validation::b, GCGEMMMatrixAdditionKernel::configure(), GCGEMMTranspose1xWKernel::configure(), GCGEMMMatrixMultiplyKernel::configure(), GCGEMMInterleave4x4Kernel::configure(), ITensorInfo::dimension(), GCScheduler::get(), GCScheduler::get_target(), ITensor::info(), MemoryGroup::manage(), GEMMInfo::reshape_b_only_on_first_run(), IGCKernel::set_target(), and arm_compute::validate_arguments().
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 192 of file GCGEMM.cpp.
References ITensorAllocator::allocate(), GCTensor::allocator(), ARM_COMPUTE_ERROR_ON, GCScheduler::dispatch(), GCScheduler::get(), ITensor::is_used(), ITensor::mark_as_unused(), and GCScheduler::memory_barrier().
Referenced by GCGEMM::run().
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 161 of file GCGEMM.cpp.
References GCScheduler::dispatch(), GCScheduler::get(), GCScheduler::memory_barrier(), and GCGEMM::prepare().
Referenced by GCConvolutionLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of GCGEMM.
[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 |
Definition at line 155 of file GCGEMM.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::validate_arguments().