Compute Library
 21.02
CLReductionOperationKernel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
25 
31 #include "arm_compute/core/Utils.h"
35 #include "src/core/CL/CLValidate.h"
38 
39 #include "support/StringSupport.h"
40 
41 namespace arm_compute
42 {
43 namespace
44 {
45 // OpenCL kernel requires input width to be a power of 2 for x-axis.
46 constexpr unsigned int border_val = 64;
47 
48 Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, unsigned int width)
49 {
52  if(input->num_channels() == 1)
53  {
55  }
56  else
57  {
59  }
60  ARM_COMPUTE_RETURN_ERROR_ON_MSG(op == ReductionOperation::SUM_SQUARE && input->data_type() == DataType::QASYMM8, "Not supported reduction operation for QASYMM8");
61  ARM_COMPUTE_RETURN_ERROR_ON_MSG(axis >= TensorShape::num_max_dimensions, "Reduction axis greater than max number of dimensions");
62  ARM_COMPUTE_RETURN_ERROR_ON_MSG(axis > 3, "Unsupported reduction axis");
63  ARM_COMPUTE_RETURN_ERROR_ON((op == ReductionOperation::MEAN_SUM) && (axis == 0) && (width == 0) && (input->data_type() != DataType::QASYMM8) && (input->data_type() != DataType::QASYMM8_SIGNED));
64  ARM_COMPUTE_RETURN_ERROR_ON_MSG((op == ReductionOperation::ARG_IDX_MAX) || (op == ReductionOperation::ARG_IDX_MIN), "Not supported reduction operation, use CLArgMinMaxLayer");
65 
66  if(output->total_size() != 0)
67  {
70  }
71 
72  return Status{};
73 }
74 
75 std::tuple<Status, Window> validate_and_configure_window(ITensorInfo *input, ITensorInfo *output, unsigned int axis, ReductionOperation op)
76 {
77  // Output tensor auto initialization if not yet initialized
78  const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_reduced_shape(input->tensor_shape(), axis, true);
79  DataType output_data_type = input->data_type();
80  auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape).set_data_type(output_data_type).reset_padding().set_is_resizable(true));
81 
82  const unsigned int num_elems_processed_per_iteration = (is_data_type_quantized(input->data_type()) && (axis == 0)) ? 1 : 16;
83  Window win = calculate_max_window(*input, Steps(num_elems_processed_per_iteration));
84  bool window_changed = false;
85  const bool is_serial_op = needs_serialized_reduction(op, input->data_type(), axis);
86 
87  switch(axis)
88  {
89  case 0:
90  {
91  if(!is_serial_op)
92  {
93  const unsigned int border_width = ((input->dimension(0) % border_val) != 0) ? border_val - input->dimension(0) % border_val : 0;
94  AccessWindowStatic input_access(input, 0, 0, input->dimension(0) + border_width, 1);
95  AccessWindowHorizontal output_access(output, 0, 1);
96  window_changed = update_window_and_padding(win, input_access, output_access);
97  output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape()));
98  }
99  }
100  break;
101  case 1:
102  case 2:
103  case 3:
104  {
105  AccessWindowHorizontal input_access(input, 0, num_elems_processed_per_iteration);
106  AccessWindowHorizontal output_access(output, 0, num_elems_processed_per_iteration);
107  window_changed = update_window_and_padding(win, input_access, output_access);
108  output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape()));
109  }
110  break;
111  default:
112  ARM_COMPUTE_ERROR("Not supported");
113  }
114 
115  Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{};
116 
117  return std::make_tuple(err, win);
118 }
119 } // namespace
120 
122  : _input(nullptr), _output(nullptr), _reduction_axis(0), _op(ReductionOperation::SUM_SQUARE), _border_size()
123 {
124 }
125 
127 {
128  return _border_size;
129 }
130 
131 void CLReductionOperationKernel::configure(const ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, unsigned int width)
132 {
133  configure(CLKernelLibrary::get().get_compile_context(), input, output, axis, op, width);
134 }
135 
136 void CLReductionOperationKernel::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, unsigned int width)
137 {
138  ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
139 
140  ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), axis, op, width));
141 
142  _input = input;
143  _output = output;
144  _reduction_axis = axis;
145  _op = op;
146 
147  // Set build options
148  CLBuildOptions build_opts;
149  DataType data_type = input->info()->data_type();
150  std::string data_type_promoted{};
151 
152  if(is_data_type_quantized(data_type))
153  {
154  data_type_promoted = "int";
155  }
156  else
157  {
158  data_type_promoted = get_cl_type_from_data_type(data_type);
159  }
160 
161  build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(data_type));
162  build_opts.add_option("-DDATA_TYPE_PROMOTED=" + data_type_promoted);
163  build_opts.add_option_if(is_data_type_float(data_type), "-DFLOAT_DATA_TYPE");
164  build_opts.add_option_if(op == ReductionOperation::SUM_SQUARE, "-DSUM_SQUARE");
165  build_opts.add_option_if(op == ReductionOperation::MEAN_SUM, "-DMEAN");
166  build_opts.add_option_if(op == ReductionOperation::SUM, "-DSUM");
167  build_opts.add_option_if(op == ReductionOperation::PROD, "-DPROD");
168  build_opts.add_option_if(op == ReductionOperation::MIN, "-DMIN");
169  build_opts.add_option_if(op == ReductionOperation::MAX, "-DMAX");
170  build_opts.add_option_if(input->info()->num_channels() == 2, "-DCOMPLEX");
171  build_opts.add_option_if(is_data_type_quantized(data_type), "-DOFFSET=" + support::cpp11::to_string(input->info()->quantization_info().uniform().offset));
173 
174  switch(op)
175  {
177  build_opts.add_option(("-DOPERATION=square_sum"));
178  break;
181  build_opts.add_option(("-DOPERATION=sum"));
182  break;
185  break;
187  build_opts.add_option(("-DOPERATION=product"));
188  break;
189  default:
190  ARM_COMPUTE_ERROR("Unsupported reduction operation");
191  }
192 
193  // Create kernel
195  std::string kernel_axis_name;
196  const bool is_serial_op = needs_serialized_reduction(_op, _input->info()->data_type(), _reduction_axis);
197 
198  switch(axis)
199  {
200  case 0:
201  {
202  if(is_serial_op)
203  {
204  build_opts.add_option("-DWIDTH=" + support::cpp11::to_string(input->info()->dimension(0)));
205  build_opts.add_option_if_else(_input->info()->data_type() == DataType::F16, "-DCOND_DATA_TYPE=short", "-DCOND_DATA_TYPE=int");
206  kernel_axis_name = "non_parallel_x";
207  }
208  else
209  {
210  build_opts.add_option_if(op == ReductionOperation::MEAN_SUM, "-DWIDTH=" + support::cpp11::to_string(width));
211  const unsigned int width_leftover = input->info()->dimension(0) % border_val;
212  const unsigned int border_width = (width_leftover != 0) ? border_val - width_leftover : 0;
213  kernel_axis_name = "x";
214 
215  lws_hint = create_lws_hint_parallel_implementations(input->info()->dimension(0), border_val);
216  _border_size = BorderSize(0, border_width, 0, 0);
217  }
218  }
219  break;
220  case 1:
221  build_opts.add_option("-DHEIGHT=" + support::cpp11::to_string(input->info()->dimension(1)));
222  kernel_axis_name = "y";
223  break;
224  case 2:
225  build_opts.add_option("-DDEPTH=" + support::cpp11::to_string(input->info()->dimension(2)));
226  kernel_axis_name = "z";
227  break;
228  case 3:
229  build_opts.add_option("-DDEPTH=" + support::cpp11::to_string(input->info()->dimension(2)));
230  build_opts.add_option("-DBATCH=" + support::cpp11::to_string(input->info()->dimension(3)));
231  kernel_axis_name = "w";
232  break;
233  default:
234  ARM_COMPUTE_ERROR("Not supported");
235  }
236  _kernel = create_kernel(compile_context, "reduction_operation_" + kernel_axis_name, build_opts.options());
237 
238  // Configure kernel window
239  auto win_config = validate_and_configure_window(_input->info(), _output->info(), axis, op);
240 
241  ARM_COMPUTE_ERROR_THROW_ON(std::get<0>(win_config));
242 
243  ICLKernel::configure_internal(std::get<1>(win_config), lws_hint);
244 }
245 
246 Status CLReductionOperationKernel::validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, unsigned int width)
247 {
248  ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, axis, op, width));
249  ARM_COMPUTE_RETURN_ON_ERROR(std::get<0>(validate_and_configure_window(input->clone().get(), output->clone().get(), axis, op)));
250 
251  return Status{};
252 }
253 
254 void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &queue)
255 {
258 
259  const bool is_serial_op = needs_serialized_reduction(_op, _input->info()->data_type(), _reduction_axis);
260  switch(_reduction_axis)
261  {
262  case 0:
263  {
264  // We use parallel reduction only in non quantized types
265  if(is_serial_op)
266  {
267  // Get first input and output slices
268  Window window_in{ window };
269  window_in.set(Window::DimX, Window::Dimension(0, _input->info()->dimension(0), _input->info()->dimension(0)));
270 
271  Window out_window{ window };
272  out_window.set(Window::DimX, Window::Dimension(0, 0, 0));
273 
274  Window in_slice = window_in.first_slice_window_1D();
275  Window out_slice = out_window.first_slice_window_1D();
276 
277  do
278  {
279  unsigned int idx = 0;
280  add_1D_tensor_argument(idx, _input, in_slice);
281  add_1D_tensor_argument(idx, _output, out_slice);
282  enqueue(queue, *this, in_slice, lws_hint());
283  }
284  while(window_in.slide_window_slice_1D(in_slice) && out_window.slide_window_slice_1D(out_slice));
285  }
286  else
287  {
288  // Set out window
289  Window out_window(window);
290  out_window.set(Window::DimX, Window::Dimension(0, 0, 0));
291 
292  // Get first input and output slices
293  Window in_slice = window.first_slice_window_2D();
294  Window out_slice = out_window.first_slice_window_2D();
295 
296  // Reshape window
297  const unsigned int border_width = ((in_slice.x().end() % border_val) != 0) ? border_val - in_slice.x().end() % border_val : 0;
298  in_slice.set(Window::DimX, Window::Dimension(in_slice.x().start(), in_slice.x().end() + border_width, in_slice.x().step()));
299 
300  // Set local sums buffer
301  unsigned int local_res_size = lws_hint()[0] * _input->info()->element_size();
302  _kernel.setArg(num_arguments_per_2D_tensor() * 2, local_res_size, nullptr);
303 
304  do
305  {
306  unsigned int idx = 0;
307  add_2D_tensor_argument(idx, _input, in_slice);
308  add_2D_tensor_argument(idx, _output, out_slice);
309  enqueue(queue, *this, in_slice, lws_hint());
310  }
311  while(window.slide_window_slice_2D(in_slice) && window.slide_window_slice_2D(out_slice));
312  }
313  }
314  break;
315  case 1:
316  {
317  // Get first input and output slices
318  Window window_in{ window };
319  window_in.set(Window::DimY, Window::Dimension(0, _input->info()->dimension(1), _input->info()->dimension(1)));
320  Window in_slice = window_in.first_slice_window_2D();
321  Window out_slice = window.first_slice_window_2D();
322 
323  do
324  {
325  unsigned int idx = 0;
326  add_2D_tensor_argument(idx, _input, in_slice);
327  add_2D_tensor_argument(idx, _output, out_slice);
328  enqueue(queue, *this, in_slice, lws_hint());
329  }
330  while(window_in.slide_window_slice_2D(in_slice) && window.slide_window_slice_2D(out_slice));
331  }
332  break;
333  case 2:
334  {
335  // Get first input and output slices
336  Window window_in{ window };
337  window_in.set(Window::DimZ, Window::Dimension(0, _input->info()->dimension(2), _input->info()->dimension(2)));
338  Window in_slice = window_in.first_slice_window_3D();
339  Window out_slice = window.first_slice_window_3D();
340 
341  do
342  {
343  unsigned int idx = 0;
344  add_3D_tensor_argument(idx, _input, in_slice);
345  add_3D_tensor_argument(idx, _output, out_slice);
346  enqueue(queue, *this, in_slice, lws_hint());
347  }
348  while(window_in.slide_window_slice_3D(in_slice) && window.slide_window_slice_3D(out_slice));
349  }
350  break;
351  case 3:
352  {
353  // Get first input and output slices
354  Window window_in{ window };
355  window_in.set(3, Window::Dimension(0, 1, 1));
356  Window in_slice = window_in.first_slice_window_4D();
357  Window out_slice = window.first_slice_window_4D();
358 
359  do
360  {
361  unsigned int idx = 0;
362  add_4D_tensor_argument(idx, _input, in_slice);
363  add_4D_tensor_argument(idx, _output, out_slice);
364  enqueue(queue, *this, in_slice, lws_hint());
365  }
366  while(window_in.slide_window_slice_4D(in_slice) && window.slide_window_slice_4D(out_slice));
367  }
368  break;
369  default:
370  ARM_COMPUTE_ERROR("Not supported");
371  }
372 }
373 } // namespace arm_compute
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:1168
Window first_slice_window_2D() const
First 2D slice of the window.
Definition: Window.h:283
bool needs_serialized_reduction(ReductionOperation op, DataType dt, unsigned int axis)
Check if the given reduction operation should be handled in a serial way.
Definition: Utils.cpp:453
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
#define ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(tensor)
Definition: CLValidate.h:35
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
void enqueue(IGCKernel &kernel, const Window &window, const gles::NDRange &lws=gles::NDRange(1U, 1U, 1U))
Add the kernel to the command queue with the given window.
Definition: IGCKernel.cpp:41
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
Definition: Validate.h:610
ReductionOperation
Available reduction operations.
Definition: Types.h:521
Container for 2D border size.
Definition: Types.h:273
const StringSet & options() const
Gets the current options list set.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
constexpr int step() const
Return the step of the dimension.
Definition: Window.h:104
cl::NDRange lws_hint() const
Return the Local-Workgroup-Size hint.
Definition: ICLKernel.h:276
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
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.
1 channel, 1 F32 per channel
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Store the tensor&#39;s metadata.
Definition: ITensorInfo.h:40
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
Describe one of the image&#39;s dimensions with a start, end and step.
Definition: Window.h:77
Status class.
Definition: Error.h:52
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Definition: Error.h:296
void run(const Window &window, cl::CommandQueue &queue) override
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue...
BorderSize border_size() const override
The size of the border for that kernel.
void add_3D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 3D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments starting from the index idx...
Definition: ICLKernel.h:172
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Definition: Window.h:323
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:163
1 channel, 1 S32 per channel
void add_option(std::string option)
Adds option to the existing build option list.
const DataType data_type
Definition: Im2Col.cpp:150
cl::NDRange default_ndrange() const
Return the default NDRange for the device.
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:403
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
bool update_window_and_padding(Window &win, Ts &&... patterns)
Update window and padding size for each of the access patterns.
Definition: WindowHelpers.h:46
std::string float_to_string_with_full_precision(float val)
Create a string with the float in full precision.
Definition: Utils.h:1262
quantized, asymmetric fixed-point 8-bit number unsigned
TensorShape compute_reduced_shape(const TensorShape &input, unsigned int axis, bool keep_dims=true)
Calculate the reduced shape of a tensor given an axis.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
std::string get_cl_type_from_data_type(const DataType &dt)
Translates a tensor data type to the appropriate OpenCL type.
Definition: CLHelpers.cpp:37
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...
static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, unsigned int width=0)
Static function to check if given info will lead to a valid configuration of CLReductionOperationKern...
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&#39;s metadata.
void add_option_if(bool cond, std::string option)
Adds option if a given condition is true;.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
Definition: Window.inl:49
static constexpr unsigned int num_arguments_per_2D_tensor()
Returns the number of arguments enqueued per 2D tensor object.
Definition: ICLKernel.h:206
cl::NDRange create_lws_hint_parallel_implementations(unsigned int input_dimension, unsigned int vector_size)
Creates a suitable LWS hint object for parallel implementations.
Definition: CLHelpers.cpp:411
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
Definition: Window.h:335
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
Definition: Validate.h:941
CLCompileContext class.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
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:148
Interface for OpenCL tensor.
Definition: ICLTensor.h:42
#define ARM_COMPUTE_CREATE_ERROR(error_code, msg)
Creates an error with a given message.
Definition: Error.h:159
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:545
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:792
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo *output_stage)
Window first_slice_window_4D() const
First 4D slice of the window.
Definition: Window.h:299
bool slide_window_slice_4D(Window &slice) const
Slide the passed 4D window slice.
Definition: Window.h:347
unsigned int num_elems_processed_per_iteration
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Definition: Error.h:244
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
quantized, asymmetric fixed-point 8-bit number signed
constexpr int end() const
Return the end of the dimension.
Definition: Window.h:99
void add_1D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 1D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments starting from the index idx...
Definition: ICLKernel.h:124
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
void configure(const ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, unsigned int width=0)
Set the input and output tensors.
Window first_slice_window_3D() const
First 3D slice of the window.
Definition: Window.h:291
DataType
Available data types.
Definition: Types.h:77
void add_4D_tensor_argument(unsigned int &idx, const ICLTensor *tensor, const Window &window)
Add the passed 4D tensor&#39;s parameters to the object&#39;s kernel&#39;s arguments starting from the index idx...
Definition: ICLKernel.h:182
constexpr int start() const
Return the start of the dimension.
Definition: Window.h:94
Describe a multidimensional execution window.
Definition: Window.h:39
virtual size_t num_channels() const =0
The number of channels for each tensor element.
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.
Definition: Utils.h:1148
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
Definition: Validate.h:205
Window first_slice_window_1D() const
First 1D slice of the window.
Definition: Window.h:275
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
Definition: Window.h:145
void add_option_if_else(bool cond, std::string option_true, std::string option_false)
Adds first option if condition is true else the second one.