Skip to content

Class TempLat::LayoutStructLocalTransposed

template <size_t _NDim>

ClassList > TempLat > LayoutStructLocalTransposed

transitionMap: a map of the dimensions, for transposition in memory. E.g. {0, 1, 2, 3} is untransposed 4d, {1, 0, 2, 3} is FFTW transposed. In other words, the entries in transitionMap are in line with the entries in localStarts/-Sizes, and their value indicates the physical-space dimension of that entry. More...

  • #include <layoutstructlocaltransposed.h>

Classes

Type Name
struct CoordinateMapping
A dictionary for return values for memory to coordinate mapping.

Public Static Attributes

Type Name
constexpr size_t NDim = \_NDim

Public Functions

Type Name
LayoutStructLocalTransposed (const device::IdxArray< NDim > & initNGrid, const device::Idx nGhosts)
DEVICE_INLINE_FUNCTION LayoutStructGlobal< NDim > & getGlobal ()
DEVICE_INLINE_FUNCTION const LayoutStructGlobal< NDim > & getGlobal () const
DEVICE_INLINE_FUNCTION LayoutStructLocal< NDim > & getLocal ()
DEVICE_INLINE_FUNCTION const LayoutStructLocal< NDim > & getLocal () const
DEVICE_INLINE_FUNCTION CoordinateMapping getMemoryIndexFromSpatialLocation (device::Idx position, device::Idx spatialDimension) const
With transposition, go from spatial coordinate value at spatial dimension to actual memory index in memoryDimension.
device::Idx getOrigin () const
Get the actual memory index of the origin (WITH PADDING)
device::array< device::IdxArray< 2 >, NDim > getPadding () const
DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & getSizesInMemory () const
Return the sizes in memory, i.e. with transposition applied. This does NOT include padding, but only fixes the transposition.
DEVICE_INLINE_FUNCTION CoordinateMapping getSpatialLocationFromMemoryIndex (device::Idx index, device::Idx memoryDimension) const
With transposition, go from actual memory index in memoryDimension to spatial coordinate value at spatial dimension.
DEVICE_INLINE_FUNCTION const TranspositionMap< NDim > & getTranspositionMap_memoryToGlobalSpace () const
DEVICE_INLINE_FUNCTION bool isTransposed () const
void setLocalSizes (const device::IdxArray< NDim > & input)
void setNGhosts (device::Idx nGhosts)
void setTranspositionMap_memoryToGlobalSpace (const device::IdxArray< NDim > & input)
device::Idx stride (size_t dim) const
Mostly needed for debugging purposes, gets the stride in memory for a shift of 1 in the given dimension, with transposition taken into account. The difference to the memorySizes or localSizes is that this takes the padding into account.

Detailed Description

Also, this class manages the sizes in memory!

Unit test: ctest -R test-layoutstructlocaltransposed

Public Static Attributes Documentation

variable NDim

constexpr size_t TempLat::LayoutStructLocalTransposed< _NDim >::NDim;

Public Functions Documentation

function LayoutStructLocalTransposed

inline TempLat::LayoutStructLocalTransposed::LayoutStructLocalTransposed (
    const device::IdxArray< NDim > & initNGrid,
    const device::Idx nGhosts
) 

function getGlobal [1/2]

inline DEVICE_INLINE_FUNCTION LayoutStructGlobal < NDim > & TempLat::LayoutStructLocalTransposed::getGlobal () 

function getGlobal [2/2]

inline DEVICE_INLINE_FUNCTION const LayoutStructGlobal < NDim > & TempLat::LayoutStructLocalTransposed::getGlobal () const

function getLocal [1/2]

inline DEVICE_INLINE_FUNCTION LayoutStructLocal < NDim > & TempLat::LayoutStructLocalTransposed::getLocal () 

function getLocal [2/2]

inline DEVICE_INLINE_FUNCTION const LayoutStructLocal < NDim > & TempLat::LayoutStructLocalTransposed::getLocal () const

function getMemoryIndexFromSpatialLocation

With transposition, go from spatial coordinate value at spatial dimension to actual memory index in memoryDimension.

inline DEVICE_INLINE_FUNCTION CoordinateMapping TempLat::LayoutStructLocalTransposed::getMemoryIndexFromSpatialLocation (
    device::Idx position,
    device::Idx spatialDimension
) const


function getOrigin

Get the actual memory index of the origin (WITH PADDING)

inline device::Idx TempLat::LayoutStructLocalTransposed::getOrigin () const

Returns:

device::Idx giving the (linear) memory index of the origin.


function getPadding

inline device::array< device::IdxArray< 2 >, NDim > TempLat::LayoutStructLocalTransposed::getPadding () const

function getSizesInMemory

Return the sizes in memory, i.e. with transposition applied. This does NOT include padding, but only fixes the transposition.

inline DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & TempLat::LayoutStructLocalTransposed::getSizesInMemory () const

Returns:

const ref to device::IdxArray<NDim> with the sizes.


function getSpatialLocationFromMemoryIndex

With transposition, go from actual memory index in memoryDimension to spatial coordinate value at spatial dimension.

inline DEVICE_INLINE_FUNCTION CoordinateMapping TempLat::LayoutStructLocalTransposed::getSpatialLocationFromMemoryIndex (
    device::Idx index,
    device::Idx memoryDimension
) const


function getTranspositionMap_memoryToGlobalSpace

inline DEVICE_INLINE_FUNCTION const TranspositionMap < NDim > & TempLat::LayoutStructLocalTransposed::getTranspositionMap_memoryToGlobalSpace () const

function isTransposed

inline DEVICE_INLINE_FUNCTION bool TempLat::LayoutStructLocalTransposed::isTransposed () const

function setLocalSizes

inline void TempLat::LayoutStructLocalTransposed::setLocalSizes (
    const device::IdxArray< NDim > & input
) 

function setNGhosts

inline void TempLat::LayoutStructLocalTransposed::setNGhosts (
    device::Idx nGhosts
) 

function setTranspositionMap_memoryToGlobalSpace

inline void TempLat::LayoutStructLocalTransposed::setTranspositionMap_memoryToGlobalSpace (
    const device::IdxArray< NDim > & input
) 

function stride

Mostly needed for debugging purposes, gets the stride in memory for a shift of 1 in the given dimension, with transposition taken into account. The difference to the memorySizes or localSizes is that this takes the padding into account.

inline device::Idx TempLat::LayoutStructLocalTransposed::stride (
    size_t dim
) const

Parameters:

  • dim the dimension for which to compute the stride.

Returns:

device::Idx stride in memory for the given dimension.


Friends Documentation

friend operator<<

inline std::ostream & TempLat::LayoutStructLocalTransposed::operator<< (
    std::ostream & ostream,
    const LayoutStructLocalTransposed & ls
) 

friend operator==

template<size_t d2>
inline bool TempLat::LayoutStructLocalTransposed::operator== (
    const LayoutStructLocalTransposed < NDim > & a,
    const LayoutStructLocalTransposed < d2 > & b
) 


The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/memory/memorylayouts/layoutstructlocaltransposed.h