LAMA
|
This class provides routines to converse ELL storage data to CSR storage data and vice versa. More...
#include <CUDAELLUtils.hpp>
Static Public Member Functions | |
static IndexType | ellindex (const IndexType i, const IndexType jj, const IndexType numRows) |
Addressing function for the arrays ia and ja: column-wise. | |
static IndexType | countNonEmptyRowsBySizes (const IndexType sizes[], const IndexType numRows) |
This method computes the total number of non-zero rows by the size array. | |
static bool | hasDiagonalProperty (const IndexType numDiagonals, const IndexType ellJA[]) |
check diagonal property. | |
static void | setNonEmptyRowsBySizes (IndexType rowIndexes[], const IndexType numNonEmptyRows, const IndexType sizes[], const IndexType numRows) |
Build a vector of indexes for non-empty rows. | |
static void | check (const IndexType mNumRows, const IndexType mNumValuesPerRow, const IndexType mNumColumns, const IndexType *ia, const IndexType *ja, const char *msg) |
template<typename ValueType , typename OtherValueType > | |
static void | getRow (OtherValueType *row, const IndexType i, const IndexType numRows, const IndexType numColumns, const IndexType *ia, const IndexType *ja, const ValueType *values) |
Returns one row of the matrix. | |
template<typename ValueType , typename OtherValueType > | |
static OtherValueType | getValue (const IndexType i, const IndexType j, const IndexType numRows, const IndexType *ia, const IndexType *ja, const ValueType *values) |
Returns one value of the matrix. | |
template<typename ValueType , typename OtherValueType > | |
static void | scaleValue (const IndexType numRows, const IndexType Ia[], ValueType mValues[], const OtherValueType values[]) |
Scales matrix using an vector. | |
template<typename ELLValueType , typename CSRValueType > | |
static void | getCSRValues (IndexType csrJA[], CSRValueType csrValues[], const IndexType csrIA[], const IndexType numRows, const IndexType ellSizes[], const IndexType ellJA[], const ELLValueType ellValues[]) |
Implementation for ELLUtilsInterface::Conversions::getCSRValues. | |
template<typename ELLValueType , typename CSRValueType > | |
static void | setCSRValues (IndexType ellJA[], ELLValueType ellValues[], const IndexType ellSizes[], const IndexType numRows, const IndexType numValuesPerRow, const IndexType csrIA[], const IndexType csrJA[], const CSRValueType csrValues[]) |
Helper routine for conversion CSR to ELL format. | |
template<typename ValueType > | |
static void | normalGEMV (ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType numNonZerosPerRows, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
Implementation for CSRUtilsInterface::Mult::normalGEMV. | |
template<typename ValueType > | |
static void | sparseGEMV (ValueType result[], const IndexType numRows, const IndexType numNonZerosPerRows, const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
Implementation for CSRUtilsInterface::Mult::sparseGEMV. | |
template<typename ValueType > | |
static void | jacobi (ValueType solution[], const IndexType numRows, const IndexType ellNumValuesPerRow, const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const ValueType oldSolution[], const ValueType rhs[], const ValueType omega, class SyncToken *syncToken) |
Implementation for ELLUtilsInterface::Solver::jacobi. | |
template<typename ValueType > | |
static void | jacobiHalo (ValueType solution[], const IndexType numRows, const ValueType diagonal[], const IndexType ellNumValuesPerRow, const IndexType ellSizes[], const IndexType ellJA[], const ValueType ellValues[], const IndexType rowIndexes[], const IndexType numNonEmptyRows, const ValueType oldSolution[], const ValueType omega, class SyncToken *syncToken) |
Implementation for ELLUtilsInterface::Solver::jacobiHalo. | |
static void | setInterface (struct ELLUtilsInterface &ELLUtils) |
Routine that registers all routines of this class at the LAMA interface. | |
Private Member Functions | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) |
This class provides routines to converse ELL storage data to CSR storage data and vice versa.
All routines work on already allocated data and utilize CUDA for their parallelization.
static void lama::CUDAELLUtils::check | ( | const IndexType | mNumRows, |
const IndexType | mNumValuesPerRow, | ||
const IndexType | mNumColumns, | ||
const IndexType * | ia, | ||
const IndexType * | ja, | ||
const char * | msg | ||
) | [static] |
static IndexType lama::CUDAELLUtils::countNonEmptyRowsBySizes | ( | const IndexType | sizes[], |
const IndexType | numRows | ||
) | [static] |
This method computes the total number of non-zero rows by the size array.
static IndexType lama::CUDAELLUtils::ellindex | ( | const IndexType | i, |
const IndexType | jj, | ||
const IndexType | numRows | ||
) | [inline, static] |
Addressing function for the arrays ia and ja: column-wise.
static void lama::CUDAELLUtils::getCSRValues | ( | IndexType | csrJA[], |
CSRValueType | csrValues[], | ||
const IndexType | csrIA[], | ||
const IndexType | numRows, | ||
const IndexType | ellSizes[], | ||
const IndexType | ellJA[], | ||
const ELLValueType | ellValues[] | ||
) | [static] |
Implementation for ELLUtilsInterface::Conversions::getCSRValues.
static void lama::CUDAELLUtils::getRow | ( | OtherValueType * | row, |
const IndexType | i, | ||
const IndexType | numRows, | ||
const IndexType | numColumns, | ||
const IndexType * | ia, | ||
const IndexType * | ja, | ||
const ValueType * | values | ||
) | [static] |
Returns one row of the matrix.
static OtherValueType lama::CUDAELLUtils::getValue | ( | const IndexType | i, |
const IndexType | j, | ||
const IndexType | numRows, | ||
const IndexType * | ia, | ||
const IndexType * | ja, | ||
const ValueType * | values | ||
) | [static] |
Returns one value of the matrix.
static bool lama::CUDAELLUtils::hasDiagonalProperty | ( | const IndexType | numDiagonals, |
const IndexType | ellJA[] | ||
) | [static] |
check diagonal property.
ELL format with diagonal property: diagonal is just the first column in mValues
static void lama::CUDAELLUtils::jacobi | ( | ValueType | solution[], |
const IndexType | numRows, | ||
const IndexType | ellNumValuesPerRow, | ||
const IndexType | ellSizes[], | ||
const IndexType | ellJA[], | ||
const ValueType | ellValues[], | ||
const ValueType | oldSolution[], | ||
const ValueType | rhs[], | ||
const ValueType | omega, | ||
class SyncToken * | syncToken | ||
) | [static] |
Implementation for ELLUtilsInterface::Solver::jacobi.
static void lama::CUDAELLUtils::jacobiHalo | ( | ValueType | solution[], |
const IndexType | numRows, | ||
const ValueType | diagonal[], | ||
const IndexType | ellNumValuesPerRow, | ||
const IndexType | ellSizes[], | ||
const IndexType | ellJA[], | ||
const ValueType | ellValues[], | ||
const IndexType | rowIndexes[], | ||
const IndexType | numNonEmptyRows, | ||
const ValueType | oldSolution[], | ||
const ValueType | omega, | ||
class SyncToken * | syncToken | ||
) | [static] |
Implementation for ELLUtilsInterface::Solver::jacobiHalo.
lama::CUDAELLUtils::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [private] |
static void lama::CUDAELLUtils::normalGEMV | ( | ValueType | result[], |
const ValueType | alpha, | ||
const ValueType | x[], | ||
const ValueType | beta, | ||
const ValueType | y[], | ||
const IndexType | numRows, | ||
const IndexType | numNonZerosPerRows, | ||
const IndexType | csrIA[], | ||
const IndexType | csrJA[], | ||
const ValueType | csrValues[], | ||
class SyncToken * | syncToken | ||
) | [static] |
Implementation for CSRUtilsInterface::Mult::normalGEMV.
static void lama::CUDAELLUtils::scaleValue | ( | const IndexType | numRows, |
const IndexType | Ia[], | ||
ValueType | mValues[], | ||
const OtherValueType | values[] | ||
) | [static] |
Scales matrix using an vector.
static void lama::CUDAELLUtils::setCSRValues | ( | IndexType | ellJA[], |
ELLValueType | ellValues[], | ||
const IndexType | ellSizes[], | ||
const IndexType | numRows, | ||
const IndexType | numValuesPerRow, | ||
const IndexType | csrIA[], | ||
const IndexType | csrJA[], | ||
const CSRValueType | csrValues[] | ||
) | [static] |
Helper routine for conversion CSR to ELL format.
static void lama::CUDAELLUtils::setInterface | ( | struct ELLUtilsInterface & | ELLUtils | ) | [static] |
Routine that registers all routines of this class at the LAMA interface.
Referenced by lama::CUDAInterface::CUDAInterface().
static void lama::CUDAELLUtils::setNonEmptyRowsBySizes | ( | IndexType | rowIndexes[], |
const IndexType | numNonEmptyRows, | ||
const IndexType | sizes[], | ||
const IndexType | numRows | ||
) | [static] |
Build a vector of indexes for non-empty rows.
static void lama::CUDAELLUtils::sparseGEMV | ( | ValueType | result[], |
const IndexType | numRows, | ||
const IndexType | numNonZerosPerRows, | ||
const ValueType | alpha, | ||
const ValueType | x[], | ||
const IndexType | numNonZeroRows, | ||
const IndexType | rowIndexes[], | ||
const IndexType | csrIA[], | ||
const IndexType | csrJA[], | ||
const ValueType | csrValues[], | ||
class SyncToken * | syncToken | ||
) | [static] |
Implementation for CSRUtilsInterface::Mult::sparseGEMV.