24.02.1
|
Go to the documentation of this file.
53 Status
validate_arguments(
const ITensorInfo *
input,
const ITensorInfo *output,
const WinogradInfo &winograd_info)
58 const Size2D kernel_size = winograd_info.kernel_size;
59 const Size2D output_tile_size = winograd_info.output_tile_size;
66 "Winograd filter transform not supported");
68 input->dimension(idx_h) != kernel_size.height);
72 if (output->total_size() != 0)
74 const TensorInfo tensor_info_output =
89 const unsigned int num_elems_processed_per_iteration_x =
91 const unsigned int num_elems_processed_per_iteration_y =
input->dimension(1);
92 const unsigned int num_elems_read_per_iteration_z =
97 num_elems_read_per_iteration_z));
99 return std::make_pair(Status{}, win_collapsed);
128 _src_dim_z =
src->dimension(2);
135 build_opts.add_option_if(winograd_info.
kernel_size.
height == 1,
"-DWINOGRAD_FILTER_TRANSFORM_HORIZONTAL");
136 build_opts.add_option_if(winograd_info.
kernel_size.
width == 1,
"-DWINOGRAD_FILTER_TRANSFORM_VERTICAL");
151 IClKernel::configure_internal(win_config.second);
177 unsigned int idx = 0;
178 add_4D_tensor_argument(idx,
src, window);
179 add_3D_tensor_argument(idx,
dst, window_out);
182 _kernel.setArg<cl_uint>(idx++, _src_dim_z);
184 enqueue(queue, *
this, window, lws_hint());
@ NCHW
Num samples, channels, height, width.
std::string to_string(T &&value)
Convert integer and float values to string.
SimpleTensor< float > src
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ NHWC
Num samples, height, width, channels.
std::string lower_string(const std::string &val)
Lower a given string.
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(...)
Size2D output_tile_size
Width and height of the output tile.
Class for specifying the size of an image or rectangle.
void use_tensor_dimensions(const TensorShape &shape, size_t first_dimension=Window::DimX)
Use the tensor's dimensions to fill the window dimensions.
size_t height
Height of the image region or rectangle.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
@ WINOGRAD
Winograd CL kernel type.
std::string upper_string(const std::string &val)
Raise a given string to upper case.
std::string to_string() const
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
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.
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...
#define ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(tensor)
cl::Kernel create_kernel(const CLCompileContext &ctx, const std::string &kernel_name, const std::set< std::string > &build_opts=std::set< std::string >())
Creates an opencl kernel using a compile context.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
TensorShape compute_winograd_filter_transform_shape(const ITensorInfo &input, const WinogradInfo &winograd_info)
Calculate the winograd filter transform shape.
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
const Window & window() const
The maximum window the kernel can be executed on.
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Describe a multidimensional execution window.
#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
bool has_padding_changed(const std::unordered_map< const ITensorInfo *, PaddingSize > &padding_map)
Check if the previously stored padding info has changed after configuring a kernel.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Size2D kernel_size
Width and height of the kernel.
bool cl_winograd_convolution_layer_supported(const Size2D &output_tile, const Size2D &kernel_size, DataLayout data_layout)
This function checks if the Winograd configuration (defined through the output tile,...
Store the tensor's metadata.
@ F32
32-bit floating-point number
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo * > infos)
Stores padding information before configuring a kernel.
void enqueue(cl::CommandQueue &queue, ICLKernel &kernel, const Window &window, const cl::NDRange &lws_hint=CLKernelLibrary::get().default_ndrange(), bool use_dummy_work_items=false)
Add the kernel to the command queue with the given window.