24 #ifndef __ARM_COMPUTE_WINDOW_H__ 25 #define __ARM_COMPUTE_WINDOW_H__ 43 static constexpr
size_t DimX = 0;
45 static constexpr
size_t DimY = 1;
47 static constexpr
size_t DimZ = 2;
51 : _dims(), _thread_id(0), _num_threads(1)
90 constexpr
int end()
const 156 void set(
size_t dimension,
const Dimension &dim);
170 void shift(
size_t dimension,
int shift_value);
179 void scale(
size_t dimension,
float scale_value);
222 return first_slice_window<1>();
230 return first_slice_window<2>();
238 return first_slice_window<3>();
250 return slide_window_slice<1>(slice);
262 return slide_window_slice<2>(slice);
274 return slide_window_slice<3>(slice);
314 template <
unsigned int window_dimension>
315 Window first_slice_window()
const;
325 template <
unsigned int window_dimension>
326 bool slide_window_slice(
Window &slice)
const;
329 std::array<Dimension, Coordinates::num_max_dimensions> _dims;
330 unsigned int _thread_id;
331 unsigned int _num_threads;
void scale(size_t dimension, float scale_value)
Scale the values of a given dimension by the given scale_value.
void shift(size_t dimension, int shift_value)
Shift the values of a given dimension by the given shift_value.
bool slide_window_slice_1D(Window &slice) const
Slide the passed 1D window slice.
void set_num_threads(unsigned int num_threads)
Sets the number of threads dispatched that the window is associated with.
Window first_slice_window_3D() const
First 3D slice of the window.
void set_thread_id(unsigned int id)
Sets the ID of the thread that the window is associated with.
Window first_slice_window_2D() const
First 2D slice of the window.
Describe one of the image's dimensions with a start, end and step.
constexpr int start() const
Return the start of the dimension.
constexpr int end() const
Return the end of the dimension.
constexpr size_t num_iterations(size_t dimension) const
Return the number of iterations needed to iterate through a given dimension.
Dimension & operator=(const Dimension &d)=default
Default assignment operator to allow dimensions to be copied.
constexpr const Dimension & y() const
Alias to access the second dimension of the window.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
constexpr const Dimension & operator[](size_t dimension) const
Read only access to a given dimension of the window.
Window first_slice_window_1D() const
First 1D slice of the window.
constexpr unsigned int thread_id() const
Get the ID of the thread that the window is associated with.
constexpr Window()
Default constructor: create a window containing a single element.
void set_step(int step)
Set the dimension's step.
constexpr Dimension(int start=0, int end=1, int step=1)
Constructor, by default creates a dimension of 1.
void validate() const
Will validate all the window's dimensions' values when asserts are enabled.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
void set_dimension_step(size_t dimension, int step)
Set the step of a given dimension.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
constexpr int step() const
Return the step of the dimension.
Store the tensor's metadata.
constexpr unsigned int num_threads() const
Get the number of threads dispatched that the window is associated with.
bool slide_window_slice_2D(Window &slice) const
Slide the passed 2D window slice.
Window split_window(size_t dimension, size_t id, size_t total) const
Split a window into a set of sub windows along a given dimension.
void use_tensor_dimensions(const TensorInfo *info, size_t first_dimension=Window::DimX)
Use the tensor's dimensions to fill the window dimensions.
constexpr const Dimension & z() const
Alias to access the third dimension of the window.
Describe a multidimensional execution window.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.