24.02.1
|
Go to the documentation of this file.
49 using namespace misc::shape_calculator;
59 std::pair<unsigned int, unsigned int> convolved_dims,
62 uint32_t input_pad_right,
66 kernel_dims, dilation, input_pad_right,
has_bias);
74 std::pair<unsigned int, unsigned int> convolved_dims,
77 uint32_t input_pad_right,
81 kernel_dims, dilation, input_pad_right,
has_bias);
84 #if defined(ARM_COMPUTE_ENABLE_BF16)
90 std::pair<unsigned int, unsigned int> convolved_dims,
93 uint32_t input_pad_right,
96 arm_compute::cpu::kernels::run_im2col<bfloat16, true, false>(
105 std::pair<unsigned int, unsigned int> convolved_dims,
106 const Size2D &kernel_dims,
108 uint32_t input_pad_right,
111 arm_compute::cpu::kernels::run_im2col<bfloat16, false, false>(
121 std::pair<unsigned int, unsigned int> convolved_dims,
122 const Size2D &kernel_dims,
124 uint32_t input_pad_right,
127 arm_compute::cpu::kernels::run_im2col<int8_t, false, false>(
136 std::pair<unsigned int, unsigned int> convolved_dims,
137 const Size2D &kernel_dims,
139 uint32_t input_pad_right,
142 arm_compute::cpu::kernels::run_im2col<uint8_t, false, false>(
151 std::pair<unsigned int, unsigned int> convolved_dims,
152 const Size2D &kernel_dims,
154 uint32_t input_pad_right,
157 arm_compute::cpu::kernels::run_im2col<qasymm8_t, true, false>(
166 std::pair<unsigned int, unsigned int> convolved_dims,
167 const Size2D &kernel_dims,
169 uint32_t input_pad_right,
177 #if defined(ENABLE_FP16_KERNELS)
179 kernel_dims, dilation, input_pad_right,
has_bias);
180 #else // defined(ENABLE_FP16_KERNELS)
183 #endif // defined(ENABLE_FP16_KERNELS)
191 std::pair<unsigned int, unsigned int> convolved_dims,
192 const Size2D &kernel_dims,
194 uint32_t input_pad_right,
197 #if defined(ENABLE_FP16_KERNELS)
199 kernel_dims, dilation, input_pad_right,
has_bias);
200 #else // defined(ENABLE_FP16_KERNELS)
203 #endif // defined(ENABLE_FP16_KERNELS)
211 std::pair<unsigned int, unsigned int> convolved_dims,
212 const Size2D &kernel_dims,
214 uint32_t input_pad_right,
217 #if defined(ENABLE_FP16_KERNELS)
219 kernel_dims, dilation, input_pad_right,
has_bias);
220 #else // defined(ENABLE_FP16_KERNELS)
223 #endif // defined(ENABLE_FP16_KERNELS)
231 std::pair<unsigned int, unsigned int> convolved_dims,
232 const Size2D &kernel_dims,
234 uint32_t input_pad_right,
237 #if defined(ENABLE_FP16_KERNELS)
239 kernel_dims, dilation, input_pad_right,
has_bias);
240 #else // defined(ENABLE_FP16_KERNELS)
243 #endif // defined(ENABLE_FP16_KERNELS)
250 const Size2D &kernel_dims,
255 unsigned int input_pad_right)
287 const Size2D &kernel_dims,
292 unsigned int input_pad_right)
299 _data_layout =
src->data_layout();
305 _kernel_width = kernel_dims.
width;
306 _kernel_height = kernel_dims.
height;
307 _input_pad_right = input_pad_right;
308 _dilation = dilation;
310 _kernel_height, _conv_info, _dilation);
315 switch (
src->data_type())
324 #if defined(ARM_COMPUTE_ENABLE_BF16)
340 switch (
src->data_type())
348 #if defined(ARM_COMPUTE_ENABLE_BF16)
370 std::pair<unsigned int, unsigned int> convolved_dims =
384 const Size2D &kernel_dims,
389 unsigned int input_pad_right)
405 _func(
src,
dst, window, _data_layout, _conv_info, _convolved_dims,
Size2D(_kernel_width, _kernel_height), _dilation,
406 _input_pad_right, _has_bias);
411 return "CpuIm2ColKernel";
414 size_t CpuIm2ColKernel::get_mws(
const CPUInfo &platform,
size_t thread_count)
const
Class to describe a number of elements in each dimension.
@ NCHW
Num samples, channels, height, width.
im2col_func configure(src_target.info(), dst_target.info(), spatial_kernel, conv_info, has_bias)
size_t y() const
Semantic accessor for height as y.
SimpleTensor< float > src
@ BFLOAT16
16-bit brain floating-point number
DataLayout
[DataLayout enum definition]
SimpleTensor< uint8_t > expected_output(output_shape, DataType::QASYMM8, 1, qasymm)
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
void run_im2col_fp32_nchw_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void run_im2col_int8_nopad_nhwc(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
void run_im2col_uint8_nopad_nhwc(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
void run_im2col_bf16_nchw_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
std::pair< unsigned int, unsigned int > scaled_dimensions(int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation=Size2D(1U, 1U))
Returns expected width and height of output scaled tensor depending on dimensions rounding mode.
Class for specifying the size of an image or rectangle.
size_t height
Height of the image region or rectangle.
void internal_run_im2col_fp16_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
Interface for CPU tensor.
void run_im2col_fp32_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void run_im2col_fp16_nchw_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
void run_im2col_qasymm8_nchw_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void internal_run_im2col_fp16_nchw_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void run_im2col_fp16_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
constexpr auto data_layout
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
TensorShape compute_im2col_conv_shape(const ITensorInfo *input, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, const Size2D &dilation, bool batch_size_on_z, unsigned int num_groups=1, unsigned int input_pad_right=0)
Calculate the im2col output shape of a tensor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
size_t width
Width of the image region or rectangle.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
void run_im2col_fp16_nchw_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
void run_im2col_bf16_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
void run_im2col_fp32_nchw_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
size_t x() const
Semantic accessor for width as x.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Describe one of the image's dimensions with a start, end and step.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
Information about executing thread and CPU.
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Store the tensor's metadata.
const unsigned int num_groups
Describe a multidimensional execution window.
void run_im2col_fp32_pad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void internal_run_im2col_fp16_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void run_im2col_qasymm8_nchw_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
Status validate(const ITensorInfo *scores_in, const ITensorInfo *boxes_in, const ITensorInfo *batch_splits_in, const ITensorInfo *scores_out, const ITensorInfo *boxes_out, const ITensorInfo *classes, const ITensorInfo *batch_splits_out, const ITensorInfo *keeps, const ITensorInfo *keeps_size, const BoxNMSLimitInfo info)
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Store the tensor's metadata.
@ F32
32-bit floating-point number
void run_im2col_qasymm8_pad_nhwc(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
void run_im2col_bf16_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void run_im2col_fp16_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
void internal_run_im2col_fp16_nchw_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
static constexpr size_t default_mws
void run_im2col_bf16_nchw_nopad(const ITensor *src, ITensor *dst, const Window &window, DataLayout data_layout, const PadStrideInfo &conv_info, std::pair< unsigned int, unsigned int > convolved_dims, const Size2D &kernel_dims, const Size2D &dilation, uint32_t input_pad_right, bool has_bias)