|
GpuSparseMatrixWrapper.hpp
Go to the documentation of this file.
68 Since the generic API for CUDA/HIP is primaryly supported on CUDA 13 (and not yet HIP) for blocked
69 matrices, places wanting to use blocked matrices can invoke this class which handles which API to use.
183 static GpuSparseMatrixWrapper<T, ForceLegacy> fromMatrix(const MatrixType& matrix, bool copyNonZeroElementsDirectly = false)
The GpuSparseMatrixGeneric class uses cuSPARSE Generic API for sparse matrix operations. Definition: GpuSparseMatrixGeneric.hpp:48 The GpuSparseMatrix class simple wrapper class for a CuSparse matrix. Definition: GpuSparseMatrix.hpp:61 static GpuSparseMatrix< T > fromMatrix(const MatrixType &matrix, bool copyNonZeroElementsDirectly=false) fromMatrix creates a new matrix with the same block size and values as the given matrix The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or t... Definition: GpuSparseMatrixWrapper.hpp:62 GpuSparseMatrixWrapper(const GpuSparseMatrixWrapper &other) Definition: GpuSparseMatrixWrapper.hpp:150 GpuVector< int > & getRowIndices() getRowIndices returns the row indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:271 void updateNonzeroValues(const GpuSparseMatrixWrapper< T, OtherForceLegacy > &matrix) updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix Definition: GpuSparseMatrixWrapper.hpp:389 virtual void mv(const GpuVector< T > &x, GpuVector< T > &y) const mv performs matrix vector multiply y = Ax Definition: GpuSparseMatrixWrapper.hpp:340 static constexpr int max_block_size Maximum block size supported by this implementation. Definition: GpuSparseMatrixWrapper.hpp:103 GpuVector< T > & getNonZeroValues() getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block) Definition: GpuSparseMatrixWrapper.hpp:251 matrix_type * operator->() Definition: GpuSparseMatrixWrapper.hpp:82 const GpuVector< T > & getNonZeroValues() const getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block) Definition: GpuSparseMatrixWrapper.hpp:261 const matrix_type * operator->() const Definition: GpuSparseMatrixWrapper.hpp:88 std::size_t N() const N returns the number of rows (which is equal to the number of columns) Definition: GpuSparseMatrixWrapper.hpp:232 static GpuSparseMatrixWrapper< T, ForceLegacy > fromMatrix(const MatrixType &matrix, bool copyNonZeroElementsDirectly=false) fromMatrix creates a new matrix with the same block size and values as the given matrix Definition: GpuSparseMatrixWrapper.hpp:183 void setNonUnitDiagonal() setNonUnitDiagonal sets the CuSparse flag that this has non-unit diagional. Definition: GpuSparseMatrixWrapper.hpp:224 GpuSparseMatrixWrapper(const GpuVector< int > &rowIndices, const GpuVector< int > &columnIndices, std::size_t blockSize) Definition: GpuSparseMatrixWrapper.hpp:143 void updateNonzeroValues(const MatrixType &matrix, bool copyNonZeroElementsDirectly=false) updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix Definition: GpuSparseMatrixWrapper.hpp:378 virtual ~GpuSparseMatrixWrapper()=default detail::GpuSparseMatrixDescription & getDescription() getDescription the cusparse matrix description. Definition: GpuSparseMatrixWrapper.hpp:330 void setUpperTriangular() Definition: GpuSparseMatrixWrapper.hpp:194 std::size_t dim() const dim returns the dimension of the vector space on which this matrix acts Definition: GpuSparseMatrixWrapper.hpp:312 T field_type Definition: GpuSparseMatrixWrapper.hpp:64 GpuSparseMatrixWrapper()=default std::size_t nonzeroes() const nonzeroes behaves as the Dune::BCRSMatrix::nonzeros() function and returns the number of non zero blo... Definition: GpuSparseMatrixWrapper.hpp:241 GpuVector< int > & getColumnIndices() getColumnIndices returns the column indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:291 void setUnitDiagonal() setUnitDiagonal sets the CuSparse flag that this has unit diagional. Definition: GpuSparseMatrixWrapper.hpp:214 GpuSparseMatrixWrapper(const T *nonZeroElements, const int *rowIndices, const int *columnIndices, std::size_t numberOfNonzeroBlocks, std::size_t blockSize, std::size_t numberOfRows) Definition: GpuSparseMatrixWrapper.hpp:118 GpuSparseMatrixWrapper & operator=(const GpuSparseMatrixWrapper &)=delete void setLowerTriangular() setLowerTriangular sets the CuSparse flag that this is an lower diagonal (with non-unit diagonal) mat... Definition: GpuSparseMatrixWrapper.hpp:204 virtual void usmv(T alpha, const GpuVector< T > &x, GpuVector< T > &y) const umv computes y=alpha * Ax + y Definition: GpuSparseMatrixWrapper.hpp:362 GpuSparseMatrix< T > matrix_type Definition: GpuSparseMatrixWrapper.hpp:74 const GpuVector< int > & getColumnIndices() const getColumnIndices returns the column indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:301 const matrix_type & get() const Definition: GpuSparseMatrixWrapper.hpp:166 std::size_t blockSize() const blockSize size of the blocks Definition: GpuSparseMatrixWrapper.hpp:320 const GpuVector< int > & getRowIndices() const getRowIndices returns the row indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:281 auto dispatchOnBlocksize(FunctionType function) const Dispatches a function based on the block size of the matrix. Definition: GpuSparseMatrixWrapper.hpp:416 virtual void umv(const GpuVector< T > &x, GpuVector< T > &y) const umv computes y=Ax+y Definition: GpuSparseMatrixWrapper.hpp:350 The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern. Definition: CuSparseResource.hpp:55 A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUDA... Definition: AmgxInterface.hpp:38 |