23.08
|
Basic function to execute Winograd-based convolution on OpenCL. More...
#include <ClWinogradConv2d.h>
Public Member Functions | |
ClWinogradConv2d () | |
Default constructor. More... | |
~ClWinogradConv2d () | |
Default destructor. More... | |
ClWinogradConv2d (const ClWinogradConv2d &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ClWinogradConv2d (ClWinogradConv2d &&)=default | |
Default move constructor. More... | |
ClWinogradConv2d & | operator= (const ClWinogradConv2d &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
ClWinogradConv2d & | operator= (ClWinogradConv2d &&)=default |
Default move assignment operator. More... | |
void | configure (const ClCompileContext &compile_context, ITensorInfo *src, ITensorInfo *weights, ITensorInfo *biases, ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false) |
Set the input and output tensors. More... | |
void | run (ITensorPack &tensors) override |
Run the kernels contained in the function. More... | |
void | prepare (ITensorPack &tensors) override |
Prepare the function for executing. More... | |
experimental::MemoryRequirements | workspace () const override |
Return the memory requirements required by the workspace. More... | |
![]() | |
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... | |
![]() | |
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(), bool enable_fast_math=false) |
Static function to check if given info will lead to a valid configuration. More... | |
Basic function to execute Winograd-based convolution on OpenCL.
This function calls the following OpenCL functions/kernels:
Definition at line 53 of file ClWinogradConv2d.h.
ClWinogradConv2d | ( | ) |
|
default |
Default destructor.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
void configure | ( | const ClCompileContext & | compile_context, |
ITensorInfo * | src, | ||
ITensorInfo * | weights, | ||
ITensorInfo * | biases, | ||
ITensorInfo * | dst, | ||
const PadStrideInfo & | conv_info, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() , |
||
bool | enable_fast_math = false |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 |
[in] | compile_context | The compile context to be used. |
[in] | src | Source tensor info. 3 lower dimensions represent a single input [width, height, IFM], while every optional dimension from 4 and above represent a batch of inputs. Data types supported: F16/F32. |
[in] | weights | Weights tensor info. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as src . |
[in] | biases | Biases tensor info. Shared biases supported. Biases are 1D tensor with dimensions [OFM].Data type supported: Same as src |
[out] | dst | Destination tensor info. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. 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. |
[in] | enable_fast_math | (Optional) Enable fast math computation. In case this flag were set, the function could dispatch the fastest implementation available which may introduce a drop of accuracy as well. Default is false |
Definition at line 174 of file ClWinogradConv2d.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, CLFillBorderKernel::configure(), ClGemm::configure(), arm_compute::CONSTANT, arm_compute::test::validation::conv_info, arm_compute::test::validation::dst, arm_compute::mlgo::parser::end(), arm_compute::F16, arm_compute::F32, CLScheduler::get(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, arm_compute::offset_int_vec(), arm_compute::experimental::Prepare, arm_compute::test::validation::src, ITensorInfo::tensor_shape(), TensorInfo::total_size(), arm_compute::cpu::kernels::validate_arguments(), arm_compute::WIDTH, and ClGemm::workspace().
|
default |
Default move assignment operator.
|
delete |
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
[in] | constants | Vector that contains the constants tensors. |
Reimplemented from ICLOperator.
Definition at line 279 of file ClWinogradConv2d.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC, arm_compute::ACL_SRC_1, ITensorPack::add_tensor(), CLScheduler::enqueue_op(), CLScheduler::get(), CLAuxTensorHandler::get(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), arm_compute::offset_int_vec(), ClGemm::prepare(), and CLScheduler::queue().
Referenced by ClWinogradConv2d::run().
|
overridevirtual |
Run the kernels contained in the function.
[in] | tensors | Vector that contains the tensors to operate on. |
Reimplemented from ICLOperator.
Definition at line 239 of file ClWinogradConv2d.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, ITensorPack::add_const_tensor(), ITensorPack::add_tensor(), arm_compute::test::validation::dst, CLScheduler::enqueue_op(), CLScheduler::get(), CLAuxTensorHandler::get(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), arm_compute::offset_int_vec(), arm_compute::experimental::Prepare, ClWinogradConv2d::prepare(), ITensorPack::remove_tensor(), ClGemm::run(), and arm_compute::test::validation::src.
|
static |
Static function to check if given info will lead to a valid configuration.
Similar to ClWinogradConv2d::configure()
Definition at line 232 of file ClWinogradConv2d.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::test::validation::conv_info, arm_compute::test::validation::dst, arm_compute::test::validation::src, and arm_compute::cpu::kernels::validate_arguments().
Referenced by ClConv2d::get_convolution_method(), ClConv2d::validate(), and CLWinogradConvolutionLayer::validate().
|
overridevirtual |
Return the memory requirements required by the workspace.
Reimplemented from ICLOperator.
Definition at line 306 of file ClWinogradConv2d.cpp.