|
GpuSparseMatrixWrapper.hpp
Go to the documentation of this file.
69 Since the generic API for CUDA/HIP is primaryly supported on CUDA 13 (and not yet HIP) for blocked
70 matrices, places wanting to use blocked matrices can invoke this class which handles which API to use.
184 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:63 void setLowerTriangular() setLowerTriangular sets the CuSparse flag that this is an lower diagonal (with non-unit diagonal) mat... Definition: GpuSparseMatrixWrapper.hpp:202 GpuSparseMatrixWrapper(const GpuSparseMatrixWrapper &other) Definition: GpuSparseMatrixWrapper.hpp:151 void setUnitDiagonal() setUnitDiagonal sets the CuSparse flag that this has unit diagional. Definition: GpuSparseMatrixWrapper.hpp:211 GpuVector< int > & getRowIndices() getRowIndices returns the row indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:268 void setUpperTriangular() Definition: GpuSparseMatrixWrapper.hpp:193 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:386 virtual void mv(const GpuVector< T > &x, GpuVector< T > &y) const mv performs matrix vector multiply y = Ax Definition: GpuSparseMatrixWrapper.hpp:337 static constexpr int max_block_size Maximum block size supported by this implementation. Definition: GpuSparseMatrixWrapper.hpp:104 GpuVector< T > & getNonZeroValues() getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block) Definition: GpuSparseMatrixWrapper.hpp:248 matrix_type * operator->() Definition: GpuSparseMatrixWrapper.hpp:83 const GpuVector< T > & getNonZeroValues() const getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block) Definition: GpuSparseMatrixWrapper.hpp:258 const matrix_type * operator->() const Definition: GpuSparseMatrixWrapper.hpp:89 std::size_t N() const N returns the number of rows (which is equal to the number of columns) Definition: GpuSparseMatrixWrapper.hpp:229 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:184 GpuSparseMatrixWrapper(const GpuVector< int > &rowIndices, const GpuVector< int > &columnIndices, std::size_t blockSize) Definition: GpuSparseMatrixWrapper.hpp:144 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:375 virtual ~GpuSparseMatrixWrapper()=default detail::GpuSparseMatrixDescription & getDescription() getDescription the cusparse matrix description. Definition: GpuSparseMatrixWrapper.hpp:327 std::size_t dim() const dim returns the dimension of the vector space on which this matrix acts Definition: GpuSparseMatrixWrapper.hpp:309 T field_type Definition: GpuSparseMatrixWrapper.hpp:65 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:238 GpuVector< int > & getColumnIndices() getColumnIndices returns the column indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:288 void setNonUnitDiagonal() setNonUnitDiagonal sets the CuSparse flag that this has non-unit diagional. Definition: GpuSparseMatrixWrapper.hpp:220 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:119 GpuSparseMatrixWrapper & operator=(const GpuSparseMatrixWrapper &)=delete virtual void usmv(T alpha, const GpuVector< T > &x, GpuVector< T > &y) const umv computes y=alpha * Ax + y Definition: GpuSparseMatrixWrapper.hpp:359 void setToZero() setToZero resets the matrix to zero values. Definition: GpuSparseMatrixWrapper.hpp:394 const GpuVector< int > & getColumnIndices() const getColumnIndices returns the column indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:298 const matrix_type & get() const Definition: GpuSparseMatrixWrapper.hpp:167 std::size_t blockSize() const blockSize size of the blocks Definition: GpuSparseMatrixWrapper.hpp:317 const GpuVector< int > & getRowIndices() const getRowIndices returns the row indices used to represent the BSR structure. Definition: GpuSparseMatrixWrapper.hpp:278 auto dispatchOnBlocksize(FunctionType function) const Dispatches a function based on the block size of the matrix. Definition: GpuSparseMatrixWrapper.hpp:420 virtual void umv(const GpuVector< T > &x, GpuVector< T > &y) const umv computes y=Ax+y Definition: GpuSparseMatrixWrapper.hpp:347 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: GpuFlowProblem.hpp:49 |