Compute Library
 22.11
ClScaleKernel Class Reference

Interface for the scale kernel. More...

#include <ClScaleKernel.h>

Collaboration diagram for ClScaleKernel:
[legend]

Public Member Functions

 ClScaleKernel ()
 
 ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE (ClScaleKernel)
 
void configure (const CLCompileContext &compile_context, ITensorInfo *src, ITensorInfo *dst, const ScaleKernelInfo &info)
 Initialise the kernel's inputs, output and interpolation policy. More...
 
void run_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
- Public Member Functions inherited from ICLKernel
 ICLKernel ()
 Constructor. More...
 
cl::Kernel & kernel ()
 Returns a reference to the OpenCL kernel of this object. More...
 
CLKernelType type () const
 Returns the CL kernel type. 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...
 
void add_5D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, const Window &window)
 Add the passed 5D tensor's parameters to the object's kernel's arguments starting from the index idx. More...
 
void add_3d_tensor_nhw_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHW 3D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
void add_4d_tensor_nhwc_argument (unsigned int &idx, const ICLTensor *tensor)
 Add the passed NHWC 4D tensor's parameters to the object's kernel's arguments by passing strides, dimensions and the offset to the first valid element in bytes. More...
 
virtual void run (const Window &window, cl::CommandQueue &queue)
 Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More...
 
virtual void run_composite_op (ITensorPack &tensors, const Window &window, cl::CommandQueue &queue, const experimental::dynamic_fusion::ClExecutionDescriptor &exec_desc)
 The execution is carried out through run_op method. But the run_op method needs to be extended to include ClExecutionDescriptor as now LWS GWS tuning will be separated from the IKernel. 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...
 
void set_wbsm_hint (const cl_int &wbsm_hint)
 Set the workgroup batch size modifier hint. More...
 
cl_int wbsm_hint () const
 Return the workgroup batch size modifier 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<unsigned int dimension_size>
void add_tensor_argument (unsigned &idx, const ICLTensor *tensor, const Window &window)
 
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...
 
- 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 Windowwindow () 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 *dst, const ScaleKernelInfo &info)
 Static function to check if given info will lead to a valid configuration. More...
 
- Static Public Member Functions inherited from ICLKernel
static constexpr unsigned int num_arguments_per_3d_tensor_nhw ()
 Returns the number of arguments enqueued per NHW 3D Tensor object. More...
 
static constexpr unsigned int num_arguments_per_4d_tensor_nhwc ()
 Returns the number of arguments enqueued per NHWC 4D Tensor object. More...
 
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

Interface for the scale kernel.

Definition at line 39 of file ClScaleKernel.h.

Constructor & Destructor Documentation

◆ ClScaleKernel()

Definition at line 87 of file ClScaleKernel.cpp.

References arm_compute::ELEMENTWISE.

88 {
90 }
Elementwise CL kernel type.
Definition: CLTypes.h:85

Member Function Documentation

◆ ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE()

ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE ( ClScaleKernel  )

◆ configure()

void configure ( const CLCompileContext compile_context,
ITensorInfo src,
ITensorInfo dst,
const ScaleKernelInfo info 
)

Initialise the kernel's inputs, output and interpolation policy.

Parameters
[in]compile_contextThe compile context to be used.
[in]srcSource tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/F16/F32
[out]dstDestination tensor info. Data types supported: Same as src All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
[in]infoScaleKernelInfo Kernel descriptor to be used to configure.

Definition at line 92 of file ClScaleKernel.cpp.

References CLBuildOptions::add_option(), CLBuildOptions::add_option_if(), CLBuildOptions::add_option_if_else(), arm_compute::adjust_vec_size(), ScaleKernelInfo::align_corners, arm_compute::AREA, ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::BILINEAR, ScaleKernelInfo::border_mode, arm_compute::calculate_max_window(), arm_compute::CENTER, arm_compute::CHANNEL, arm_compute::CONSTANT, ScaleKernelInfo::constant_border_value, arm_compute::create_kernel(), ScaleKernelInfo::data_layout, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F32, arm_compute::float_to_string_with_full_precision(), arm_compute::get_cl_type_from_data_type(), arm_compute::get_data_layout_dimension_index(), arm_compute::get_padding_info(), arm_compute::has_padding_changed(), arm_compute::HEIGHT, ScaleKernelInfo::interpolation_policy, arm_compute::is_data_type_float(), arm_compute::is_data_type_quantized_asymmetric(), kernel_name, arm_compute::lower_string(), arm_compute::NCHW, arm_compute::NEAREST_NEIGHBOR, arm_compute::NHWC, ICLKernel::num_arguments_per_4d_tensor_nhwc(), ITensorInfo::num_dimensions(), UniformQuantizationInfo::offset, CLBuildOptions::options(), arm_compute::test::validation::qinfo, ITensorInfo::quantization_info(), arm_compute::REPLICATE, ScaleKernelInfo::sampling_policy, UniformQuantizationInfo::scale, arm_compute::test::validation::scale_x, arm_compute::test::validation::scale_y, arm_compute::test::validation::src, arm_compute::string_from_data_layout(), arm_compute::string_from_interpolation_policy(), arm_compute::string_from_pixel_value(), arm_compute::support::cpp11::to_string(), arm_compute::utility::tolower(), QuantizationInfo::uniform(), arm_compute::UNKNOWN, arm_compute::cpu::kernels::validate_arguments(), and arm_compute::WIDTH.

93 {
95  auto padding_info = get_padding_info({ src, dst });
96 
97  // Info required for the static tuning
98  _data_layout = info.data_layout == DataLayout::UNKNOWN ? src->data_layout() : info.data_layout;
99 
100  const bool is_nhwc = _data_layout == DataLayout::NHWC;
101 
102  float scale_x = 0.f;
103  float scale_y = 0.f;
104  std::tie(scale_x, scale_y) = calculate_scale_factors(src, dst, _data_layout, info.align_corners);
105  const bool is_qasymm_bilinear = is_data_type_quantized_asymmetric(src->data_type()) && info.interpolation_policy == InterpolationPolicy::BILINEAR;
106 
107  // Area interpolation behaves as Nearest Neighbour in case of up-sampling
108  auto interpolation_policy_to_use = info.interpolation_policy;
109  if(info.interpolation_policy == InterpolationPolicy::AREA && scale_x <= 1.f && scale_y <= 1.f)
110  {
111  interpolation_policy_to_use = InterpolationPolicy::NEAREST_NEIGHBOR;
112  }
113 
114  // Create kernel
117  const int idx_channel = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::CHANNEL);
118  const unsigned int src_width = src->dimension(idx_width);
119  const unsigned int src_height = src->dimension(idx_height);
120  const unsigned int dst_width = dst->dimension(idx_width);
121  const unsigned int dst_channels = dst->dimension(idx_channel);
122  unsigned int vec_size = 0;
123  unsigned int vec_size_leftover = 0;
124 
125  CLBuildOptions build_opts;
126  if(_data_layout == DataLayout::NHWC)
127  {
128  vec_size = adjust_vec_size(src->data_type() == DataType::F32 ? 4 : 8, dst_channels);
129  vec_size_leftover = dst_channels % vec_size;
130  build_opts.add_option("-DSRC_TENSOR_TYPE=BUFFER");
131  build_opts.add_option("-DSRC_DATA_TYPE=" + get_cl_type_from_data_type(src->data_type()));
132  build_opts.add_option("-DDST_TENSOR_TYPE=BUFFER");
133  build_opts.add_option("-DDST_DATA_TYPE=" + get_cl_type_from_data_type(dst->data_type()));
134  build_opts.add_option("-DCONSTANT_VALUE=" + string_from_pixel_value(info.constant_border_value, src->data_type()));
135  build_opts.add_option("-DN0=" + support::cpp11::to_string(vec_size));
136  build_opts.add_option("-DPARTIAL_N0=" + support::cpp11::to_string(vec_size_leftover));
137  build_opts.add_option("-DSCALE_" + string_from_interpolation_policy(interpolation_policy_to_use));
138  build_opts.add_option_if(src->num_dimensions() > 3, "-DBATCHED_EXECUTION");
139  build_opts.add_option_if(info.border_mode == BorderMode::REPLICATE, "-DBORDER_MODE_REPLICATE");
140  build_opts.add_option_if(info.border_mode == BorderMode::CONSTANT, "-DBORDER_MODE_CONSTANT");
141  build_opts.add_option_if(info.align_corners, "-DALIGN_CORNERS");
142  build_opts.add_option_if(is_data_type_float(src->data_type()), "-DIS_FLOATING_POINT");
143  build_opts.add_option_if_else(info.sampling_policy == SamplingPolicy::CENTER, "-DSAMPLING_POLICY_CENTER", "-DSAMPLING_POLICY_TOP_LEFT");
144  if(is_qasymm_bilinear)
145  {
146  const UniformQuantizationInfo qinfo = src->quantization_info().uniform();
147  build_opts.add_option("-DSCALE=" + support::cpp11::to_string(qinfo.scale));
148  build_opts.add_option("-DOFFSET=" + support::cpp11::to_string(qinfo.offset));
149  }
150  else
151  {
152  build_opts.add_option("-DSCALE=" + support::cpp11::to_string(1));
153  build_opts.add_option("-DOFFSET=" + support::cpp11::to_string(0));
154  }
155  }
156  else if(_data_layout == DataLayout::NCHW)
157  {
158  vec_size = adjust_vec_size(4, dst_width);
159  vec_size_leftover = dst_width % vec_size;
160  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(src->data_type()));
161  build_opts.add_option("-DCONSTANT_VALUE=" + string_from_pixel_value(info.constant_border_value, src->data_type()));
162  build_opts.add_option("-DSRC_WIDTH=" + support::cpp11::to_string(src_width));
163  build_opts.add_option("-DSRC_HEIGHT=" + support::cpp11::to_string(src_height));
164  build_opts.add_option("-DSCALE_X=" + float_to_string_with_full_precision(scale_x));
165  build_opts.add_option("-DSCALE_Y=" + float_to_string_with_full_precision(scale_y));
166  build_opts.add_option("-DVEC_SIZE=" + support::cpp11::to_string(vec_size));
167  build_opts.add_option("-DVEC_SIZE_LEFTOVER=" + ((vec_size_leftover == 0) ? support::cpp11::to_string(vec_size) : support::cpp11::to_string(vec_size_leftover)));
168  build_opts.add_option_if(info.border_mode == BorderMode::REPLICATE, "-DBORDER_MODE_REPLICATE");
169  build_opts.add_option_if(info.border_mode == BorderMode::CONSTANT, "-DBORDER_MODE_CONSTANT");
170  build_opts.add_option_if(info.align_corners, "-DALIGN_CORNERS");
171  build_opts.add_option_if_else(info.sampling_policy == SamplingPolicy::CENTER, "-DSAMPLING_POLICY_CENTER", "-DSAMPLING_POLICY_TOP_LEFT");
172  if(is_qasymm_bilinear)
173  {
174  const UniformQuantizationInfo qinfo = src->quantization_info().uniform();
175  build_opts.add_option("-DSCALE=" + support::cpp11::to_string(qinfo.scale));
176  build_opts.add_option("-DOFFSET=" + support::cpp11::to_string(qinfo.offset));
177  }
178  }
179  else
180  {
181  ARM_COMPUTE_ERROR_ON("Unsupported data layout");
182  }
183 
184  std::string interpolation_name = string_from_interpolation_policy(interpolation_policy_to_use);
185  std::transform(interpolation_name.begin(), interpolation_name.end(), interpolation_name.begin(), ::tolower);
186  std::string kernel_name = "scale_" + interpolation_name + "_";
187  kernel_name += lower_string(string_from_data_layout(_data_layout));
188 
189  _kernel = create_kernel(compile_context, kernel_name, build_opts.options());
190 
191  // Configure kernel window
192  Window win = calculate_max_window(*dst, Steps(vec_size));
193  ICLKernel::configure_internal(win);
194 
196 
197  // Pass scale kernel arguments
198  if(is_nhwc)
199  {
200  unsigned int idx = 2 * num_arguments_per_4d_tensor_nhwc();
201  _kernel.setArg<cl_float>(idx++, scale_x);
202  _kernel.setArg<cl_float>(idx++, scale_y);
203  }
204  // Set config_id for enabling LWS tuning
205  _config_id = "scale_";
206  _config_id += (info.border_mode == BorderMode::REPLICATE ? "Bord_rep" : "");
207  _config_id += (info.sampling_policy == SamplingPolicy::CENTER ? "center" : "topleft");
208  _config_id += (is_nhwc ? "nhwc" : "nchw");
209  _config_id += "_";
210  _config_id += support::cpp11::to_string(dst->dimension(0));
211  _config_id += "_";
212  _config_id += support::cpp11::to_string(dst->dimension(1));
213  _config_id += "_";
214  _config_id += support::cpp11::to_string(dst->dimension(2));
215  _config_id += "_";
216  _config_id += support::cpp11::to_string(dst->dimension(3));
217 }
BorderMode border_mode
Border mode policy.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
InterpolationPolicy interpolation_policy
Interpolation type to use.
std::string to_string(T &&value)
Convert integer and float values to string.
1 channel, 1 F32 per channel
Output values are defined by bilinear interpolation between the pixels.
std::string string_from_pixel_value(const PixelValue &value, const DataType data_type)
Convert a PixelValue to a string, represented through the specific data type.
Definition: Utils.cpp:275
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
bool align_corners
Align corners of input and output.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
Output values are defined to match the source pixel whose center is nearest to the sample position...
std::string lower_string(const std::string &val)
Lower a given string.
Definition: Utils.cpp:353
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
SimpleTensor< float > src
Definition: DFT.cpp:155
Samples are taken at pixel center.
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:205
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.
Definition: CLHelpers.cpp:404
SamplingPolicy sampling_policy
Sampling policy used by the interpolation.
std::string float_to_string_with_full_precision(float val)
Create a string with the float in full precision.
Definition: Utils.h:1124
const std::string & string_from_interpolation_policy(InterpolationPolicy policy)
Translates a given interpolation policy to a string.
Definition: Utils.cpp:189
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:39
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
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.
Definition: Utils.cpp:603
Num samples, channels, height, width.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Definition: Utils.h:1052
static constexpr unsigned int num_arguments_per_4d_tensor_nhwc()
Returns the number of arguments enqueued per NHWC 4D Tensor object.
Definition: ICLKernel.h:279
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Definition: Utils.cpp:123
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:193
Pixels outside the image are assumed to have the same value as the closest image pixel.
const QuantizationInfo qinfo
Definition: Im2Col.cpp:155
Num samples, height, width, channels.
std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info(std::initializer_list< const ITensorInfo *> infos)
Stores padding information before configuring a kernel.
Definition: Utils.cpp:588
PixelValue constant_border_value
Constant value to use for constant border mode policy.
unsigned int adjust_vec_size(unsigned int vec_size, size_t dim0)
Returns the adjusted vector size in case it is less than the input&#39;s first dimension, getting rounded down to its closest valid vector size.
Definition: Utils.h:1222
DataLayout data_layout
Data layout to use.
std::string kernel_name
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.
Definition: Utils.h:1010

◆ run_op()

void run_op ( ITensorPack tensors,
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]tensorsA vector containing the tensors to operato on.
[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.

Reimplemented from ICLKernel.

Definition at line 219 of file ClScaleKernel.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC, ICLKernel::add_2D_tensor_argument(), ICLKernel::add_4d_tensor_nhwc_argument(), ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::collapse(), Window::DimZ, arm_compute::enqueue(), Window::first_slice_window_2D(), Window::first_slice_window_4D(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), ICLKernel::lws_hint(), arm_compute::NCHW, arm_compute::NHWC, arm_compute::test::validation::reference::slice(), Window::slide_window_slice_2D(), and IKernel::window().

220 {
223 
224  auto src = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC));
225  auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST));
226 
227  switch(_data_layout)
228  {
229  case DataLayout::NCHW:
230  {
232 
233  do
234  {
235  unsigned int idx = 0;
236  add_2D_tensor_argument(idx, src, slice);
237  add_2D_tensor_argument(idx, dst, slice);
238  enqueue(queue, *this, slice, lws_hint());
239  }
240  while(window.slide_window_slice_2D(slice));
241  break;
242  }
243  case DataLayout::NHWC:
244  {
245  Window collapsed = window.collapse(ICLKernel::window(), Window::DimZ);
246  Window slice = collapsed.first_slice_window_4D();
247 
248  unsigned int idx = 0;
250  add_4d_tensor_nhwc_argument(idx, dst);
251  enqueue(queue, *this, slice, lws_hint());
252  break;
253  }
254  default:
255  ARM_COMPUTE_ERROR("Data layout not supported");
256  }
257 }
void add_4d_tensor_nhwc_argument(unsigned int &idx, const ICLTensor *tensor)
Add the passed NHWC 4D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments by passing strides...
Definition: ICLKernel.cpp:144
Window first_slice_window_2D() const
First 2D slice of the window.
Definition: Window.h:297
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
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:32
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:383
SimpleTensor< float > src
Definition: DFT.cpp:155
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Definition: Window.h:337
Window collapse(const Window &full_window, size_t first, size_t last=Coordinates::num_max_dimensions) const
Collapse the dimensions between first and last.
Definition: Window.inl:111
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:915
Num samples, channels, height, width.
void add_2D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 2D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments starting from the index idx...
Definition: ICLKernel.h:202
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
Num samples, height, width, channels.
Window first_slice_window_4D() const
First 4D slice of the window.
Definition: Window.h:313
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:201
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst,
const ScaleKernelInfo info 
)
static

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

Similar to ClScaleKernel::configure()

Returns
a status

Definition at line 81 of file ClScaleKernel.cpp.

References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::cpu::kernels::validate_arguments().

Referenced by ClScale::validate().

82 {
84  return Status{};
85 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
SimpleTensor< float > src
Definition: DFT.cpp:155
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

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