Compute Library
 19.08
CLWinogradInputTransformKernel Class Reference

OpenCL kernel to perform Winograd input transform. More...

#include <CLWinogradInputTransformKernel.h>

Collaboration diagram for CLWinogradInputTransformKernel:
[legend]

Public Member Functions

 CLWinogradInputTransformKernel ()
 Default constructor. More...
 
 CLWinogradInputTransformKernel (const CLWinogradInputTransformKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLWinogradInputTransformKerneloperator= (const CLWinogradInputTransformKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLWinogradInputTransformKernel (CLWinogradInputTransformKernel &&)=default
 Allow instances of this class to be moved. More...
 
CLWinogradInputTransformKerneloperator= (CLWinogradInputTransformKernel &&)=default
 Allow instances of this class to be moved. More...
 
void configure (const ICLTensor *input, ICLTensor *output, const WinogradInfo &winograd_info)
 Set the input and output of the kernel. More...
 
void run (const Window &window, cl::CommandQueue &queue) override
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
BorderSize border_size () const override
 The size of the border for that kernel. More...
 
- Public Member Functions inherited from ICLKernel
 ICLKernel ()
 Constructor. More...
 
cl::Kernel & kernel ()
 Returns a reference to the OpenCL kernel of this object. More...
 
template<typename T >
void add_1D_array_argument (unsigned int &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed 1D array's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_1D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_2D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_2D_tensor_argument_if (bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. More...
 
void add_3D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_4D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 4D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
template<typename T >
void add_argument (unsigned int &idx, T value)
 Add the passed parameters to the object's kernel's arguments starting from the index idx. More...
 
void set_lws_hint (const cl::NDRange &lws_hint)
 Set the Local-Workgroup-Size hint. More...
 
cl::NDRange lws_hint () const
 Return the Local-Workgroup-Size hint. More...
 
const std::string & config_id () const
 Get the configuration ID. More...
 
void set_target (GPUTarget target)
 Set the targeted GPU architecture. More...
 
void set_target (cl::Device &device)
 Set the targeted GPU architecture according to the CL device. More...
 
GPUTarget get_target () const
 Get the targeted GPU architecture. More...
 
size_t get_max_workgroup_size ()
 Get the maximum workgroup size for the device the CLKernelLibrary uses. More...
 
template<typename T , unsigned int dimension_size>
void add_array_argument (unsigned &idx, const ICLArray< T > *array, const Strides &strides, unsigned int num_dimensions, const Window &window)
 Add the passed array's parameters to the object's kernel's arguments starting from the index idx. More...
 
template<unsigned int dimension_size>
void add_tensor_argument (unsigned &idx, const ICLTensor *tensor, const Window &window)
 
- 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...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, const WinogradInfo &winograd_info)
 Static function to check if given info will lead to a valid configuration of CLWinogradInputTransformKernel. More...
 
- Static Public Member Functions inherited from ICLKernel
static constexpr unsigned int num_arguments_per_1D_array ()
 Returns the number of arguments enqueued per 1D array object. More...
 
static constexpr unsigned int num_arguments_per_1D_tensor ()
 Returns the number of arguments enqueued per 1D tensor object. More...
 
static constexpr unsigned int num_arguments_per_2D_tensor ()
 Returns the number of arguments enqueued per 2D tensor object. More...
 
static constexpr unsigned int num_arguments_per_3D_tensor ()
 Returns the number of arguments enqueued per 3D tensor object. More...
 
static constexpr unsigned int num_arguments_per_4D_tensor ()
 Returns the number of arguments enqueued per 4D tensor object. More...
 
static cl::NDRange gws_from_window (const Window &window)
 Get the global work size given an execution window. More...
 

Detailed Description

OpenCL kernel to perform Winograd input transform.

Definition at line 34 of file CLWinogradInputTransformKernel.h.

Constructor & Destructor Documentation

◆ CLWinogradInputTransformKernel() [1/3]

Default constructor.

Definition at line 101 of file CLWinogradInputTransformKernel.cpp.

102  : _border_size(0), _input(nullptr), _output(nullptr), _num_tiles_x(0), _num_tiles_y(0), _step_z(1)
103 {
104 }

◆ CLWinogradInputTransformKernel() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLWinogradInputTransformKernel() [3/3]

Allow instances of this class to be moved.

Member Function Documentation

◆ border_size()

BorderSize border_size ( ) const
overridevirtual

The size of the border for that kernel.

Returns
The width in number of elements of the border.

Reimplemented from IKernel.

Definition at line 106 of file CLWinogradInputTransformKernel.cpp.

107 {
108  return _border_size;
109 }

◆ configure()

void configure ( const ICLTensor input,
ICLTensor output,
const WinogradInfo winograd_info 
)

Set the input and output of the kernel.

Note
Winograd input transform supports the following configurations for NCWH data layout F(output tile, kernel size):F(2x2, 3x3), F(2x1, 3x1), F(1x2, 1x3), F(4x4, 3x3), F(4x1, 3x1), F(1x4, 1x3), F(4x4, 5x5), F(4x1, 5x1), F(1x4, 1x5)
Winograd input transform supports the following configurations for NHWC data layout F(output tile, kernel size):F(4x4, 3x3), F(4x1, 3x1), F(1x4, 1x3), F(4x4, 5x5), F(4x1, 5x1), F(1x4, 1x5)

Strides: only unit strides

Parameters
[in]inputThe input tensor to transform. Data types supported: F16/F32
[in]outputThe output tensor. The shape for this tensor can be calculated using the utility function compute_winograd_input_transform_shape. Data types supported: Same as input
[in]winograd_infoContains Winograd's information described in WinogradInfo.

Definition at line 111 of file CLWinogradInputTransformKernel.cpp.

112 {
113  ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
114  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), winograd_info));
115 
116  const PadStrideInfo conv_info = winograd_info.convolution_info;
117  const Size2D output_tile_size = winograd_info.output_tile_size;
118  const Size2D kernel_size = winograd_info.kernel_size;
119  const DataLayout data_layout = input->info()->data_layout();
120 
123 
124  // Compute number of elements to process in the X and Y direction
125  const int num_elements_x = input->info()->dimension(idx_w) - (kernel_size.width - 1) + conv_info.pad_left() + conv_info.pad_right();
126  const int num_elements_y = input->info()->dimension(idx_h) - (kernel_size.height - 1) + conv_info.pad_top() + conv_info.pad_bottom();
127 
129  {
130  // Check if we need to extend the right or bottom border
131  const unsigned int extra_border_right = ((num_elements_x % output_tile_size.width) == 0) ? 0u : static_cast<unsigned int>(output_tile_size.width - 1);
132  const unsigned int extra_border_bottom = ((num_elements_y % output_tile_size.height) == 0) ? 0u : static_cast<unsigned int>(output_tile_size.height - 1);
133 
134  _border_size = BorderSize(conv_info.pad_top(), conv_info.pad_right() + extra_border_right, conv_info.pad_bottom() + extra_border_bottom, conv_info.pad_left());
135  }
136  else
137  {
138  _border_size = BorderSize(1U, 0U, 1U, 0);
139  }
140 
141  // Compute the number of output tiles along the x and y direction of size "output_tile_size"
142  const Size2D num_tiles = compute_winograd_convolution_tiles(Size2D(input->info()->dimension(idx_w), input->info()->dimension(idx_h)),
143  kernel_size,
144  output_tile_size,
145  conv_info);
146 
147  _input = input;
148  _output = output;
149  _num_tiles_x = num_tiles.width;
150  _num_tiles_y = num_tiles.height;
151 
153 
154  // Output auto initialization if not yet initialized
155  auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape));
156 
157  ARM_COMPUTE_ERROR_ON(_num_tiles_x * _num_tiles_y != static_cast<int>(output->info()->dimension(1)));
158  const size_t total_batches = input->info()->tensor_shape().total_size_upper(3);
159 
160  CLBuildOptions build_opts;
161  build_opts.add_option("-DNUM_TILES_X=" + support::cpp11::to_string(_num_tiles_x));
162  build_opts.add_option("-DPAD_LEFT=" + support::cpp11::to_string(conv_info.pad_left()));
163  build_opts.add_option("-DPAD_TOP=" + support::cpp11::to_string(conv_info.pad_top()));
164  build_opts.add_option("-DOUTPUT_TILE_W=" + support::cpp11::to_string(output_tile_size.width));
165  build_opts.add_option("-DOUTPUT_TILE_H=" + support::cpp11::to_string(output_tile_size.height));
166  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type()));
167  build_opts.add_option_if(winograd_info.kernel_size.height == 1, "-DWINOGRAD_INPUT_TRANSFORM_HORIZONTAL");
168  build_opts.add_option_if(winograd_info.kernel_size.width == 1, "-DWINOGRAD_INPUT_TRANSFORM_VERTICAL");
170  {
171  build_opts.add_option_if(total_batches > 1, "-DNUM_TILES_Y=" + support::cpp11::to_string(_num_tiles_y));
172  build_opts.add_option("-DSRC_DIM_1=" + support::cpp11::to_string(_input->info()->dimension(1)));
173  build_opts.add_option("-DSRC_DIM_2=" + support::cpp11::to_string(_input->info()->dimension(2)));
174  }
175  else
176  {
177  build_opts.add_option_if(total_batches > 1, "-DSRC_DEPTH=" + support::cpp11::to_string(_input->info()->dimension(2)));
178  }
179 
180  // Create kernel
181  std::string kernel_name = "winograd_input_transform_" + output_tile_size.to_string() + "_" + kernel_size.to_string();
182 
183  // Get the maximum dimension from the tile size
184  const unsigned int tile_max_dim = std::max(output_tile_size.width, output_tile_size.height);
185 
186  // Check optimized kernel if output_dims == 2x2
187  if((tile_max_dim == 2) && (data_layout == DataLayout::NCHW))
188  {
189  _step_z = (_input->info()->dimension(2) % 2) != 0 ? 1 : 2;
190  }
191 
192  // Append stepz and data layout
193  kernel_name += "_stepz";
194  kernel_name += support::cpp11::to_string(_step_z);
195  kernel_name += "_" + lower_string(string_from_data_layout(data_layout));
196 
197  _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts.options()));
198 
199  // Create window and update padding
200  auto win_config = validate_and_configure_window(input->info(), output->info(), winograd_info);
201  ARM_COMPUTE_ERROR_THROW_ON(win_config.first);
202  ICLKernel::configure_internal(win_config.second, cl::NDRange(1, 1, 8));
203 
204  _config_id = kernel_name;
205  _config_id += support::cpp11::to_string(input->info()->dimension(0));
206  _config_id += "_";
207  _config_id += support::cpp11::to_string(input->info()->dimension(1));
208  _config_id += "_";
209  _config_id += support::cpp11::to_string(input->info()->dimension(2));
210  _config_id += "_";
211  _config_id += support::cpp11::to_string(conv_info.pad_left());
212  _config_id += "_";
213  _config_id += support::cpp11::to_string(conv_info.pad_top());
214  _config_id += "_";
215  _config_id += lower_string(string_from_data_layout(input->info()->data_layout()));
216 }
Shape of a tensor.
Definition: TensorShape.h:39
const DataLayout data_layout
Definition: Im2Col.cpp:146
TensorShape compute_winograd_input_transform_shape(const ITensorInfo &input, const WinogradInfo &winograd_info)
Calculate the winograd input transform shape.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
Container for 2D border size.
Definition: Types.h:259
const StringSet & options() const
Gets the current options list set.
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *input, ITensorInfo *weights, ITensorInfo *biases, ITensorInfo *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation)
std::string to_string(T &&value)
Convert integer and float values to string.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:337
size_t total_size_upper(size_t dimension) const
Collapses given dimension and above.
Definition: TensorShape.h:181
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:327
Size2D compute_winograd_convolution_tiles(const Size2D &in_dims, const Size2D &kernel_size, const Size2D &output_tile_size, const PadStrideInfo &conv_info)
Calculate the number of output tiles required by Winograd Convolution layer.
Definition: Helpers.h:744
std::string lower_string(const std::string &val)
Lower a given string.
Definition: Utils.cpp:327
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...
Definition: Helpers.inl:201
size_t height
Height of the image region or rectangle.
Definition: Size2D.h:93
void add_option(std::string option)
Adds option to the existing build option list.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:35
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void add_option_if(bool cond, std::string option)
Adds option if a given condition is true;.
Padding and stride information class.
Definition: Types.h:676
std::unique_ptr< Kernel > create_kernel()
Helper function to create and return a unique_ptr pointed to a CL/GLES kernel object.
Definition: Helpers.h:86
Num samples, channels, height, width.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Definition: Utils.cpp:132
size_t width
Width of the image region or rectangle.
Definition: Size2D.h:92
Class for specifying the size of an image or rectangle.
Definition: Size2D.h:34
Num samples, height, width, channels.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
Definition: Helpers.inl:326
DataLayout
[DataLayout enum definition]
Definition: Types.h:114
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
std::string to_string() const
Definition: Size2D.h:68

References CLBuildOptions::add_option(), CLBuildOptions::add_option_if(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), ICloneable< T >::clone(), arm_compute::compute_winograd_convolution_tiles(), arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), arm_compute::test::validation::conv_info, arm_compute::create_kernel(), arm_compute::test::validation::data_layout, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), CLKernelLibrary::get(), arm_compute::get_cl_type_from_data_type(), arm_compute::get_data_layout_dimension_index(), Size2D::height, arm_compute::HEIGHT, ITensor::info(), arm_compute::lower_string(), arm_compute::NCHW, arm_compute::NHWC, CLBuildOptions::options(), arm_compute::test::validation::output_shape, arm_compute::string_from_data_layout(), ITensorInfo::tensor_shape(), Size2D::to_string(), arm_compute::support::cpp11::to_string(), TensorShape::total_size_upper(), arm_compute::U, arm_compute::validate_and_configure_window(), Size2D::width, arm_compute::WIDTH, and arm_compute::test::validation::winograd_info.

◆ operator=() [1/2]

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

Allow instances of this class to be moved.

◆ run()

void run ( const Window window,
cl::CommandQueue &  queue 
)
overridevirtual

Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue.

Note
The queue is not flushed by this method, and therefore the kernel will not have been executed by the time this method returns.
Parameters
[in]windowRegion on which to execute the kernel. (Must be a valid region of the window returned by window()).
[in,out]queueCommand queue on which to enqueue the kernel.

Implements ICLKernel.

Definition at line 227 of file CLWinogradInputTransformKernel.cpp.

228 {
231 
232  const DataLayout data_layout = _input->info()->data_layout();
236  const size_t total_batches = window.shape().total_size_upper(3);
237 
238  // Collapse window
240 
241  Window slice = window_collapsed.first_slice_window_3D();
242  slice.set(idx_w, Window::Dimension(0, _num_tiles_x, 1));
243  slice.set(idx_h, Window::Dimension(0, _num_tiles_y, 1));
245  {
246  slice.set(idx_h, Window::Dimension(0, _num_tiles_y * total_batches, 1));
247  }
248 
249  ARM_COMPUTE_ERROR_ON(((slice[idx_c].end() - slice[idx_c].start()) % _step_z) != 0);
250  slice.set(idx_c, Window::Dimension(slice[idx_c].start(), slice[idx_c].end(), _step_z));
251 
252  unsigned int idx = 2 * num_arguments_per_3D_tensor();
253  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(_input->info()->strides_in_bytes()[3]));
254  _kernel.setArg<cl_uint>(idx++, static_cast<unsigned int>(_output->info()->strides_in_bytes()[3]));
255 
256  do
257  {
258  unsigned int idx = 0;
259  add_3D_tensor_argument(idx, _input, slice);
260  add_3D_tensor_argument(idx, _output, slice);
261 
262  enqueue(queue, *this, slice, lws_hint());
263  }
264  while(window_collapsed.slide_window_slice_3D(slice));
265 }
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
const DataLayout data_layout
Definition: Im2Col.cpp:146
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.
Definition: ICLKernel.cpp:39
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:247
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:337
size_t total_size_upper(size_t dimension) const
Collapses given dimension and above.
Definition: TensorShape.h:181
Describe one of the image's dimensions with a start, end and step.
Definition: Window.h:75
void add_3D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx.
Definition: ICLKernel.h:158
static constexpr unsigned int num_arguments_per_3D_tensor()
Returns the number of arguments enqueued per 3D tensor object.
Definition: ICLKernel.h:200
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Definition: Window.inl:54
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
Definition: Window.h:319
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
Num samples, height, width, channels.
TensorShape shape() const
Return the shape of the window in number of steps.
Definition: Window.inl:258
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
Definition: Helpers.inl:326
Window first_slice_window_3D() const
First 3D slice of the window.
Definition: Window.h:275
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:205
DataLayout
[DataLayout enum definition]
Definition: Types.h:114
Describe a multidimensional execution window.
Definition: Window.h:39
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:940
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.

References ICLKernel::add_3D_tensor_argument(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, arm_compute::CHANNEL, Window::collapse_if_possible(), arm_compute::test::validation::data_layout, ITensorInfo::data_layout(), Window::DimZ, arm_compute::enqueue(), Window::first_slice_window_3D(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, ITensor::info(), ICLKernel::lws_hint(), arm_compute::NHWC, ICLKernel::num_arguments_per_3D_tensor(), Window::shape(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), ITensorInfo::strides_in_bytes(), TensorShape::total_size_upper(), arm_compute::WIDTH, and IKernel::window().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const WinogradInfo winograd_info 
)
static

Static function to check if given info will lead to a valid configuration of CLWinogradInputTransformKernel.

Note
Winograd input transform supports the following configurations for NCWH data layout F(output tile, kernel size):F(2x2, 3x3), F(2x1, 3x1), F(1x2, 1x3), F(4x4, 3x3), F(4x1, 3x1), F(1x4, 1x3), F(4x4, 5x5), F(4x1, 5x1), F(1x4, 1x5)
Winograd input transform supports the following configurations for NHWC data layout F(output tile, kernel size):F(4x4, 3x3), F(4x1, 3x1), F(1x4, 1x3), F(4x4, 5x5), F(4x1, 5x1), F(1x4, 1x5)

Strides: only unit strides

Parameters
[in]inputThe input tensor to transform. Data types supported: F16/F32
[in]outputThe output tensor. The shape for this tensor can be calculated using the utility function compute_winograd_input_transform_shape. Data types supported: Same as input
[in]winograd_infoContains Winograd's information described in WinogradInfo.
Returns
a status

Definition at line 218 of file CLWinogradInputTransformKernel.cpp.

219 {
221  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, winograd_info));
222  ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), output->clone().get(), winograd_info).first);
223 
224  return Status{};
225 }
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *input, ITensorInfo *weights, ITensorInfo *biases, ITensorInfo *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:193
Status class.
Definition: Error.h:52
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:163

References ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), arm_compute::validate_and_configure_window(), and arm_compute::test::validation::winograd_info.

Referenced by CLWinogradInputTransform::validate().


The documentation for this class was generated from the following files: