-
Notifications
You must be signed in to change notification settings - Fork 110
BsrMatrix
Header file: KokkosSparse_BsrMatrix.hpp
The BsrMatrix class provides a block compressed sparse row implementation of a sparse matrix, as described, for example, in Saad (2nd ed.).
template <class ScalarType, class OrdinalType, class Device,
class MemoryTraits = void, class SizeType = default_size_type>
class BsrMatrix;-
ScalarType: Determines the type of the values stored in the matrix, typicallyint,float,double,Kokkos::complex<...>, ... -
OrdinalType: Determines the type of the column indices held in the graph of the matrix, typicallyintorlong long -
Device: -
MemoryTraits: Sets access properties via enum parameters for the templated Kokkos::MemoryTraits<> class. This is assumed to be the shared memory trait used by the underlying graph and values. -
SizeType: Determines the type of the offsets stored in the row pointer of the underlying graph, typicallyintorsize_t
type execution_spaceExecution Space associated with the view, will be used for performing view initialization, and certain deep_copy operations.
type memory_spaceMemory Space associated with the underlying views.
type device_typeCombination of the execution_space and memory_space, nothing further really
type value_typeThe scalar type of the data the values view is referencing
type ordinal_typeThe ordinal type of the data the entries view is referencing
type memory_traitsThe memory trait of the underlying views
type size_typeThe ordinal type of the data the rowmap view is referencing
type HostMirrorType of the host mirror for this BsrMatrix
type StaticCrsGraphTypeThe type of the graph store by the matrix
type staticcrsgraph_typeLower case alias of the above StaticCrsGraphType
type index_typeType of column indices in the sparse matrix.
type const_ordinal_typeConst version of the type of column indices in the sparse matrix.
type non_const_ordinal_typeNonconst version of the type of column indices in the sparse matrix.
type row_map_typeType of the "row map" (which contains the offset for each row's data).
type const_size_typeConst version of the type of row offsets in the sparse matrix.
type non_const_size_typeNonconst version of the type of row offsets in the sparse matrix.
type values_typeKokkos Array type of the entries (values) in the sparse matrix.
type const_value_typeConst version of the type of the entries in the sparse matrix.
type non_const_value_typeNonconst version of the type of the entries in the sparse matrix.
type block_layout_typeLayout of the block_type and const_block_type views
type block_typeType of the views returned when accessing a block of the matrix with unmanaged_block()
type const_block_typeType of the views returned when accessing a block of the matrix with unmanaged_block_const()
BsrMatrix()Default constructor, constructs an empty matrix with no allocations performed
BsrMatrix(const BsrMatrix<SType, OType, DType, MTType, IType>& B)Shallow copy constructor
BsrMatrix(const std::string& arg_label, const staticcrsgraph_type& arg_graph, const OrdinalType& blockDimIn)Construct from graph and blockDim with label.
BsrMatrix(const std::string& label, OrdinalType nrows, OrdinalType ncols,
size_type annz, ScalarType* vals, OrdinalType* rows,
OrdinalType* cols, OrdinalType blockdim, bool pad = false)Construct from host data in COO format
BsrMatrix(const std::string& label, const OrdinalType nrows, const OrdinalType ncols,
const size_type annz, const values_type& vals,
const row_map_type& rows, const index_type& cols,
const OrdinalType blockDimIn)Constructor using the underlying views for row pointer, column indices and values.
BsrMatrix(const std::string& label, const OrdinalType& ncols,
const values_type& vals, const staticcrsgraph_type& graph_,
const OrdinalType& blockDimIn)Constructor using graph and values as input
BsrMatrix(const KokkosSparse::CrsMatrix<SType, OType, DType, MTType, IType>&
crs_mtx,
const OrdinalType blockDimIn)Constructor using CrsMatrix as input
BsrMatrix& operator=(const BsrMatrix<aScalarType, aOrdinalType, aDevice,
aMemoryTraits, aSizeType>& mtx)Assignment operator
ordinal_type numRows() constGet the number of block rows in the matrix, identical to the number of rows in the underlying graph.
ordinal_type numCols() constGet the number of block columns in the matrix, identical to the number of columns in the underlying graph.
ordinal_type blockDim() constGet the block dimension
ordinal_type numPointRows() constGet the number of point rows in the matrix
ordinal_type numPointCols() constGet the number of point columns in the matrix
size_type nnz() constGet the number of blocks in the matrix, same as the number of entries in the underlying graph.
OrdinalType replaceValues(const OrdinalType rowi, const OrdinalType cols[],
const OrdinalType ncol, const ScalarType vals[],
const bool is_sorted = false,
const bool force_atomic = false)Replace an entry in the matrix
OrdinalType sumIntoValues(const OrdinalType rowi, const OrdinalType cols[],
const OrdinalType ncol, const ScalarType vals[],
const bool is_sorted = false,
const bool force_atomic = false)Add to an entry in the matrix
BsrRowView<BsrMatrix> block_row(const ordinal_type i) constBsrRowViewConst<BsrMatrix> block_row_const(const ordinal_type i) constblock_type unmanaged_block(const size_type i) constreturn an unmanaged view of block i
const_block_type unmanaged_block_const(const size_type i) constreturn an unmanaged view of constant block i
- SpMV
- SpADD
- SpGEMM
SAND2024-06899W