23.05
|
Perform reduction operation. More...
#include <CLReductionOperation.h>
Public Member Functions | |
CLReductionOperation (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default Constructor. More... | |
~CLReductionOperation () | |
Default Destructor. More... | |
CLReductionOperation (const CLReductionOperation &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLReductionOperation (CLReductionOperation &&)=default | |
Default move constructor. More... | |
CLReductionOperation & | operator= (const CLReductionOperation &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLReductionOperation & | operator= (CLReductionOperation &&)=default |
Default move assignment operator. More... | |
void | configure (ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
![]() | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, bool keep_dims=true) |
Static function to check if given info will lead to a valid configuration of CLReductionOperation. More... | |
Perform reduction operation.
Definition at line 44 of file CLReductionOperation.h.
CLReductionOperation | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default Constructor.
[in] | memory_manager | (Optional) Memory manager. |
Definition at line 41 of file CLReductionOperation.cpp.
References CLReductionOperation::~CLReductionOperation().
|
default |
Default Destructor.
Referenced by CLReductionOperation::CLReductionOperation().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
void configure | ( | ICLTensor * | input, |
ICLTensor * | output, | ||
unsigned int | axis, | ||
ReductionOperation | op, | ||
bool | keep_dims = true |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
QASYMM8 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED |
F16 | F16 |
F32 | F32 |
S32 | S32 |
[in] | input | Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32/S32. |
[out] | output | Destination tensor. Data types and data layouts supported: Same as input . |
[in] | axis | Axis along which to reduce. Supported reduction axis : 0, 1, 2, 3 |
[in] | op | Reduction operation to perform. Operations supported: MEAN_SUM, PROD, SUM_SQUARE, SUM, MIN, MAX |
[in] | keep_dims | (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
Definition at line 106 of file CLReductionOperation.cpp.
References CLKernelLibrary::get().
Referenced by CLL2NormalizeLayer::configure(), and CLFFTConvolutionLayer::configure().
void configure | ( | const CLCompileContext & | compile_context, |
ICLTensor * | input, | ||
ICLTensor * | output, | ||
unsigned int | axis, | ||
ReductionOperation | op, | ||
bool | keep_dims = true |
||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[in] | input | Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32/S32. |
[out] | output | Destination tensor. Data types and data layouts supported: Same as input . |
[in] | axis | Axis along which to reduce. Supported reduction axis : 0, 1, 2, 3 |
[in] | op | Reduction operation to perform. Operations supported: MEAN_SUM, PROD, SUM_SQUARE, SUM, MIN, MAX |
[in] | keep_dims | (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
Definition at line 111 of file CLReductionOperation.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, arm_compute::auto_init_if_empty(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), CLReshapeLayer::configure(), ITensorInfo::data_type(), ITensor::info(), MemoryGroup::manage(), arm_compute::test::validation::output_shape, and ITensorInfo::tensor_shape().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 139 of file CLReductionOperation.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), and CLReshapeLayer::run().
Referenced by CLL2NormalizeLayer::run(), and CLFFTConvolutionLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of CLReductionOperation.
[in] | input | Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32/S32. |
[in] | output | Destination tensor info. Data types and data layouts supported: Same as input . |
[in] | axis | Axis along which to reduce. Supported reduction axis : 0, 1, 2, 3 |
[in] | op | Reduction operation to perform. Operations supported: MEAN_SUM, PROD, SUM_SQUARE, SUM, MIN, MAX |
[in] | keep_dims | (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
Definition at line 48 of file CLReductionOperation.cpp.
References CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), arm_compute::test::validation::data_type, ITensorInfo::data_type(), ITensor::info(), ITensorAllocator::init(), arm_compute::test::validation::input, arm_compute::test::validation::input_shape, ITensorInfo::num_channels(), Dimensions< size_t >::num_max_dimensions, arm_compute::test::validation::qinfo, ITensorInfo::quantization_info(), TensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), arm_compute::test::validation::shape, ITensorInfo::tensor_shape(), ITensorInfo::total_size(), CLReshapeLayer::validate(), and CLReductionOperationKernel::validate().
Referenced by arm_compute::test::validation::DATA_TEST_CASE(), and CLL2NormalizeLayer::validate().