24.02.1
|
This class is a wrapper for the depthwise convolution assembly kernels. More...
#include <CpuDepthwiseConv2dAssemblyWrapperKernel.h>
Public Member Functions | |
CpuDepthwiseConv2dAssemblyWrapperKernel () | |
Default constructor. More... | |
~CpuDepthwiseConv2dAssemblyWrapperKernel () | |
ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (CpuDepthwiseConv2dAssemblyWrapperKernel) | |
void | configure (const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *dst, const ConvolutionInfo &info, const CPUInfo &cpu_info) |
Initialise the kernel's src and dst. More... | |
void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
const char * | name () const override |
Name of the kernel. More... | |
void | pack_parameters (void *parameters_ptr, void *bias_ptr, void *weights_ptr, size_t ld_weights_col, size_t ld_weights_row) |
Pack bias and weights in a storage space for the assembly kernel. More... | |
size_t | get_storage_size () const |
Get the amount of storage space required for the rearranged weights and bias. More... | |
size_t | get_working_size (unsigned int num_threads) const |
Get size of the workspace needed by the assembly kernel. More... | |
bool | is_configured () const |
Was the asm kernel successfully configured? More... | |
size_t | get_mws (const CPUInfo &platform, size_t thread_count) const override |
Return minimum workload size of the relevant kernel. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run (const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
bool | is_window_configured () const |
Function to check if the embedded window of this kernel has been configured. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *dst, const ConvolutionInfo &info) |
Indicates whether or not this function can be used to process the given parameters. More... | |
Static Public Member Functions inherited from ICpuKernel< CpuDepthwiseConv2dAssemblyWrapperKernel > | |
static const auto * | get_implementation (const SelectorType &selector, KernelSelectionType selection_type=KernelSelectionType::Supported) |
Micro-kernel selector. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ICPPKernel | |
static constexpr size_t | default_mws = 1 |
This class is a wrapper for the depthwise convolution assembly kernels.
Definition at line 51 of file CpuDepthwiseConv2dAssemblyWrapperKernel.h.
Default constructor.
Definition at line 199 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
|
default |
ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE | ( | CpuDepthwiseConv2dAssemblyWrapperKernel | ) |
void configure | ( | const ITensorInfo * | src, |
const ITensorInfo * | weights, | ||
const ITensorInfo * | bias, | ||
ITensorInfo * | dst, | ||
const ConvolutionInfo & | info, | ||
const CPUInfo & | cpu_info | ||
) |
Initialise the kernel's src and dst.
[in] | src | Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32. |
[in] | weights | Weights tensor info. These are 3D tensors with shape [kernel_x, kernel_y, IFM]. Data type supported: same as src or QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL when src is QASYMM8/QASYMM8_SIGNED. |
[in] | bias | Bias tensor. A 1D tensor with shape [IFM]. Must be nullptr if not needed. Data type supported: same as src , S32 when src is QASYMM8/QASYMM8_SIGNED. |
[out] | dst | Destination tensor info. Data type supported: same as input . |
[in] | info | Depthwise convolution layer meta-data. |
[in] | cpu_info | CPU information needed to select the most appropriate kernel. |
Definition at line 206 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_UNUSED, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), ITensorInfo::data_type(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, arm_compute::F16, arm_compute::F32, arm_compute::test::validation::info, arm_compute::is_data_type_quantized_per_channel(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, and arm_compute::test::validation::src.
|
overridevirtual |
Return minimum workload size of the relevant kernel.
[in] | platform | The CPU platform used to create the context. |
[in] | thread_count | Number of threads in the execution. |
Reimplemented from ICPPKernel.
Definition at line 388 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
References ARM_COMPUTE_UNUSED, and ICPPKernel::default_mws.
size_t get_storage_size | ( | ) | const |
Get the amount of storage space required for the rearranged weights and bias.
Definition at line 368 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
size_t get_working_size | ( | unsigned int | num_threads | ) | const |
Get size of the workspace needed by the assembly kernel.
[in] | num_threads | Maximum number of threads that are going to be spawned. |
Definition at line 373 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
bool is_configured | ( | ) | const |
Was the asm kernel successfully configured?
Definition at line 378 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
|
overridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 383 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
void pack_parameters | ( | void * | parameters_ptr, |
void * | bias_ptr, | ||
void * | weights_ptr, | ||
size_t | ld_weights_col, | ||
size_t | ld_weights_row | ||
) |
Pack bias and weights in a storage space for the assembly kernel.
[in] | parameters_ptr | Pointer to storage space. |
[in] | bias_ptr | Pointer to bias buffer. |
[in] | weights_ptr | Pointer to weights buffer. |
[in] | ld_weights_col | Columns displacement for the weights tensor. |
[in] | ld_weights_row | Rows displacement for the weights tensor. |
Definition at line 362 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | tensors | A vector containing the tensors to operate on. |
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 327 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_INT_0, arm_compute::ACL_INT_1, arm_compute::ACL_SRC_0, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, ITensor::buffer(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, ITensorPack::empty(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), ITensor::info(), arm_compute::test::validation::info, ITensorInfo::offset_first_element_in_bytes(), arm_compute::test::validation::src, and IKernel::window().
|
static |
Indicates whether or not this function can be used to process the given parameters.
Similar to CpuDepthwiseConv2dAssemblyWrapperKernel::configure()
Definition at line 264 of file CpuDepthwiseConv2dAssemblyWrapperKernel.cpp.
References ARM_COMPUTE_RETURN_ERROR_MSG, 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_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, bias, arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, arm_compute::F16, arm_compute::F32, arm_compute::test::validation::info, arm_compute::is_data_type_quantized(), arm_compute::is_data_type_quantized_per_channel(), arm_compute::NHWC, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM8_PER_CHANNEL, ITensorInfo::quantization_info(), arm_compute::S32, QuantizationInfo::scale(), arm_compute::test::validation::src, and ITensorInfo::tensor_shape().
Referenced by CpuDepthwiseConv2dAssemblyDispatch::validate().