24.04
|
Implementation of a rectangular access pattern. More...
#include <IAccessWindow.h>
Public Member Functions | |
AccessWindowRectangle (ITensorInfo *info, int x, int y, int width, int height) | |
Constructor for a rectangular access pattern. More... | |
AccessWindowRectangle (ITensorInfo *info, int x, int y, int width, int height, float scale_x, float scale_y) | |
Constructor for a rectangular access pattern. More... | |
AccessWindowRectangle (const AccessWindowRectangle &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
AccessWindowRectangle (AccessWindowRectangle &&)=default | |
Allow instances of this class to be move constructed. More... | |
AccessWindowRectangle & | operator= (const AccessWindowRectangle &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
AccessWindowRectangle & | operator= (AccessWindowRectangle &&)=default |
Allow instances of this class to be moved. More... | |
~AccessWindowRectangle ()=default | |
Default destructor. More... | |
void | set_valid_region (const Window &window, const ValidRegion &input_valid_region, bool border_undefined=false, const BorderSize &border_size=BorderSize(0)) |
Set the valid region based on access pattern, valid region of the inputs and border mode. More... | |
ValidRegion | compute_valid_region (const Window &window, const ValidRegion &input_valid_region) const |
Compute the valid region based on access pattern, valid region of the inputs and border mode. More... | |
ValidRegion | compute_valid_region (const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) const override |
Compute the valid region based on access pattern and valid region of the inputs. More... | |
bool | update_window_if_needed (Window &window) const override |
Shrink the window if padding is not large enough. More... | |
bool | update_padding_if_needed (const Window &window) override |
Increase the padding to be large enough for the window. More... | |
Public Member Functions inherited from IAccessWindow | |
virtual | ~IAccessWindow ()=default |
Default virtual destructor. More... | |
Implementation of a rectangular access pattern.
Definition at line 110 of file IAccessWindow.h.
|
inline |
Constructor for a rectangular access pattern.
[in,out] | info | Tensor info of the accessed kernel. |
[in] | x | Offset of the access in X direction. |
[in] | y | Offset of the access in Y direction. |
[in] | width | Number of elements that are accessed in X direction. |
[in] | height | Number of elements that are accessed in Y direction. |
Definition at line 123 of file IAccessWindow.h.
|
inline |
Constructor for a rectangular access pattern.
[in,out] | info | Tensor info of the accessed kernel. |
[in] | x | Offset of the access in X direction. |
[in] | y | Offset of the access in Y direction. |
[in] | width | Number of elements that are accessed in X direction. |
[in] | height | Number of elements that are accessed in Y direction. |
[in] | scale_x | Ratio along the X direction between the window used by the execute_window_loop and the rectangular access pattern defined |
[in] | scale_y | Ratio along the Y direction between the window used by the execute_window_loop and the rectangular access pattern defined |
Definition at line 140 of file IAccessWindow.h.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::scale_x, and arm_compute::test::validation::scale_y.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be move constructed.
|
default |
Default destructor.
ValidRegion compute_valid_region | ( | const Window & | window, |
const ValidRegion & | input_valid_region | ||
) | const |
Compute the valid region based on access pattern, valid region of the inputs and border mode.
[in] | window | Execution window of the kernel. |
[in] | input_valid_region | Combined valid region of all inputs. |
Definition at line 32 of file IAccessWindow.cpp.
Referenced by AccessWindowRectangle::set_valid_region().
|
overridevirtual |
Compute the valid region based on access pattern and valid region of the inputs.
[in] | window | Execution window of the kernel. |
[in] | input_valid_region | Combined valid region of all inputs. |
[in] | border_undefined | Undefined borders are excluded from the valid region. |
[in] | border_size | Size of the border around the XY-plane of the tensor. |
Implements IAccessWindow.
Reimplemented in AccessWindowTranspose.
Definition at line 38 of file IAccessWindow.cpp.
References ValidRegion::anchor, BorderSize::bottom, Window::Dimension::end(), arm_compute::mlgo::parser::end(), BorderSize::left, ITensorInfo::num_dimensions(), BorderSize::right, Dimensions< T >::set(), arm_compute::test::validation::shape, ValidRegion::shape, Window::Dimension::start(), Window::Dimension::step(), BorderSize::top, Window::x(), and Window::y().
|
default |
Allow instances of this class to be moved.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
void set_valid_region | ( | const Window & | window, |
const ValidRegion & | input_valid_region, | ||
bool | border_undefined = false , |
||
const BorderSize & | border_size = BorderSize(0) |
||
) |
Set the valid region based on access pattern, valid region of the inputs and border mode.
[in] | window | Execution window of the kernel. |
[in] | input_valid_region | Combined valid region of all inputs. |
[in] | border_undefined | (Optional) Undefined borders are excluded from the valid region. |
[in] | border_size | (Optional) Size of the border around the XY-plane of the tensor. |
Definition at line 97 of file IAccessWindow.cpp.
References AccessWindowRectangle::compute_valid_region(), and ITensorInfo::set_valid_region().
Referenced by ICLSimpleKernel::configure().
|
overridevirtual |
Increase the padding to be large enough for the window.
[in] | window | Window used by the kernel. |
Implements IAccessWindow.
Reimplemented in AccessWindowTranspose.
Definition at line 227 of file IAccessWindow.cpp.
References ITensorInfo::extend_padding(), and ITensorInfo::is_resizable().
|
overridevirtual |
Shrink the window if padding is not large enough.
[in] | window | Window used by the kernel. |
Implements IAccessWindow.
Reimplemented in AccessWindowTranspose.
Definition at line 108 of file IAccessWindow.cpp.
References arm_compute::adjust_down(), arm_compute::adjust_up(), BorderSize::bottom, Window::Dimension::end(), arm_compute::mlgo::parser::end(), ITensorInfo::is_resizable(), BorderSize::left, ITensorInfo::num_dimensions(), ITensorInfo::offset_first_element_in_bytes(), ITensorInfo::padding(), BorderSize::right, Window::set(), arm_compute::test::validation::shape, Window::Dimension::start(), Window::Dimension::step(), ITensorInfo::strides_in_bytes(), ITensorInfo::tensor_shape(), BorderSize::top, ITensorInfo::total_size(), Window::validate(), Window::x(), and Window::y().