Compute Library
 21.02
ValidRegion Struct Reference

Container for valid region of a window. More...

#include <Types.h>

Collaboration diagram for ValidRegion:
[legend]

Public Member Functions

 ValidRegion ()
 Default constructor. More...
 
 ValidRegion (const ValidRegion &)=default
 Allow instances of this class to be copy constructed. More...
 
 ValidRegion (ValidRegion &&)=default
 Allow instances of this class to be move constructed. More...
 
ValidRegionoperator= (const ValidRegion &)=default
 Allow instances of this class to be copied. More...
 
ValidRegionoperator= (ValidRegion &&)=default
 Allow instances of this class to be moved. More...
 
 ~ValidRegion ()=default
 Default destructor. More...
 
 ValidRegion (const Coordinates &an_anchor, const TensorShape &a_shape)
 Constructor for a valid region with default number of dimensions. More...
 
 ValidRegion (const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
 Constructor for a valid region with specified number of dimensions. More...
 
int start (unsigned int d) const
 Return the start of the valid region for the given dimension d. More...
 
int end (unsigned int d) const
 Return the end of the valid region for the given dimension d. More...
 
ValidRegionset (size_t dimension, int start, size_t size)
 Accessor to set the value of anchor and shape for one of the dimensions. More...
 

Data Fields

Coordinates anchor
 Anchor for the start of the valid region. More...
 
TensorShape shape
 Shape of the valid region. More...
 

Detailed Description

Container for valid region of a window.

Definition at line 188 of file Types.h.

Constructor & Destructor Documentation

◆ ValidRegion() [1/5]

ValidRegion ( )
inline

Default constructor.

Definition at line 191 of file Types.h.

References arm_compute::test::validation::shape.

192  : anchor{}, shape{}
193  {
194  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:261
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

◆ ValidRegion() [2/5]

ValidRegion ( const ValidRegion )
default

Allow instances of this class to be copy constructed.

◆ ValidRegion() [3/5]

ValidRegion ( ValidRegion &&  )
default

Allow instances of this class to be move constructed.

◆ ~ValidRegion()

~ValidRegion ( )
default

Default destructor.

◆ ValidRegion() [4/5]

ValidRegion ( const Coordinates an_anchor,
const TensorShape a_shape 
)
inline

Constructor for a valid region with default number of dimensions.

Parameters
[in]an_anchorAnchor for the start of the valid region.
[in]a_shapeShape of the valid region.

Definition at line 213 of file Types.h.

References arm_compute::test::validation::shape.

214  : anchor{ an_anchor }, shape{ a_shape }
215  {
217  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:261
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:143
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:149
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

◆ ValidRegion() [5/5]

ValidRegion ( const Coordinates an_anchor,
const TensorShape a_shape,
size_t  num_dimensions 
)
inline

Constructor for a valid region with specified number of dimensions.

Parameters
[in]an_anchorAnchor for the start of the valid region.
[in]a_shapeShape of the valid region.
[in]num_dimensionsNumber of dimensions (must be >= number of dimensions of anchor and shape).

Definition at line 226 of file Types.h.

References ARM_COMPUTE_ERROR_ON, and arm_compute::test::validation::shape.

227  : anchor{ an_anchor }, shape{ a_shape }
228  {
229  ARM_COMPUTE_ERROR_ON(num_dimensions < std::max(anchor.num_dimensions(), shape.num_dimensions()));
230  anchor.set_num_dimensions(num_dimensions);
231  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:261
#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
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:143
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:149
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

Member Function Documentation

◆ end()

int end ( unsigned int  d) const
inline

Return the end of the valid region for the given dimension d.

Definition at line 240 of file Types.h.

References arm_compute::test::validation::shape.

Referenced by CLLKTrackerStage0Kernel::configure(), CLLKTrackerStage1Kernel::configure(), and arm_compute::test::is_in_valid_region().

241  {
242  return anchor[d] + shape[d];
243  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:261
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

◆ operator=() [1/2]

ValidRegion& operator= ( const ValidRegion )
default

Allow instances of this class to be copied.

◆ operator=() [2/2]

ValidRegion& operator= ( ValidRegion &&  )
default

Allow instances of this class to be moved.

◆ set()

ValidRegion& set ( size_t  dimension,
int  start,
size_t  size 
)
inline

Accessor to set the value of anchor and shape for one of the dimensions.

Parameters
[in]dimensionDimension for which the value is set.
[in]startValue to be set in anchor for the dimension.
[in]sizeValue to be set in shape for the dimension.
Returns
*this.

Definition at line 253 of file Types.h.

References ValidRegion::set(), and arm_compute::test::validation::shape.

Referenced by ValidRegion::set().

254  {
255  anchor.set(dimension, start);
256  shape.set(dimension, size);
257  return *this;
258  }
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: Dimensions.h:76
TensorShape shape
Shape of the valid region.
Definition: Types.h:261
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
Definition: Types.h:234
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:79
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

◆ start()

int start ( unsigned int  d) const
inline

Return the start of the valid region for the given dimension d.

Definition at line 234 of file Types.h.

Referenced by CLLKTrackerStage0Kernel::configure(), CLLKTrackerStage1Kernel::configure(), and arm_compute::test::is_in_valid_region().

235  {
236  return anchor[d];
237  }
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:260

Field Documentation

◆ anchor

◆ shape


The documentation for this struct was generated from the following file: