Compute Library
 20.02.1
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 184 of file Types.h.

Constructor & Destructor Documentation

◆ ValidRegion() [1/5]

ValidRegion ( )
inline

Default constructor.

Definition at line 187 of file Types.h.

188  : anchor{}, shape{}
189  {
190  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:257
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

◆ 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 209 of file Types.h.

210  : anchor{ an_anchor }, shape{ a_shape }
211  {
213  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:257
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:122
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:128
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

◆ 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 222 of file Types.h.

223  : anchor{ an_anchor }, shape{ a_shape }
224  {
225  ARM_COMPUTE_ERROR_ON(num_dimensions < std::max(anchor.num_dimensions(), shape.num_dimensions()));
226  anchor.set_num_dimensions(num_dimensions);
227  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:257
#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:122
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:128
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

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 236 of file Types.h.

237  {
238  return anchor[d] + shape[d];
239  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:257
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

References ValidRegion::anchor, and ValidRegion::shape.

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

◆ 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 249 of file Types.h.

250  {
251  anchor.set(dimension, start);
252  shape.set(dimension, size);
253  return *this;
254  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:257
void set(size_t dimension, T value)
Accessor to set the value of one of the dimensions.
Definition: Dimensions.h:74
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
Definition: Types.h:230
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:78
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

References ValidRegion::anchor, Dimensions< T >::set(), TensorShape::set(), ValidRegion::shape, and ValidRegion::start().

◆ start()

int start ( unsigned int  d) const
inline

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

Definition at line 230 of file Types.h.

231  {
232  return anchor[d];
233  }
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:256

References ValidRegion::anchor.

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

Field Documentation

◆ anchor

◆ shape


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