Skip to content

Struct TempLat::CheckerboardLayout

template <size_t NDim>

ClassList > TempLat > CheckerboardLayout

Wraps a LayoutStruct to iterate over only even or odd parity lattice sites.More...

  • #include <checkerboardlayout.h>

Public Functions

Type Name
CheckerboardLayout (const LayoutStruct< NDim > & layout, Parity parity)
DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & getStarts () const
DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & getStops () const
DEVICE_INLINE_FUNCTION bool isInBounds (const device::IdxArray< NDim > & fullIdx) const
Check whether a reconstructed full index is within bounds. Out-of-bounds occurs at most once per row when the local size along the split dimension is odd.
DEVICE_INLINE_FUNCTION device::IdxArray< NDim > reconstruct (const device::IdxArray< NDim > & halfIdx) const
Reconstruct the full memory index from a half-index.

Detailed Description

Halves the last memory dimension (NDim-1) and provides a reconstruction formula that maps half-indices back to full memory indices matching the requested parity.

Usage: pass to device::iteration::foreach or device::iteration::reduce. The functor receives fully reconstructed full-lattice indices.

Unit test: ctest -R test-checkerboardlayout

Public Functions Documentation

function CheckerboardLayout

inline TempLat::CheckerboardLayout::CheckerboardLayout (
    const LayoutStruct < NDim > & layout,
    Parity parity
) 

function getStarts

inline DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & TempLat::CheckerboardLayout::getStarts () const

function getStops

inline DEVICE_INLINE_FUNCTION const device::IdxArray< NDim > & TempLat::CheckerboardLayout::getStops () const

function isInBounds

Check whether a reconstructed full index is within bounds. Out-of-bounds occurs at most once per row when the local size along the split dimension is odd.

inline DEVICE_INLINE_FUNCTION bool TempLat::CheckerboardLayout::isInBounds (
    const device::IdxArray< NDim > & fullIdx
) const


function reconstruct

Reconstruct the full memory index from a half-index.

inline DEVICE_INLINE_FUNCTION device::IdxArray< NDim > TempLat::CheckerboardLayout::reconstruct (
    const device::IdxArray< NDim > & halfIdx
) const



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