-
Notifications
You must be signed in to change notification settings - Fork 99
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, typicallyint
orlong 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, typicallyint
orsize_t
type execution_space
Execution Space associated with the view, will be used for performing view initialization, and certain deep_copy operations.
type memory_space
Memory Space associated with the underlying views.
type device_type
Combination of the execution_space and memory_space, nothing further really
type value_type
The scalar type of the data the values view is referencing
type ordinal_type
The ordinal type of the data the entries view is referencing
type memory_traits
The memory trait of the underlying views
type size_type
The ordinal type of the data the rowmap view is referencing
type HostMirror
Type of the host mirror for this BsrMatrix
type StaticCrsGraphType
The type of the graph store by the matrix
type staticcrsgraph_type
Lower case alias of the above StaticCrsGraphType
type index_type
Type of column indices in the sparse matrix.
type const_ordinal_type
Const version of the type of column indices in the sparse matrix.
type non_const_ordinal_type
Nonconst version of the type of column indices in the sparse matrix.
type row_map_type
Type of the "row map" (which contains the offset for each row's data).
type const_size_type
Const version of the type of row offsets in the sparse matrix.
type non_const_size_type
Nonconst version of the type of row offsets in the sparse matrix.
type values_type
Kokkos Array type of the entries (values) in the sparse matrix.
type const_value_type
Const version of the type of the entries in the sparse matrix.
type non_const_value_type
Nonconst version of the type of the entries in the sparse matrix.
type block_layout_type
Layout of the block_type
and const_block_type
views
type block_type
Type of the views returned when accessing a block of the matrix with unmanaged_block()
type const_block_type
Type 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() const
Get the number of block rows in the matrix, identical to the number of rows in the underlying graph.
ordinal_type numCols() const
Get the number of block columns in the matrix, identical to the number of columns in the underlying graph.
ordinal_type blockDim() const
Get the block dimension
ordinal_type numPointRows() const
Get the number of point rows in the matrix
ordinal_type numPointCols() const
Get the number of point columns in the matrix
size_type nnz() const
Get 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) const
BsrRowViewConst<BsrMatrix> block_row_const(const ordinal_type i) const
block_type unmanaged_block(const size_type i) const
return an unmanaged view of block i
const_block_type unmanaged_block_const(const size_type i) const
return an unmanaged view of constant block i
- SpMV
- SpADD
- SpGEMM
SAND2024-06899W