21.02
|
Basic function to execute GEMMLowpMatrixMultiplyCore on OpenCL. More...
#include <CLGEMMLowpMatrixMultiplyCore.h>
Public Member Functions | |
CLGEMMLowpMatrixMultiplyCore (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
CLGEMMLowpMatrixMultiplyCore (const CLGEMMLowpMatrixMultiplyCore &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLGEMMLowpMatrixMultiplyCore (CLGEMMLowpMatrixMultiplyCore &&)=default | |
Default move constructor. More... | |
CLGEMMLowpMatrixMultiplyCore & | operator= (const CLGEMMLowpMatrixMultiplyCore &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLGEMMLowpMatrixMultiplyCore & | operator= (CLGEMMLowpMatrixMultiplyCore &&)=default |
Default move assignment operator. More... | |
~CLGEMMLowpMatrixMultiplyCore () | |
Default destructor. More... | |
void | configure (const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, const GEMMInfo &gemm_info=GEMMInfo()) |
Initialise the kernel's inputs, output. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *a, const ICLTensor *b, const ICLTensor *c, ICLTensor *output, 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, const GEMMInfo &gemm_info=GEMMInfo()) |
Static function to check if given info will lead to a valid configuration of CLGEMMLowpMatrixMultiplyCore. More... | |
Basic function to execute GEMMLowpMatrixMultiplyCore on OpenCL.
Definition at line 47 of file CLGEMMLowpMatrixMultiplyCore.h.
CLGEMMLowpMatrixMultiplyCore | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
Definition at line 190 of file CLGEMMLowpMatrixMultiplyCore.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Default destructor.
void configure | ( | const ICLTensor * | a, |
const ICLTensor * | b, | ||
const ICLTensor * | c, | ||
ICLTensor * | output, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs, output.
[in] | a | First input tensor (Matrix A). Data type supported: QASYMM8/QASYMM8_SIGNED. |
[in] | b | Second input tensor (Matrix B). Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8/QSYMM8_PER_CHANNEL |
[in] | c | Third input tensor (Matrix C). It can be a nullptr. Data type supported: S32 |
[out] | output | Output tensor. Data type supported: S32 or QASYMM8/QASYMM8_SIGNED if gemm_info.gemmlowp_output_stage != NONE |
[in] | gemm_info | (Optional) Specifies if the matrix A and/or matrix B have been reshaped and if the reshape of matrix B should be executed only for the first run |
Definition at line 223 of file CLGEMMLowpMatrixMultiplyCore.cpp.
References CLKernelLibrary::get().
Referenced by CLQLSTMLayer::CLQLSTMLayer(), CLGEMMDeconvolutionLayer::configure(), and CLLSTMLayerQuantized::configure().
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | a, | ||
const ICLTensor * | b, | ||
const ICLTensor * | c, | ||
ICLTensor * | output, | ||
const GEMMInfo & | gemm_info = GEMMInfo() |
||
) |
Initialise the kernel's inputs, output.
[in] | compile_context | The compile context to be used. |
[in] | a | First input tensor (Matrix A). Data type supported: QASYMM8/QASYMM8_SIGNED. |
[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. Data type supported: S32 |
[out] | output | Output tensor. Data type supported: S32 or QASYMM8/QASYMM8_SIGNED if gemm_info.gemmlowp_output_stage != NONE |
[in] | gemm_info | (Optional) Specifies if the matrix A and/or matrix B have been reshaped and if the reshape of matrix B should be executed only for the first run |
Definition at line 228 of file CLGEMMLowpMatrixMultiplyCore.cpp.
References GEMMKernelInfo::a_offset, CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::test::validation::b, GEMMKernelInfo::b_offset, arm_compute::misc::shape_calculator::compute_reductionA_shape(), arm_compute::misc::shape_calculator::compute_reductionB_shape(), ITensorInfo::data_type(), GEMMKernelInfo::depth_output_gemm3d, GEMMInfo::depth_output_gemm3d(), ITensorInfo::dimension(), GEMMLowpOutputStageInfo::gemmlowp_multipliers, GEMMInfo::gemmlowp_output_stage(), GEMMLowpOutputStageInfo::gemmlowp_shifts, CLScheduler::get(), ITensor::info(), CLTensor::info(), ITensorAllocator::init(), arm_compute::is_data_type_quantized_per_channel(), arm_compute::is_data_type_quantized_symmetric(), GEMMLowpOutputStageInfo::is_quantized_per_channel, GEMMKernelInfo::k, GEMMKernelInfo::lhs_info, GEMMKernelInfo::m, MemoryGroup::manage(), CLTensor::map(), GEMMKernelInfo::n, arm_compute::NONE, UniformQuantizationInfo::offset, GEMMLowpOutputStageInfo::output_data_type, GEMMKernelInfo::output_stage, ITensor::ptr_to_element(), arm_compute::QASYMM8, ITensorInfo::quantization_info(), arm_compute::QUANTIZE_DOWN_FIXEDPOINT, GEMMKernelInfo::reinterpret_input_as_3d, GEMMInfo::reinterpret_input_as_3d(), GEMMInfo::reshape_b_only_on_first_run(), GEMMKernelInfo::rhs_info, arm_compute::S32, CLScheduler::target(), GEMMLowpOutputStageInfo::type, QuantizationInfo::uniform(), CLTensor::unmap(), CLGEMMLowpMatrixMultiplyCore::validate(), arm_compute::test::validation::weights_info, and arm_compute::WRAP.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
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 668 of file CLGEMMLowpMatrixMultiplyCore.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON, CLScheduler::enqueue(), CLScheduler::get(), ITensor::is_used(), ITensor::mark_as_unused(), and CLScheduler::queue().
Referenced by CLGEMMDeconvolutionLayer::prepare(), CLGEMMConvolutionLayer::prepare(), and CLGEMMLowpMatrixMultiplyCore::run().
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 620 of file CLGEMMLowpMatrixMultiplyCore.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), and CLGEMMLowpMatrixMultiplyCore::prepare().
Referenced by CLGEMMDeconvolutionLayer::run(), CLLSTMLayerQuantized::run(), CLFullyConnectedLayer::run(), CLQLSTMLayer::run(), and CLGEMMConvolutionLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of CLGEMMLowpMatrixMultiplyCore.
[in] | a | First input tensor info (Matrix A). Data type supported: QASYMM8. |
[in] | b | Second input tensor info (Matrix B). Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8/QSYMM8_PER_CHANNEL |
[in] | c | Third input tensor info (Matrix C). It can be a nullptr. Data type supported: S32 |
[in] | output | Output tensor info. Data type supported: S32 or QASYMM8/QASYMM8_SIGNED if gemm_info.gemmlowp_output_stage != NONE |
[in] | gemm_info | (Optional) Specifies if the matrix A and/or matrix B have been reshaped and if the reshape of matrix B should be executed only for the first run |
Definition at line 437 of file CLGEMMLowpMatrixMultiplyCore.cpp.
References GEMMKernelInfo::a_offset, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::auto_init_if_empty(), GEMMKernelInfo::b_offset, ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_mm_shape(), arm_compute::misc::shape_calculator::compute_reductionA_shape(), arm_compute::misc::shape_calculator::compute_reductionB_shape(), arm_compute::misc::shape_calculator::compute_rhs_reshaped_shape(), ITensorInfo::data_type(), GEMMKernelInfo::depth_output_gemm3d, GEMMInfo::depth_output_gemm3d(), ITensorInfo::dimension(), GEMMLowpOutputStageInfo::gemmlowp_multipliers, GEMMInfo::gemmlowp_output_stage(), CLScheduler::get(), GEMMInfo::is_a_reshaped(), GEMMInfo::is_b_reshaped(), arm_compute::is_data_type_quantized_asymmetric(), arm_compute::is_data_type_quantized_per_channel(), arm_compute::is_data_type_quantized_symmetric(), GEMMLowpOutputStageInfo::is_quantized_per_channel, GEMMKernelInfo::k, GEMMKernelInfo::lhs_info, GEMMKernelInfo::m, GEMMKernelInfo::n, arm_compute::NONE, UniformQuantizationInfo::offset, GEMMLowpOutputStageInfo::output_data_type, GEMMKernelInfo::output_stage, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM8, arm_compute::QSYMM8_PER_CHANNEL, ITensorInfo::quantization_info(), arm_compute::QUANTIZE_DOWN_FIXEDPOINT, GEMMKernelInfo::reinterpret_input_as_3d, GEMMInfo::reinterpret_input_as_3d(), GEMMInfo::reshape_b_only_on_first_run(), GEMMKernelInfo::rhs_info, arm_compute::S32, arm_compute::cl_gemm::auto_heuristics::select_default_gemm_config_native(), arm_compute::cl_gemm::auto_heuristics::select_default_gemm_config_reshaped_only_rhs(), CLScheduler::target(), ITensorInfo::total_size(), GEMMLowpOutputStageInfo::type, QuantizationInfo::uniform(), CLDepthConvertLayerKernel::validate(), CLGEMMLowpMatrixMultiplyNativeKernel::validate(), CLGEMMLowpOffsetContributionKernel::validate(), CLGEMMLowpOffsetContributionOutputStageKernel::validate(), CLGEMMLowpMatrixAReductionKernel::validate(), CLGEMMReshapeRHSMatrixKernel::validate(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::validate(), CLGEMMLowpMatrixBReductionKernel::validate(), arm_compute::test::validation::weights_info, and arm_compute::WRAP.
Referenced by CLGEMMLowpMatrixMultiplyCore::configure(), CLGEMMDeconvolutionLayer::validate(), and CLLSTMLayerQuantized::validate().