![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
Macros for iterating through densemats. More...
#include "ghost/omp.h"
Go to the source code of this file.
Macros | |
#define | DENSEMAT_DT char |
#define | DENSEMAT_ELSIZE(vec) vec->elSize |
#define | DENSEMAT_COMPACT(vec) (!(vec->traits.flags & GHOST_DENSEMAT_SCATTERED)) |
#define | DENSEMAT_COMPACT_ROWS(vec) (!(vec->traits.flags & GHOST_DENSEMAT_SCATTERED_ROWS)) |
#define | DENSEMAT_SCATTERED_COLS(vec) ((vec->traits.flags & GHOST_DENSEMAT_SCATTERED_COLS)) |
#define | DENSEMAT_SINGLECOL_STRIDE1(vec) (vec->traits.ncols == 1 && ((vec->traits.storage == GHOST_DENSEMAT_COLMAJOR) || ((vec->traits.storage == GHOST_DENSEMAT_ROWMAJOR) && (vec->stride == 1)))) |
#define | DENSEMAT_ITER(vec, call) |
Iterate over a densemats and execute a statement for each entry. More... | |
#define | DENSEMAT_ITER_INIT(vec, call) |
Iterate over a densemats and execute a statement for each entry. More... | |
#define | DENSEMAT_ITER2(vec1, vec2, call) DENSEMAT_ITER2_OFFS(vec1,vec2,0,0,call) |
#define | DENSEMAT_ITER2_OFFS(vec1, vec2, vec2roffs, vec2coffs, call) |
Iterate over two densemats synchronously and execute a statement for each entry. An offset may be given for the second input densemat. More... | |
#define | DENSEMAT_ITER2_COMPACT_OFFS_TRANSPOSED(vec1, vec2, vec2roffs, vec2coffs, call) |
Iterate over two densemats synchronously and execute a statement for each entry. The second densemat is stored transposed (compared to the first). An offset may be given for the second input densemat. More... | |
#define | DENSEMAT_ITER_BEGIN_COMPACT_SINGLECOL(vec, valptr, row, col, memrow, memcol) |
#define | DENSEMAT_ITER_COMPACT_SINGLECOL_PAD(vec, valptr, row, col, memrow, memcol) |
#define | DENSEMAT_ITER_BEGIN_COMPACT(vec, valptr, row, col, memrow, memcol) |
#define | DENSEMAT_ITER_COMPACT_PAD(vec, valptr, row, col, memrow, memcol) |
#define | DENSEMAT_ITER_END() |
#define | DENSEMAT_ITER2_BEGIN_COMPACT(vec1, vec2, row, col, memrow1, memrow2, memcol1, memcol2) DENSEMAT_ITER2_BEGIN_COMPACT_OFFS(vec1,vec2,row,col,memrow1,memrow2,memcol1,memcol2,0,0) |
#define | DENSEMAT_ITER2_BEGIN_COMPACT_OFFS(vec1, vec2, valptr1, valptr2, row, col, memrow1, memrow2, memcol1, memcol2, vec2roffs, vec2coffs) |
#define | DENSEMAT_ITER2_BEGIN_COMPACT_OFFS_SINGLECOL(vec1, vec2, valptr1, valptr2, row, col, memrow1, memrow2, memcol1, memcol2, vec2roffs, vec2coffs) |
#define | DENSEMAT_ITER2_BEGIN_COMPACT_OFFS_TRANSPOSED(vec1, vec2, row, col, memrow1, memrow2, memcol1, memcol2, vec2roffs, vec2coffs) |
#define | DENSEMAT_ITER2_BEGIN_SCATTEREDCOLS_COMPACTROWS1_OFFS(vec1, vec2, row, col, memrow1, memrow2, memcol1, memcol2, vec2roffs, vec2coffs) |
Macros for iterating through densemats.
#define DENSEMAT_COMPACT | ( | vec | ) | (!(vec->traits.flags & GHOST_DENSEMAT_SCATTERED)) |
#define DENSEMAT_COMPACT_ROWS | ( | vec | ) | (!(vec->traits.flags & GHOST_DENSEMAT_SCATTERED_ROWS)) |
#define DENSEMAT_DT char |
#define DENSEMAT_ELSIZE | ( | vec | ) | vec->elSize |
#define DENSEMAT_ITER | ( | vec, | |
call | |||
) |
Iterate over a densemats and execute a statement for each entry.
This macro sets the following variables: row,col,memrow,memcol,valptr
vec | The densemat. |
call | The statement to call for each entry. |
#define DENSEMAT_ITER2 | ( | vec1, | |
vec2, | |||
call | |||
) | DENSEMAT_ITER2_OFFS(vec1,vec2,0,0,call) |
#define DENSEMAT_ITER2_BEGIN_COMPACT | ( | vec1, | |
vec2, | |||
row, | |||
col, | |||
memrow1, | |||
memrow2, | |||
memcol1, | |||
memcol2 | |||
) | DENSEMAT_ITER2_BEGIN_COMPACT_OFFS(vec1,vec2,row,col,memrow1,memrow2,memcol1,memcol2,0,0) |
#define DENSEMAT_ITER2_BEGIN_COMPACT_OFFS | ( | vec1, | |
vec2, | |||
valptr1, | |||
valptr2, | |||
row, | |||
col, | |||
memrow1, | |||
memrow2, | |||
memcol1, | |||
memcol2, | |||
vec2roffs, | |||
vec2coffs | |||
) |
#define DENSEMAT_ITER2_BEGIN_COMPACT_OFFS_SINGLECOL | ( | vec1, | |
vec2, | |||
valptr1, | |||
valptr2, | |||
row, | |||
col, | |||
memrow1, | |||
memrow2, | |||
memcol1, | |||
memcol2, | |||
vec2roffs, | |||
vec2coffs | |||
) |
#define DENSEMAT_ITER2_BEGIN_COMPACT_OFFS_TRANSPOSED | ( | vec1, | |
vec2, | |||
row, | |||
col, | |||
memrow1, | |||
memrow2, | |||
memcol1, | |||
memcol2, | |||
vec2roffs, | |||
vec2coffs | |||
) |
#define DENSEMAT_ITER2_BEGIN_SCATTEREDCOLS_COMPACTROWS1_OFFS | ( | vec1, | |
vec2, | |||
row, | |||
col, | |||
memrow1, | |||
memrow2, | |||
memcol1, | |||
memcol2, | |||
vec2roffs, | |||
vec2coffs | |||
) |
#define DENSEMAT_ITER2_COMPACT_OFFS_TRANSPOSED | ( | vec1, | |
vec2, | |||
vec2roffs, | |||
vec2coffs, | |||
call | |||
) |
Iterate over two densemats synchronously and execute a statement for each entry. The second densemat is stored transposed (compared to the first). An offset may be given for the second input densemat.
This macro sets the following variables: row,col,memrow1,memcol1,memrow2,memcol2
vec1 | The first densemat |
vec2 | The second densemat |
vec2roffs | The row offset to the second densemat. |
vec2coffs | The col offset to the second densemat. |
call | The statement to call for each entry. |
#define DENSEMAT_ITER2_OFFS | ( | vec1, | |
vec2, | |||
vec2roffs, | |||
vec2coffs, | |||
call | |||
) |
Iterate over two densemats synchronously and execute a statement for each entry. An offset may be given for the second input densemat.
This macro sets the following variables: row,col,memrow1,memcol1,memrow2,memcol2,valptr1,valptr2
vec1 | The first densemat |
vec2 | The second densemat |
vec2roffs | The row offset to the second densemat. |
vec2coffs | The col offset to the second densemat. |
call | The statement to call for each entry. |
#define DENSEMAT_ITER_BEGIN_COMPACT | ( | vec, | |
valptr, | |||
row, | |||
col, | |||
memrow, | |||
memcol | |||
) |
#define DENSEMAT_ITER_BEGIN_COMPACT_SINGLECOL | ( | vec, | |
valptr, | |||
row, | |||
col, | |||
memrow, | |||
memcol | |||
) |
#define DENSEMAT_ITER_COMPACT_PAD | ( | vec, | |
valptr, | |||
row, | |||
col, | |||
memrow, | |||
memcol | |||
) |
#define DENSEMAT_ITER_COMPACT_SINGLECOL_PAD | ( | vec, | |
valptr, | |||
row, | |||
col, | |||
memrow, | |||
memcol | |||
) |
#define DENSEMAT_ITER_END | ( | ) |
#define DENSEMAT_ITER_INIT | ( | vec, | |
call | |||
) |
Iterate over a densemats and execute a statement for each entry.
This macro sets the following variables: row,col,memrow,memcol,valptr In addition to DENSEMAT_ITER, this macro intializes padding to zero
vec | The densemat. |
call | The statement to call for each entry. |
#define DENSEMAT_SCATTERED_COLS | ( | vec | ) | ((vec->traits.flags & GHOST_DENSEMAT_SCATTERED_COLS)) |
#define DENSEMAT_SINGLECOL_STRIDE1 | ( | vec | ) | (vec->traits.ncols == 1 && ((vec->traits.storage == GHOST_DENSEMAT_COLMAJOR) || ((vec->traits.storage == GHOST_DENSEMAT_ROWMAJOR) && (vec->stride == 1)))) |