21.02
|
Depthwise convolution assembly kernel glue. More...
#include <NEDepthwiseConvolutionAssemblyDispatch.h>
Public Member Functions | |
NEDepthwiseConvolutionAssemblyDispatch (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
NEDepthwiseConvolutionAssemblyDispatch (const NEDepthwiseConvolutionAssemblyDispatch &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEDepthwiseConvolutionAssemblyDispatch (NEDepthwiseConvolutionAssemblyDispatch &&)=default | |
Default move constructor. More... | |
NEDepthwiseConvolutionAssemblyDispatch & | operator= (const NEDepthwiseConvolutionAssemblyDispatch &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEDepthwiseConvolutionAssemblyDispatch & | operator= (NEDepthwiseConvolutionAssemblyDispatch &&)=default |
Default move assignment operator. More... | |
~NEDepthwiseConvolutionAssemblyDispatch () | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *weights, const ITensor *bias, ITensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, const ActivationLayerInfo &act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1, 1)) |
Initialize the function's source, destination, kernels and border_size. 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 *input, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, const ActivationLayerInfo &act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1, 1)) |
Static function to check if given info will lead to a valid configuration of NEDepthwiseConvolutionAssemblyDispatch. More... | |
static bool | is_optimized_supported (const ITensorInfo *input, const ITensorInfo *weights, PadStrideInfo conv_info, unsigned int depth_multiplier=1, const Size2D &dilation=Size2D(1, 1)) |
Check if the optimized kernel can be used for the given kernel sizes and strides. More... | |
Depthwise convolution assembly kernel glue.
Definition at line 36 of file NEDepthwiseConvolutionAssemblyDispatch.h.
NEDepthwiseConvolutionAssemblyDispatch | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
[in,out] | memory_manager | Memory manager to use |
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Default move constructor.
|
default |
Default destructor.
void configure | ( | const ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | bias, | ||
ITensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
unsigned int | depth_multiplier = 1 , |
||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() , |
||
const Size2D & | dilation = Size2D(1, 1) |
||
) |
Initialize the function's source, destination, kernels and border_size.
[in] | input | Source tensor. Data type supported: QASYMM8/F16/F32. (Written to only for border filling). |
[in] | weights | Weights tensor. These are 3D tensors with shape [W, H, IFM]. Data type supported: Same as input . |
[in] | bias | (Optional) Biases tensor. A 1D tensor with shape [IFM]. Must be nullptr if not needed. Data type supported: Same as input . |
[out] | output | Destination tensor. Data type supported: same as input . |
[in] | conv_info | Padding and stride information to use for the convolution. |
[in] | depth_multiplier | (Optional) Multiplier to apply to the input's depth in order to retrieve the output's depth. Defaults to 1. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Definition at line 347 of file NEDepthwiseConvolutionAssemblyDispatch.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_UNUSED, arm_compute::auto_init_if_empty(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), arm_compute::test::validation::conv_info, ITensor::info(), arm_compute::test::validation::input, arm_compute::test::validation::output_shape, ITensorInfo::quantization_info(), and NEDepthwiseConvolutionAssemblyDispatch::validate().
|
static |
Check if the optimized kernel can be used for the given kernel sizes and strides.
[in] | input | Input tensor info. |
[in] | weights | Weights tensor info. |
[in] | conv_info | Convolution layer metadata. |
[in] | depth_multiplier | (Optional) Depth multiplier to be used. |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Definition at line 454 of file NEDepthwiseConvolutionAssemblyDispatch.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, arm_compute::calculate_same_pad(), arm_compute::test::validation::data_layout, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), Window::DimX, Window::DimY, Window::DimZ, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::is_data_type_float(), arm_compute::NCHW, arm_compute::NHWC, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM8_PER_CHANNEL, TensorShape::set(), PadStrideInfo::stride(), ITensorInfo::tensor_shape(), arm_compute::U, arm_compute::WIDTH, Size2D::x(), Dimensions< T >::x(), Size2D::y(), Dimensions< T >::y(), and Dimensions< T >::z().
|
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 543 of file NEDepthwiseConvolutionAssemblyDispatch.cpp.
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 512 of file NEDepthwiseConvolutionAssemblyDispatch.cpp.
References ARM_COMPUTE_ERROR_ON.
|
static |
Static function to check if given info will lead to a valid configuration of NEDepthwiseConvolutionAssemblyDispatch.
[in] | input | Source tensor. Data type supported: QASYMM8/F16/F32. (Written to only for border filling). |
[in] | weights | Weights tensor. These are 3D tensors with shape [W, H, IFM]. Data type supported: Same as input . |
[in] | bias | (Optional) Biases tensor. A 1D tensor with shape [IFM]. Must be nullptr if not needed. Data type supported: Same as input . |
[out] | output | Destination tensor. Data type supported: same as input . |
[in] | conv_info | Padding and stride information to use for the convolution. |
[in] | depth_multiplier | (Optional) Multiplier to apply to the input's depth in order to retrieve the output's depth. Defaults to 1. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Definition at line 400 of file NEDepthwiseConvolutionAssemblyDispatch.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS, arm_compute::CHANNEL, arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), ActivationLayerInfo::enabled(), arm_compute::F16, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::utils::info_helpers::is_relu(), arm_compute::utils::info_helpers::is_relu6(), ITensorInfo::num_dimensions(), arm_compute::test::validation::output_shape, arm_compute::QASYMM8, arm_compute::QSYMM8_PER_CHANNEL, ITensorInfo::quantization_info(), UniformQuantizationInfo::scale, QuantizationInfo::scale(), ITensorInfo::tensor_shape(), ITensorInfo::total_size(), and QuantizationInfo::uniform().
Referenced by NEDepthwiseConvolutionAssemblyDispatch::configure().