FreePOOMA
2.4.1
|
BrickBase<Dim> is the base-class for engines that have a Brick-like interpretation of a block of data; i.e. More...
#include <BrickBase.h>
Public Types | |
enum | { dimensions = Dim } |
enum | { brick = true } |
enum | { zeroBased = false } |
typedef Interval< Dim > | Domain_t |
typedef DomainLayout< Dim > | Layout_t |
typedef BrickBase< Dim > | This_t |
Public Member Functions | |
BrickBase (bool compressible=false) | |
Default constructor. | |
BrickBase (const Domain_t &dom, bool compressible=false) | |
Initialize the BrickBase with an Interval describing the Dim- dimensional domain to be indexed. | |
BrickBase (const Node< Domain_t > &node, bool compressible=false) | |
Initialize the BrickBase with a Node describing the Dim- dimensional domain to be indexed. | |
BrickBase (const Layout_t &layout, bool compressible=false) | |
Initialize the BrickBase with a Layout describing the Dim- dimensional domain to be indexed. | |
~BrickBase () | |
const Domain_t & | domain () const |
Return the domain. | |
const Layout_t & | layout () const |
Return the layout. | |
const int * | strides () const |
Return the strides array. | |
const int * | originalStrides () const |
Return the true strides array. | |
int | first (int i) const |
Return the first index value for the specified dimension. | |
bool | compressibleBase () const |
Used by constructors. | |
Offset Calculations | |
These are provided for Domains and for sets of ints. Only BrickBase provides the offset0 & offsetC versions. offset0 treats the input domain as a zero-based domain giving offsets from the beginning in each dimension, rather than as points in the Brick's underlying domain. offsetC is similar, except that it multiplies the first offset by strides_m[0]. This is only for use in CompressibleBrick. The "int" versions do not assert that their dimensionality is correct. The inheriting class should make these checks. These are fairly short and there are a lot of them so we define them in the class body for simplicity. | |
template<class Domain > | |
int | offset (const Domain &dom) const |
template<class Domain > | |
int | offset0 (const Domain &dom) const |
template<class Domain > | |
int | offsetC (const Domain &dom) const |
int | offset () const |
int | baseOffset () const |
int | offset (int i0) const |
int | offset (int i0, int i1) const |
int | offset (int i0, int i1, int i2) const |
int | offset (int i0, int i1, int i2, int i3) const |
int | offset (int i0, int i1, int i2, int i3, int i4) const |
int | offset (int i0, int i1, int i2, int i3, int i4, int i5) const |
int | offset (int i0, int i1, int i2, int i3, int i4, int i5, int i6) const |
int | offset0 (int i0) const |
int | offset0 (int i0, int i1) const |
int | offset0 (int i0, int i1, int i2) const |
int | offset0 (int i0, int i1, int i2, int i3) const |
int | offset0 (int i0, int i1, int i2, int i3, int i4) const |
int | offset0 (int i0, int i1, int i2, int i3, int i4, int i5) const |
int | offset0 (int i0, int i1, int i2, int i3, int i4, int i5, int i6) const |
int | offsetC (int i0) const |
int | offsetC (int i0, int i1) const |
int | offsetC (int i0, int i1, int i2) const |
int | offsetC (int i0, int i1, int i2, int i3) const |
int | offsetC (int i0, int i1, int i2, int i3, int i4) const |
int | offsetC (int i0, int i1, int i2, int i3, int i4, int i5) const |
int | offsetC (int i0, int i1, int i2, int i3, int i4, int i5, int i6) const |
Protected Member Functions | |
void | init () |
Initialization of strides and offset from the domain. | |
void | zeroStrides () |
void | restoreStrides () |
Protected Attributes | |
Layout_t | layout_m |
Layout. | |
int | strides_m [Dim] |
Strides through actual data block when stepping in different dimensions. | |
int | ostrides_m [Dim] |
int | off_m |
Offset due to non-zero first elements. | |
bool | compressibleBase_m |
Flag indicating whether or not the stride compressions routines are callable. |
BrickBase<Dim> is the base-class for engines that have a Brick-like interpretation of a block of data; i.e.
whose data is stored in a single contiguous block of memory that is interpreted as a Dim-dimensional "brick" using Fortran storage conventions.
BrickBase caches a copy of the original strides and can zero and restore the strides array at will. These operations are used by CompressibleBricks and are only enabled if the BrickBase constructor specifies that the compressible flag is true.
The template parameters are:
BrickBase encapsulates the strides, domain, and the calculation of indexing offsets brick-like engines.
BrickViewBase<Dim>, which is defined below, is used to represent subsets of a data block described by a BrickBase. BrickViewBase serves as the base class for brick-view types of engines.
typedef Interval<Dim> Pooma::BrickBase< Dim >::Domain_t |
Reimplemented in Engine< Dim, T, Brick >, and Engine< Dim, T, CompressibleBrick >.
typedef DomainLayout<Dim> Pooma::BrickBase< Dim >::Layout_t |
Reimplemented in Engine< Dim, T, Brick >, and Engine< Dim, T, CompressibleBrick >.
typedef BrickBase<Dim> Pooma::BrickBase< Dim >::This_t |
Reimplemented in Engine< Dim, T, Brick >, and Engine< Dim, T, CompressibleBrick >.
Pooma::BrickBase< Dim >::BrickBase | ( | bool | compressible = false | ) | [inline, explicit] |
Default constructor.
Creates an uninitialized BrickBase (i.e. empty domain, uninitialized strides, etc.)
Pooma::BrickBase< Dim >::BrickBase | ( | const Domain_t & | dom, |
bool | compressible = false |
||
) | [inline, explicit] |
Initialize the BrickBase with an Interval describing the Dim- dimensional domain to be indexed.
References Pooma::BrickBase< Dim >::init().
Pooma::BrickBase< Dim >::BrickBase | ( | const Node< Domain_t > & | node, |
bool | compressible = false |
||
) | [inline, explicit] |
Initialize the BrickBase with a Node describing the Dim- dimensional domain to be indexed.
References Pooma::BrickBase< Dim >::init().
Pooma::BrickBase< Dim >::BrickBase | ( | const Layout_t & | layout, |
bool | compressible = false |
||
) | [inline, explicit] |
Initialize the BrickBase with a Layout describing the Dim- dimensional domain to be indexed.
References Pooma::BrickBase< Dim >::init().
Pooma::BrickBase< Dim >::~BrickBase | ( | ) | [inline] |
const Domain_t& Pooma::BrickBase< Dim >::domain | ( | ) | const [inline] |
Return the domain.
Reimplemented in Engine< Dim, T, CompressibleBrick >.
References DomainLayout< Dim >::domain(), and Pooma::BrickBase< Dim >::layout_m.
Referenced by Pooma::BrickBase< Dim >::init().
const Layout_t& Pooma::BrickBase< Dim >::layout | ( | ) | const [inline] |
Return the layout.
References Pooma::BrickBase< Dim >::layout_m.
const int* Pooma::BrickBase< Dim >::strides | ( | ) | const [inline] |
Return the strides array.
References Pooma::BrickBase< Dim >::strides_m.
const int* Pooma::BrickBase< Dim >::originalStrides | ( | ) | const [inline] |
Return the true strides array.
References Pooma::BrickBase< Dim >::ostrides_m.
Referenced by Pooma::BrickViewBase< Dim >::BrickViewBase(), and Pooma::BrickViewBase< Dim >::viewInit().
int Pooma::BrickBase< Dim >::first | ( | int | i | ) | const [inline] |
Return the first index value for the specified dimension.
References DomainLayout< Dim >::domain(), and Pooma::BrickBase< Dim >::layout_m.
bool Pooma::BrickBase< Dim >::compressibleBase | ( | ) | const [inline] |
Used by constructors.
References Pooma::BrickBase< Dim >::compressibleBase_m.
int Pooma::BrickBase< Dim >::offset | ( | const Domain & | dom | ) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::offset0().
int Pooma::BrickBase< Dim >::offset0 | ( | const Domain & | dom | ) | const [inline] |
References CTAssert, and Pooma::BrickBase< Dim >::strides_m.
Referenced by Pooma::BrickBase< Dim >::offset().
int Pooma::BrickBase< Dim >::offsetC | ( | const Domain & | dom | ) | const [inline] |
References CTAssert, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | ) | const [inline] |
References Pooma::BrickBase< Dim >::off_m.
int Pooma::BrickBase< Dim >::baseOffset | ( | ) | const [inline] |
References Pooma::BrickBase< Dim >::off_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0 | ) | const [inline] |
References Pooma::BrickBase< Dim >::off_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1, | ||
int | i2 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5, | ||
int | i6 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::off_m, and Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0 | ) | const [inline] |
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1, | ||
int | i2 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offset0 | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5, | ||
int | i6 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0 | ) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1, | ||
int | i2 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
int Pooma::BrickBase< Dim >::offsetC | ( | int | i0, |
int | i1, | ||
int | i2, | ||
int | i3, | ||
int | i4, | ||
int | i5, | ||
int | i6 | ||
) | const [inline] |
References Pooma::BrickBase< Dim >::strides_m.
void Pooma::BrickBase< Dim >::init | ( | ) | [inline, protected] |
Initialization of strides and offset from the domain.
References Pooma::BrickBase< Dim >::domain(), Pooma::BrickBase< Dim >::off_m, Pooma::BrickBase< Dim >::ostrides_m, and Pooma::BrickBase< Dim >::strides_m.
Referenced by Pooma::BrickBase< Dim >::BrickBase().
void Pooma::BrickBase< Dim >::zeroStrides | ( | ) | [inline, protected] |
References Pooma::BrickBase< Dim >::strides_m.
void Pooma::BrickBase< Dim >::restoreStrides | ( | ) | [inline, protected] |
References Pooma::BrickBase< Dim >::ostrides_m, and Pooma::BrickBase< Dim >::strides_m.
Layout_t Pooma::BrickBase< Dim >::layout_m [protected] |
Layout.
Referenced by Pooma::BrickBase< Dim >::domain(), Pooma::BrickBase< Dim >::first(), and Pooma::BrickBase< Dim >::layout().
int Pooma::BrickBase< Dim >::strides_m[Dim] [protected] |
Strides through actual data block when stepping in different dimensions.
We keep two copies - strides_m is used by the offset calculations. If we are compressible, then when compressed, these will all be set to zero.
Referenced by Pooma::BrickBase< Dim >::init(), Pooma::BrickBase< Dim >::offset(), Pooma::BrickBase< Dim >::offset0(), Pooma::BrickBase< Dim >::offsetC(), Pooma::BrickBase< Dim >::restoreStrides(), Pooma::BrickBase< Dim >::strides(), and Pooma::BrickBase< Dim >::zeroStrides().
int Pooma::BrickBase< Dim >::ostrides_m[Dim] [protected] |
int Pooma::BrickBase< Dim >::off_m [protected] |
Offset due to non-zero first elements.
Referenced by Pooma::BrickBase< Dim >::baseOffset(), Pooma::BrickBase< Dim >::init(), and Pooma::BrickBase< Dim >::offset().
bool Pooma::BrickBase< Dim >::compressibleBase_m [protected] |
Flag indicating whether or not the stride compressions routines are callable.
This is only set by the constructor and cannot be read or modified. It could be integrated into the type (as another template parameter), but that would complicate certain operations, and the benefit would probably not be worth the cost in complexity.
Referenced by Pooma::BrickBase< Dim >::compressibleBase().