|
|
matrix_type * | operator-> () |
|
const matrix_type * | operator-> () const |
| | GpuSparseMatrixWrapper (const T *nonZeroElements, const int *rowIndices, const int *columnIndices, std::size_t numberOfNonzeroBlocks, std::size_t blockSize, std::size_t numberOfRows) |
| | Create the sparse matrix specified by the raw data.
|
| | GpuSparseMatrixWrapper (const GpuVector< int > &rowIndices, const GpuVector< int > &columnIndices, std::size_t blockSize) |
| | Create a sparse matrix by copying the sparsity structure of another matrix, not filling in the values.
|
|
| GpuSparseMatrixWrapper (const GpuSparseMatrixWrapper &other) |
|
GpuSparseMatrixWrapper & | operator= (const GpuSparseMatrixWrapper &)=delete |
|
const matrix_type & | get () const |
|
template<class M = matrix_type, typename = std::enable_if_t<std::is_same_v<M, GpuSparseMatrix<T>>>> |
| void | setUpperTriangular () |
|
template<class M = matrix_type, typename = std::enable_if_t<std::is_same_v<M, GpuSparseMatrix<T>>>> |
| void | setLowerTriangular () |
| | setLowerTriangular sets the CuSparse flag that this is an lower diagonal (with non-unit diagonal) matrix.
|
|
template<class M = matrix_type, typename = std::enable_if_t<std::is_same_v<M, GpuSparseMatrix<T>>>> |
| void | setUnitDiagonal () |
| | setUnitDiagonal sets the CuSparse flag that this has unit diagional.
|
|
template<class M = matrix_type, typename = std::enable_if_t<std::is_same_v<M, GpuSparseMatrix<T>>>> |
| void | setNonUnitDiagonal () |
| | setNonUnitDiagonal sets the CuSparse flag that this has non-unit diagional.
|
|
std::size_t | N () const |
| | N returns the number of rows (which is equal to the number of columns).
|
| std::size_t | nonzeroes () const |
| | nonzeroes behaves as the Dune::BCRSMatrix::nonzeros() function and returns the number of non zero blocks
|
| GpuVector< T > & | getNonZeroValues () |
| | getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block)
|
| const GpuVector< T > & | getNonZeroValues () const |
| | getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block)
|
| GpuVector< int > & | getRowIndices () |
| | getRowIndices returns the row indices used to represent the BSR structure.
|
| const GpuVector< int > & | getRowIndices () const |
| | getRowIndices returns the row indices used to represent the BSR structure.
|
| GpuVector< int > & | getColumnIndices () |
| | getColumnIndices returns the column indices used to represent the BSR structure.
|
| const GpuVector< int > & | getColumnIndices () const |
| | getColumnIndices returns the column indices used to represent the BSR structure.
|
| std::size_t | dim () const |
| | dim returns the dimension of the vector space on which this matrix acts
|
|
std::size_t | blockSize () const |
| | blockSize size of the blocks
|
| detail::GpuSparseMatrixDescription & | getDescription () |
| | getDescription the cusparse matrix description.
|
| virtual void | mv (const GpuVector< T > &x, GpuVector< T > &y) const |
| | mv performs matrix vector multiply y = Ax
|
| virtual void | umv (const GpuVector< T > &x, GpuVector< T > &y) const |
| | umv computes y=Ax+y
|
| virtual void | usmv (T alpha, const GpuVector< T > &x, GpuVector< T > &y) const |
| | umv computes y=alpha * Ax + y
|
| template<class MatrixType> |
| void | updateNonzeroValues (const MatrixType &matrix, bool copyNonZeroElementsDirectly=false) |
| | updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix
|
| template<bool OtherForceLegacy> |
| void | updateNonzeroValues (const GpuSparseMatrixWrapper< T, OtherForceLegacy > &matrix) |
| | updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix
|
|
void | setToZero () |
| | setToZero resets the matrix to zero values.
|
| template<class FunctionType> |
| auto | dispatchOnBlocksize (FunctionType function) const |
| | Dispatches a function based on the block size of the matrix.
|
template<typename T, bool ForceLegacy = false>
class Opm::gpuistl::GpuSparseMatrixWrapper< T, ForceLegacy >
The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or the generic CUDA API.
- Note
- we currently only support simple raw primitives for T (double and float). Block size is handled through the block size parameter
- Template Parameters
-
| T | the type to store. Can be either float, double or int. |
- Note
- we only support square matrices.
-
We only support Block Compressed Sparse Row Format (BSR) for now.
-
This class uses the legacy cuSPARSE API, to be compatible with CuSparse's ilu0 preconditioner. However, this preconditioner is deprecated and will be removed in future versions of CuSparse. So we should migrate to the new cuSPARSE generic API in the future.
-
To also support block size 1, we use the GpuSparseMatrixGeneric class which uses the new cuSPARSE generic API. This is a temporary solution, and we should migrate to the new API for all block sizes in the future by replacing this class with GpuSparseMatrixGeneric.
template<typename T, bool ForceLegacy = false>
template<class FunctionType>
Dispatches a function based on the block size of the matrix.
This method allows executing different code paths depending on the block size of the matrix, up to the maximum block size specified by max_block_size.
Use this function if you need the block size to be known at compile time.
- Template Parameters
-
| FunctionType | Type of the function to be dispatched |
- Parameters
-
| function | The function to be executed based on the block size |
- Returns
- The result of the function execution
You can use this function as