24.02.1
|
Basic function to execute indirect convolution on OpenCL. More...
#include <ClIndirectConv2d.h>
Public Member Functions | |
ClIndirectConv2d ()=default | |
void | configure (const CLCompileContext &compile_context, ITensorInfo *src, ITensorInfo *weights, ITensorInfo *biases, ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Initialise the kernel's inputs and output. More... | |
void | run (ITensorPack &tensors) override |
Run the kernels contained in the function. More... | |
void | prepare (ITensorPack &constants) override |
Prepare the function for executing. More... | |
experimental::MemoryRequirements | workspace () const override |
Return the memory requirements required by the workspace. More... | |
Public Member Functions inherited from ICLOperator | |
ICLOperator (IRuntimeContext *ctx=nullptr) | |
Constructor. More... | |
ICLOperator (const ICLOperator &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ICLOperator (ICLOperator &&)=default | |
Default move constructor. More... | |
ICLOperator & | operator= (const ICLOperator &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ICLOperator & | operator= (ICLOperator &&)=default |
Default move assignment operator. More... | |
Public Member Functions inherited from IOperator | |
virtual | ~IOperator ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration. More... | |
Basic function to execute indirect convolution on OpenCL.
This function calls the following OpenCL kernels:
Definition at line 50 of file ClIndirectConv2d.h.
|
default |
void configure | ( | const CLCompileContext & | compile_context, |
ITensorInfo * | src, | ||
ITensorInfo * | weights, | ||
ITensorInfo * | biases, | ||
ITensorInfo * | dst, | ||
const PadStrideInfo & | conv_info, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() |
||
) |
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] | src | Source tensor. 3 lower dimensions represent a single src, while every optional dimension from 4 and above represent a batch of sources. Data types supported: F16/F32. |
[in] | weights | Weights tensor. Weights are 4D tensor with dimensions. Data type supported:Same as src . |
[in] | biases | Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Should match src data type. |
[out] | dst | Destination tensor. 3 lower dimensions represent a single dst, while the rest represent batch of destinations. Data types supported: Same as src . |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
Definition at line 62 of file ClIndirectConv2d.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, arm_compute::test::validation::conv_info, arm_compute::test::validation::dst, CLScheduler::get(), and arm_compute::test::validation::src.
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
[in] | constants | Vector that contains the constants tensors. |
Reimplemented from ICLOperator.
Definition at line 134 of file ClIndirectConv2d.cpp.
|
overridevirtual |
Run the kernels contained in the function.
[in] | tensors | Vector that contains the tensors to operate on. |
Reimplemented from ICLOperator.
Definition at line 121 of file ClIndirectConv2d.cpp.
References arm_compute::ACL_SRC_3, ITensorPack::add_const_tensor(), CLScheduler::enqueue_op(), CLScheduler::get(), CLAuxTensorHandler::get(), and arm_compute::offset_int_vec().
|
static |
Static function to check if given info will lead to a valid configuration.
Similar to ClIndirectConv2d::configure()
Definition at line 98 of file ClIndirectConv2d.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::misc::shape_calculator::compute_indirect_buffer_shape(), arm_compute::test::validation::conv_info, arm_compute::test::validation::dst, arm_compute::S32, arm_compute::test::validation::src, ITensorInfo::tensor_shape(), and arm_compute::validate().
Referenced by ClConv2d::get_convolution_method(), CLIndirectConvolutionLayer::validate(), and ClConv2d::validate().
|
overridevirtual |
Return the memory requirements required by the workspace.
Reimplemented from ICLOperator.
Definition at line 154 of file ClIndirectConv2d.cpp.