MAIA bb96820c
Multiphysics at AIA
|
Helper functions useful for allocating collector memory.
Namespaces | |
namespace | unaligned_cell_wise |
Functions | |
template<class T , class U > | |
U * | align (U *p) |
Aligns pointer p such that a T stored at its adress is aligned. More... | |
template<class T > | |
void | rowMajor1D (T *&p, void *&base, const MInt cellId, const MInt Nrows, const MInt maxNoCells) |
Stores 1D variables in row-major order. More... | |
template<class T > | |
ATTRIBUTES1 (ATTRIBUTE_NO_AUTOVEC) inline void rowMajor2D(T **&p | |
Stores 2D variables in row-major order. More... | |
for (MInt i=0;i< Nrows;++i) | |
template<class T > | |
void | copyElements1D (T *to, T *from, const MInt Nrows) |
Copies 1D cell elements. More... | |
template<class T > | |
void | copyElements2D (T *to, T *from, const MInt Nrows, const MInt Ncols) |
Copies 2D cell elements. More... | |
Variables | |
void *& | base = align<T>(base) |
void const MInt | cellId |
void const MInt const MInt | Nrows |
void const MInt const MInt const MInt | Ncols |
void const MInt const MInt const MInt const MInt | maxNoCells |
|
inline |
[in] | p | Pointer to align such that a T stored there is aligned |
[out] | p_aligned | Aligned pointer >= p that can store an aligned T |
Definition at line 187 of file collector.h.
maia::collector_memory::ATTRIBUTES1 | ( | ATTRIBUTE_NO_AUTOVEC | ) | & |
In memory, an array of pointers is stored first. The variables itself are allocated behind it. | ptr_0, ..., ptr_(maxNoCells*Nrows) | var_(0,0), ..., var_(maxNoCells*Nrows,maxNoCells*Ncols) | ^^^^^^ base point here
The array of pointers provides 2D access and is stored as follows: ... | ptr_to_cell_(cellId)_v(0,0), ptr_to_cell_(cellId)_v(1,0), ..., ptr_to_cell_(cellId)_v(Nrows,0) | ptr_to_cell_(cellId+1)_v(0,0), ... | ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ p is set to point here!
The variables are stored as follows: ...| cell_(cellId)_v(0,0), cell_(cellId)_v(0,1), ..., cell_(cellId)_v(1,0), cell_(cellId)_v(1,1), ..., .... cell_(cellId)_v(Nrows,Ncols) | cell_(cellId+1)_v(0,0), ..., | ... ^^^^^^^^^^^^^^^^^^^^^ ptr_to_cell_(cellId)_v(0,0) ^^^^^^^^^^^^^ ptr_to_cell_(cellId)_v(1,0) points here!
[out] | p | Is set to point to the first pointer of the cell variables. |
[in,out] | base | Pointer to the start of the variable's memory region. |
[in] | cellId | Id of the cell. |
[in] | Nrows | Number of variables to store per cell. |
[in] | maxNoCells | Maximum number of cells to be allocated (used for offset computation). |
|
inline |
[in] | to | Elements will be copied here. |
[in] | from | Elements to be copied. |
[in] | Nrows | Number of elements to copy |
Definition at line 258 of file collector.h.
|
inline |
Nrows*Ncols elements will be copied.
[in] | to | Elements will be copied here. |
[in] | from | Elements to be copied. |
[in] | Nrows | Number of rows |
[in] | Ncols | Number of columns |
Definition at line 273 of file collector.h.
maia::collector_memory::for | ( | ) |
|
inline |
I.e. the variables are stored in memory as follows: cell_(0)_v(0) ... cell_(0)_v(Nrows) | ... | cell_(cellId)_v(0), cell_(cellId)_v(1), ..., cell_(cellId)_v(Nrows) | cell_(cellId+1)_v(0), ..., | ... ^^^^^^^^^^^^^ base points here! ^^^^^^^^^^^^^^^^^^^ p is set to point here
[out] | p | Is set to point to the first cell variable. |
[in,out] | base | Pointer to the start of the variable's memory region. |
[in] | cellId | Id of the cell. |
[in] | Nrows | Number of variables to store per cell. |
[in] | maxNoCells | Maximum number of cells to be allocated (used for offset computation). |
Definition at line 210 of file collector.h.
maia::collector_memory::base = align<T>(base) |
Definition at line 239 of file collector.h.
void const MInt maia::collector_memory::cellId |
Definition at line 239 of file collector.h.
Definition at line 240 of file collector.h.
Definition at line 239 of file collector.h.
Definition at line 239 of file collector.h.