Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
More...
|
std::string | getCublasErrorMessage (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| getCublasErrorMessage generates the error message to display for a given error.
|
|
void | cublasSafeCall (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cublasSafeCall checks the return type of the CUBLAS expression (function call) and throws an exception if it does not equal CUBLAS_STATUS_SUCCESS.
|
|
cublasStatus_t | cublasWarnIfError (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cublasWarnIfError checks the return type of the CUBLAS expression (function call) and issues a warning if it does not equal CUBLAS_STATUS_SUCCESS.
|
|
cublasStatus_t | cublasScal (cublasHandle_t handle, int n, const double *alpha, double *x, int incx) |
|
cublasStatus_t | cublasScal (cublasHandle_t handle, int n, const float *alpha, float *x, int incx) |
|
cublasStatus_t | cublasScal (cublasHandle_t handle, int n, const int *alpha, int *x, int incx) |
|
cublasStatus_t | cublasAxpy (cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy) |
|
cublasStatus_t | cublasAxpy (cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy) |
|
cublasStatus_t | cublasAxpy (cublasHandle_t handle, int n, const int *alpha, const int *x, int incx, int *y, int incy) |
|
cublasStatus_t | cublasDot (cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result) |
|
cublasStatus_t | cublasDot (cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result) |
|
cublasStatus_t | cublasDot (cublasHandle_t handle, int n, const int *x, int incx, const int *y, int incy, int *result) |
|
cublasStatus_t | cublasNrm2 (cublasHandle_t handle, int n, const double *x, int incx, double *result) |
|
cublasStatus_t | cublasNrm2 (cublasHandle_t handle, int n, const float *x, int incx, float *result) |
|
cublasStatus_t | cublasNrm2 (cublasHandle_t handle, int n, const int *x, int incx, int *result) |
|
std::string | getCudaErrorMessage (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| getCudaErrorMessage generates the error message to display for a given error.
|
|
void | cudaSafeCall (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cudaSafeCall checks the return type of the CUDA expression (function call) and throws an exception if it does not equal cudaSuccess.
|
|
cudaError_t | cudaWarnIfError (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cudaWarnIfError checks the return type of the CUDA expression (function call) and issues a warning if it does not equal cudaSuccess.
|
|
CuSparseMatrixDescriptionPtr | createMatrixDescription () |
| createMatrixDescription creates a default matrix description
|
|
CuSparseMatrixDescriptionPtr | createLowerDiagonalDescription () |
| createLowerDiagonalDescription creates a lower diagonal matrix description
|
|
CuSparseMatrixDescriptionPtr | createUpperDiagonalDescription () |
| createUpperDiagonalDescription creates an upper diagonal matrix description
|
|
template<class T , int blocksize> |
void | invertDiagonalAndFlatten (T *mat, int *rowIndices, int *colIndices, size_t numberOfRows, T *vec) |
| This function receives a matrix, and the inverse of the matrix containing only its diagonal is stored in d_vec.
|
|
template<class T , int blocksize> |
void | computeLowerSolveLevelSet (T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, const T *d, T *v) |
| Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.
|
|
template<class T , int blocksize> |
void | computeUpperSolveLevelSet (T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, T *v) |
| Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.
|
|
template<class T , int blocksize> |
void | computeDiluDiagonal (T *reorderedMat, int *rowIndices, int *colIndices, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, T *dInv) |
| Computes the ILU0 of the diagonal elements of the reordered matrix and stores it in a reordered vector containing the diagonal blocks.
|
|
template<class T , int blocksize> |
void | copyMatDataToReordered (T *srcMatrix, int *srcRowIndices, T *dstMatrix, int *dstRowIndices, int *naturalToReordered, size_t numberOfRows) |
| Reorders the elements of a matrix by copying them from one matrix to another using a permutation list.
|
|
std::string | getCusparseErrorCodeToString (int code) |
| getCusparseErrorCodeToString Converts an error code returned from a cusparse function a human readable string.
|
|
std::string | getCusparseErrorMessage (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| getCusparseErrorMessage generates the error message to display for a given error.
|
|
void | cusparseSafeCall (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cusparseSafeCall checks the return type of the CUSPARSE expression (function call) and throws an exception if it does not equal CUSPARSE_STATUS_SUCCESS.
|
|
cusparseStatus_t | cusparseWarnIfError (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber) |
| cusparseWarnIfError checks the return type of the CUSPARSE expression (function call) and issues a warning if it does not equal CUSPARSE_STATUS_SUCCESS.
|
|
cusparseStatus_t | cusparseBsrilu02_analysis (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrsv2_analysis (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrsv2_analysis (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrilu02_analysis (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrsv2_solve (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const double *alpha, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double *f, double *x, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrsv2_solve (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const float *alpha, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float *f, float *x, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrilu02_bufferSize (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, int *pBufferSizeInBytes) |
|
cusparseStatus_t | cusparseBsrilu02_bufferSize (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, int *pBufferSizeInBytes) |
|
cusparseStatus_t | cusparseBsrsv2_bufferSize (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes) |
|
cusparseStatus_t | cusparseBsrsv2_bufferSize (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes) |
|
cusparseStatus_t | cusparseBsrilu02 (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrilu02 (cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer) |
|
cusparseStatus_t | cusparseBsrmv (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nb, int nnzb, const double *alpha, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const double *x, const double *beta, double *y) |
|
cusparseStatus_t | cusparseBsrmv (cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nb, int nnzb, const float *alpha, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const float *x, const float *beta, float *y) |
|
template<class Matrix > |
const Matrix | makeMatrixWithNonzeroDiagonal (const Matrix &matrix, const typename Matrix::field_type replacementValue=std::numeric_limits< typename Matrix::field_type >::epsilon()) |
| makeMatrixWithNonzeroDiagonal creates a new matrix with the zero diagonal elements (when viewed as a matrix of scalrars) set to replacementValue
|
|
template<class PreconditionerType > |
constexpr bool | shouldCallPreconditionerPre () |
| Tests (compile time) if the preconditioner type needs to call pre() before a call to apply()
|
|
template<class PreconditionerType > |
constexpr bool | shouldCallPreconditionerPost () |
| Tests (compile time) if the preconditioner type needs to call post() after a call to apply(...)
|
|
int | to_int (std::size_t s) |
| to_int converts a (on most relevant platforms) 64 bits unsigned size_t to a signed 32 bits signed int
|
|
std::size_t | to_size_t (int i) |
| to_size_t converts a (on most relevant platforms) a 32 bit signed int to a 64 bits unsigned int
|
|
template<class T > |
void | setVectorValue (T *deviceData, size_t numberOfElements, const T &value) |
| setVectorValue sets every element of deviceData to value
|
|
template<class T > |
void | setZeroAtIndexSet (T *deviceData, size_t numberOfElements, const int *indices) |
| setZeroAtIndexSet sets deviceData to zero in the indices of contained in indices
|
|
template<class T > |
T | innerProductAtIndices (const T *deviceA, const T *deviceB, T *buffer, size_t numberOfElements, const int *indices) |
| innerProductAtIndices computes the inner product between deviceA[indices] and deviceB[indices]
|
|
template<class T > |
void | weightedDiagMV (const T *squareBlockVector, const size_t numberOfRows, const size_t blocksize, T relaxationFactor, const T *srcVec, T *dstVec) |
| Compue the weighted matrix vector product where the matrix is diagonal, the diagonal is a vector, meaning we compute the Hadamard product.
|
|
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Provides various utilities for doing signed to unsigned conversion, unsigned to signed, 32 bits to 64 bits and 64 bits to 32 bits.
Simple utility structs to test for the existence of functions in types.
Contains wrappers to make the CuSPARSE library behave as a modern C++ library with function overlading.
In simple terms, this allows one to call say cublasScal on both double and single precisision, instead of calling cublasDscal and cublasSscal respectively.
In simple terms, this allows one to call say cusparseBsrilu02_analysis on both double and single precisision, instead of calling cusparseDbsrilu02_analysis and cusparseDbsrilu02_analysis respectively.
Note that there are alternatives to this, see for instance https://stackoverflow.com/questions/257288/templated-check-for-the-existence-of-a-class-member-function , however, this is by far the cleanest approach for where this is going to be used for now.
TODO: Use the requires-keyword once C++20 becomes availble (https://en.cppreference.com/w/cpp/language/constraints ). With C++20 this file can be removed.
The main use case within cuistl is that the cusparse library requires signed int for all its size parameters, while Dune::BlockVector (and relatives) use unsigned size_t.