SPARSE – KokkosKernels sparse interfaces
crsmatrix
-
template<class ScalarType, class OrdinalType, class Device, class MemoryTraits = void, class SizeType = KokkosKernels::default_size_type>
class CrsMatrix Compressed sparse row implementation of a sparse matrix.
“Crs” stands for “compressed row sparse.” This is the phrase Trilinos traditionally uses to describe compressed sparse row storage for sparse matrices, as described, for example, in Saad (2nd ed.).
- Template Parameters:
ScalarType – The type of entries in the sparse matrix.
OrdinalType – The type of column indices in the sparse matrix.
Device – The Kokkos Device type.
MemoryTraits – Traits describing how Kokkos manages and accesses data. The default parameter suffices for most users.
Storage of the actual sparsity structure and values.
uses the compressed sparse row (CSR) storage format to store the sparse matrix. CSR is also called “compressed row
storage”; hence the name, which it inherits from Tpetra and from Epetra before it.
-
staticcrsgraph_type graph
The graph (sparsity structure) of the sparse matrix.
-
values_type values
The 1-D array of values of the sparse matrix.
-
DeviceConfig dev_config
Launch configuration that can be used by overloads/specializations of MV_multiply().
This is a hack and needs to be replaced by a general state mechanism.
-
inline CrsMatrix()
Default constructor; constructs an empty sparse matrix.
FIXME (mfh 09 Aug 2013) numCols and nnz should be properties of the graph, not the matrix. Then CrsMatrix needs methods to get these from the graph.
-
template<typename InScalar, typename InOrdinal, class InDevice, class InMemTraits, typename InSizeType>
inline CrsMatrix(const CrsMatrix<InScalar, InOrdinal, InDevice, InMemTraits, InSizeType> &B) Copy constructor (shallow copy).
-
template<typename InScalar, typename InOrdinal, typename InDevice, typename InMemTraits, typename InSizeType>
inline CrsMatrix(const std::string&, const CrsMatrix<InScalar, InOrdinal, InDevice, InMemTraits, InSizeType> &mat_) Deep copy constructor (can cross spaces)
-
template<typename InOrdinal, typename InLayout, typename InDevice, typename InMemTraits, typename InSizeType>
inline CrsMatrix(const std::string &label, const StaticCrsGraph<InOrdinal, InLayout, InDevice, InMemTraits, InSizeType> &graph_) Construct with a graph that will be shared.
Allocate the values array for subsequent fill.
-
template<typename InOrdinal, typename InLayout, typename InDevice, typename InMemTraits, typename InSizeType>
inline CrsMatrix(const std::string &label, const StaticCrsGraph<InOrdinal, InLayout, InDevice, InMemTraits, InSizeType> &graph_, const OrdinalType &ncols) Constructor that accepts a a static graph, and numCols.
The matrix will store and use the row map, indices (by view, not by deep copy) and allocate the values view.
- Parameters:
label – [in] The sparse matrix’s label.
graph_ – [in] The graph for storing the rowmap and col ids.
ncols – [in] The number of columns.
-
template<typename InOrdinal, typename InLayout, typename InDevice, typename InMemTraits, typename InSizeType>
inline CrsMatrix(const std::string&, const OrdinalType &ncols, const values_type &vals, const StaticCrsGraph<InOrdinal, InLayout, InDevice, InMemTraits, InSizeType> &graph_) Constructor that accepts a a static graph, and values.
The matrix will store and use the row map, indices, and values directly (by view, not by deep copy).
- Parameters:
ncols – [in] The number of columns.
vals – [in/out] The entries.
graph_ – The graph for storing the rowmap and col ids.
-
inline CrsMatrix(const std::string&, OrdinalType nrows, OrdinalType ncols, size_type annz, ScalarType *val, OrdinalType *rowmap, OrdinalType *cols)
Constructor that copies raw arrays of host data in 3-array CRS (compressed row storage) format.
On input, the entries must be sorted by row.
rowmapdetermines where each row begins and ends. For each entry k (0 <= k < annz),cols[k] gives the adjacent column, andval[k] gives the corresponding matrix value.This constructor is mainly useful for benchmarking or for reading the sparse matrix’s data from a file.
- Parameters:
nrows – [in] The number of rows.
ncols – [in] The number of columns.
annz – [in] The number of entries.
val – [in] The values.
rowmap – [in] The row offsets. The values/columns in row k begin at index
rowmap[k] and end atrowmap[k+1]-1 (inclusive). This means the array must have lengthnrows+1.cols – [in] The column indices.
cols[k] is the column index of entry k, with a corresponding value ofval[k] .
-
inline CrsMatrix(const std::string&, const OrdinalType nrows, const OrdinalType ncols, const size_type annz, const values_type &vals, const row_map_type &rowmap, const index_type &cols)
Constructor that accepts a row map, column indices, and values.
The matrix will store and use the row map, indices, and values directly (by view, not by deep copy).
- Parameters:
nrows – [in] The number of rows.
ncols – [in] The number of columns.
annz – [in] The number of entries.
vals – [in] The entries.
rowmap – [in] The row map (containing the offsets to the data in each row).
cols – [in] The column indices.
-
template<typename aScalarType, typename aOrdinalType, class aDevice, class aMemoryTraits, typename aSizeType>
inline CrsMatrix &operator=(const CrsMatrix<aScalarType, aOrdinalType, aDevice, aMemoryTraits, aSizeType> &mtx) Attempt to assign the input matrix to
*this.
-
inline ordinal_type numRows() const
The number of rows in the sparse matrix.
-
inline ordinal_type numCols() const
The number of columns in the sparse matrix.
-
inline ordinal_type numPointRows() const
The number of “point” (non-block) rows in the matrix. Since Crs is not blocked, this is just the number of regular rows.
-
inline ordinal_type numPointCols() const
The number of “point” (non-block) columns in the matrix. Since Crs is not blocked, this is just the number of regular columns.
-
inline SparseRowView<CrsMatrix> row(const ordinal_type i) const
Return a view of row i of the matrix.
If row i does not belong to the matrix, return an empty view.
The returned object
viewimplements the following interface:view.lengthis the number of entries in the rowview.value(k)returns a nonconst reference to the value of the k-th entry in the rowview.colidx(k)returns a nonconst reference to the column index of the k-th entry in the row
view.length - 1.Users should not rely on the return type of this method. They should instead assign to ‘auto’. That allows compile-time polymorphism for different kinds of sparse matrix formats (e.g., ELLPACK or Jagged Diagonal) that we may wish to support in the future.
Both row() and rowConst() used to take a “SizeType” template parameter, which was the type to use for row offsets. This is unnecessary, because the CrsMatrix specialization already has the row offset type available, via the
size_typetypedef. Our sparse matrix-vector multiply implementation for CrsMatrix safely usesordinal_typerather thansize_typeto iterate over all the entries in a row of the sparse matrix. Sinceordinal_typemay be smaller thansize_type, compilers may generate more efficient code. The row() and rowConst() methods first compute the difference of consecutive row offsets assize_type, and then cast toordinal_type. If you want to do this yourself, here is an example:for (ordinal_type lclRow = 0; lclRow < A.numRows (); ++lclRow) { const ordinal_type numEnt = static_cast<ordinal_type> (A.graph.row_map(i+1) - A.graph.row_map(i)); for (ordinal_type k = 0; k < numEnt; ++k) { // etc. } }
-
inline SparseRowViewConst<CrsMatrix> rowConst(const ordinal_type i) const
Return a const view of row i of the matrix.
If row i does not belong to the matrix, return an empty view.
The returned object
viewimplements the following interface:view.lengthis the number of entries in the rowview.value(k)returns a const reference to the value of the k-th entry in the rowview.colidx(k)returns a const reference to the column index of the k-th entry in the row
view.length - 1.Users should not rely on the return type of this method. They should instead assign to ‘auto’. That allows compile-time polymorphism for different kinds of sparse matrix formats (e.g., ELLPACK or Jagged Diagonal) that we may wish to support in the future.
Both row() and rowConst() used to take a “SizeType” template parameter, which was the type to use for row offsets. This is unnecessary, because the CrsMatrix specialization already has the row offset type available, via the
size_typetypedef. Our sparse matrix-vector multiply implementation for CrsMatrix safely usesordinal_typerather thansize_typeto iterate over all the entries in a row of the sparse matrix. Sinceordinal_typemay be smaller thansize_type, compilers may generate more efficient code. The row() and rowConst() methods first compute the difference of consecutive row offsets assize_type, and then cast toordinal_type. If you want to do this yourself, here is an example:for (ordinal_type lclRow = 0; lclRow < A.numRows (); ++lclRow) { const ordinal_type numEnt = static_cast<ordinal_type> (A.graph.row_map(i+1) - A.graph.row_map(i)); for (ordinal_type k = 0; k < numEnt; ++k) { // etc. } }
Public Types
-
typedef Kokkos::Device<execution_space, memory_space> device_type
Canonical device type.
-
typedef ScalarType value_type
Type of each value in the matrix.
-
typedef OrdinalType ordinal_type
Type of each (column) index in the matrix.
-
typedef SizeType size_type
Type of each entry of the “row map.”.
The “row map” corresponds to the
ptrarray of row offsets in compressed sparse row (CSR) storage.
-
typedef CrsMatrix<ScalarType, OrdinalType, host_mirror_space, MemoryTraits, SizeType> HostMirror
Type of a host-memory mirror of the sparse matrix.
-
typedef StaticCrsGraph<ordinal_type, KokkosKernels::default_layout, device_type, memory_traits, size_type> StaticCrsGraphType
Type of the graph structure of the sparse matrix.
-
typedef StaticCrsGraph<ordinal_type, KokkosKernels::default_layout, device_type, memory_traits, size_type> staticcrsgraph_type
Type of the graph structure of the sparse matrix - consistent with Kokkos.
-
typedef staticcrsgraph_type::entries_type index_type
Type of column indices in the sparse matrix.
-
typedef index_type::const_value_type const_ordinal_type
Const version of the type of column indices in the sparse matrix.
-
typedef index_type::non_const_value_type non_const_ordinal_type
Nonconst version of the type of column indices in the sparse matrix.
-
typedef staticcrsgraph_type::row_map_type row_map_type
Type of the “row map” (which contains the offset for each row’s data).
-
typedef row_map_type::const_value_type const_size_type
Const version of the type of row offsets in the sparse matrix.
-
typedef row_map_type::non_const_value_type non_const_size_type
Nonconst version of the type of row offsets in the sparse matrix.
-
typedef Kokkos::View<value_type*, Kokkos::LayoutRight, device_type, MemoryTraits> values_type
Kokkos Array type of the entries (values) in the sparse matrix.
-
typedef values_type::const_value_type const_value_type
Const version of the type of the entries in the sparse matrix.
-
typedef values_type::non_const_value_type non_const_value_type
Nonconst version of the type of the entries in the sparse matrix.
ccsmatrix
-
template<class ScalarType, class OrdinalType, class Device, class MemoryTraits = void, class SizeType = typename Kokkos::ViewTraits<OrdinalType*, Device, void, void>::size_type>
class CcsMatrix Compressed sparse column implementation of a sparse matrix.
“Ccs” stands for “compressed column sparse.”
- Template Parameters:
ScalarType – The type of entries in the sparse matrix.
OrdinalType – The type of column indices in the sparse matrix.
Device – The Kokkos Device type.
MemoryTraits – Traits describing how Kokkos manages and accesses data. The default parameter suffices for most users.
Storage of the actual sparsity structure and values.
CcsMatrix uses the compressed sparse column (CCS) storage format to store the sparse matrix.
-
staticccsgraph_type graph
The graph (sparsity structure) of the sparse matrix.
-
values_type values
The 1-D array of values of the sparse matrix.
-
inline CcsMatrix()
Default constructor; constructs an empty sparse matrix.
-
inline CcsMatrix(const std::string&, const OrdinalType nrows, const OrdinalType ncols, const size_type annz, const values_type &vals, const col_map_type &colmap, const index_type &rows)
Constructor that accepts a column map, row indices, and values.
The matrix will store and use the column map, indices, and values directly (by view, not by deep copy).
- Parameters:
nrows – [in] The number of rows.
ncols – [in] The number of columns.
annz – [in] The number of entries.
vals – [in] The entries.
colmap – [in] The column map (containing the offsets to the data in each column).
rows – [in] The row indices.
-
inline ordinal_type numCols() const
The number of rows in the sparse matrix.
-
inline ordinal_type numRows() const
The number of columns in the sparse matrix.
-
inline ordinal_type numPointRows() const
The number of “point” (non-block) rows in the matrix. Since Ccs is not blocked, this is just the number of regular rows.
-
inline ordinal_type numPointCols() const
The number of “point” (non-block) columns in the matrix. Since Ccs is not blocked, this is just the number of regular columns.
Public Types
-
typedef Kokkos::Device<execution_space, memory_space> device_type
Canonical device type.
-
typedef SizeType size_type
Type of each entry of the “column map.”.
The “column map” corresponds to the
ptrarray of column offsets in compressed sparse column (CCS) storage.
-
typedef ScalarType value_type
Type of each value in the matrix.
-
typedef OrdinalType ordinal_type
Type of each (column) index in the matrix.
-
typedef StaticCcsGraph<ordinal_type, KokkosKernels::default_layout, device_type, memory_traits, size_type> staticccsgraph_type
Type of the graph structure of the sparse matrix - consistent with Kokkos.
-
typedef staticccsgraph_type::col_map_type col_map_type
Type of the “column map” (which contains the offset for each column’s data).
-
typedef staticccsgraph_type::entries_type index_type
Type of column indices in the sparse matrix.
coomatrix
-
template<class ScalarType, class OrdinalType, class Device, class MemoryTraits = void, class SizeType = typename Kokkos::ViewTraits<OrdinalType*, Device, void, void>::size_type>
class CooMatrix Coordinate format implementation of a sparse matrix.
- Template Parameters:
ScalarType – The type of scalar entries in the sparse matrix.
OrdinalType – The type of index entries in the sparse matrix.
Device – The Kokkos Device type.
MemoryTraits – Traits describing how Kokkos manages and accesses data. The default parameter suffices for most users. “Coo” stands for “coordinate format”.
Public Types
-
using scalar_type = ScalarType
Type of each value in the matrix.
-
using const_scalar_type = const std::remove_const_t<scalar_type>
Type of each value in the const matrix.
-
using non_const_scalar_type = std::remove_const_t<scalar_type>
Non constant scalar type.
-
using ordinal_type = OrdinalType
Type of each index in the matrix.
-
using const_ordinal_type = const std::remove_const_t<ordinal_type>
Type of each value in the const matrix.
-
using non_const_ordinal_type = std::remove_const_t<ordinal_type>
Non constant ordinal type.
-
using row_type = ordinal_type
Type of each row index in the matrix.
-
using column_type = ordinal_type
Type of each column index in the matrix.
-
using execution_space = typename device_type::execution_space
Type of the Kokkos::Device::execution_space.
-
using memory_space = typename device_type::memory_space
Type of the Kokkos::Device::memory_space.
-
using memory_traits = MemoryTraits
Type of the Kokkos::MemoryTraits.
-
using row_view = Kokkos::View<row_type*, Kokkos::LayoutRight, device_type, memory_traits>
The type of the row index view in the matrix.
-
using column_view = Kokkos::View<column_type*, Kokkos::LayoutRight, device_type, memory_traits>
The type of the column index view in the matrix.
-
using scalar_view = Kokkos::View<scalar_type*, Kokkos::LayoutRight, device_type, memory_traits>
The type of the scalar values view in the matrix.
-
using const_type = CooMatrix<const_scalar_type, const_ordinal_type, device_type, memory_traits, size_type>
The type of a constant CooMatrix.
Public Functions
-
inline CooMatrix()
Default constructor; constructs an empty sparse matrix.
-
inline CooMatrix(size_type nrows, size_type ncols, row_view row_in, column_view col_in, scalar_view data_in)
Constructor that accepts a column indicies view, row indices view, and values view.
The matrix will store and use the column indices, rows indices, and values directly (by view, not by deep copy).
- Parameters:
nrows – [in] The number of rows.
ncols – [in] The number of columns.
row_in – [in] The row indexes.
col_in – [in] The column indexes.
data_in – [in] The values.
-
inline column_view col() const
The column indexes of the matrix.
-
inline scalar_view data() const
The scalar values of the matrix.
crs2ccs
-
template<class OrdinalType, class SizeType, class ValViewType, class RowMapViewType, class ColIdViewType>
auto KokkosSparse::crs2ccs(OrdinalType nrows, OrdinalType ncols, SizeType nnz, ValViewType vals, RowMapViewType row_map, ColIdViewType col_ids) Blocking function that converts a CrsMatrix to a CcsMatrix. Crs values are copied from row-contiguous layout into column-contiguous layout.
Note
In KokkosKernels sparse code, adj stands for adjacency list and here we’re passing in a crs matrix with xadj=row_map and adj=col_ids.
- Template Parameters:
OrdinalType – The view value type associated with the RowIdViewType
SizeType – The type of nnz
ValViewType – The values view type
RowMapViewType – The column map view type
ColIdViewType – The row ids view type
- Parameters:
nrows – The number of rows in the crs matrix
ncols – The number of columns in the crs matrix
nnz – The number of non-zeros in the crs matrix
vals – The values view of the crs matrix
row_map – The row map view of the crs matrix
col_ids – The col ids view of the crs matrix
- Returns:
-
template<typename ScalarType, typename OrdinalType, class DeviceType, class MemoryTraitsType, typename SizeType>
auto KokkosSparse::crs2ccs(KokkosSparse::CrsMatrix<ScalarType, OrdinalType, DeviceType, MemoryTraitsType, SizeType> &crsMatrix) Blocking function that converts a crs matrix to a CcsMatrix. Crs values are copied from row-contiguous layout into column-contiguous layout.
- Template Parameters:
ScalarType – The crsMatrix::scalar_type
OrdinalType – The crsMatrix::ordinal_type
DeviceType – The crsMatrix::device_type
MemoryTraits – The crsMatrix::memory_traits
SizeType – The crsMatrix::size_type
- Parameters:
crsMatrix – The KokkosSparse::CrsMatrix.
- Returns:
ccs2crs
-
template<class OrdinalType, class SizeType, class ValViewType, class ColMapViewType, class RowIdViewType>
auto KokkosSparse::ccs2crs(OrdinalType nrows, OrdinalType ncols, SizeType nnz, ValViewType vals, ColMapViewType col_map, RowIdViewType row_ids) Blocking function that converts a ccs matrix to a CrsMatrix. Ccs values are copied from column-contiguous layout into row-contiguous layout.
Note
In KokkosKernels sparse code, adj stands for adjacency list and here we’re passing in a ccs matrix with xadj=col_map and adj=row_ids.
- Template Parameters:
OrdinalType – The view value type associated with the RowIdViewType
SizeType – The type of nnz
ValViewType – The values view type
ColMapViewType – The column map view type
RowIdViewType – The row ids view type
- Parameters:
nrows – The number of rows in the ccs matrix
ncols – The number of columns in the ccs matrix
nnz – The number of non-zeros in the ccs matrix
vals – The values view of the ccs matrix
col_map – The column map view of the ccs matrix
row_ids – The row ids view of the ccs matrix
- Returns:
-
template<typename ScalarType, typename OrdinalType, class DeviceType, class MemoryTraitsType, typename SizeType>
auto KokkosSparse::ccs2crs(KokkosSparse::CcsMatrix<ScalarType, OrdinalType, DeviceType, MemoryTraitsType, SizeType> &ccsMatrix) Blocking function that converts a crs matrix to a CcsMatrix. Ccs values are copied from column-contiguous layout into row-contiguous layout.
- Template Parameters:
ScalarType – The ccsMatrix::scalar_type
OrdinalType – The ccsMatrix::ordinal_type
DeviceType – The ccsMatrix::device_type
MemoryTraits – The ccsMatrix::memory_traits
SizeType – The ccsMatrix::size_type
- Parameters:
ccsMatrix – The KokkosSparse::CcsMatrix.
- Returns:
coo2crs
-
template<class DimType, class RowViewType, class ColViewType, class DataViewType>
auto KokkosSparse::coo2crs(DimType m, DimType n, RowViewType row, ColViewType col, DataViewType data) Blocking function that converts a CooMatrix into a CrsMatrix. Values are summed.
- Template Parameters:
DimType – the dimension type
RowViewType – The row array view type
ColViewType – The column array view type
DataViewType – The data array view type
- Parameters:
m – the number of rows
n – the number of columns
row – the array of row ids
col – the array of col ids
data – the array of data
- Returns:
-
template<typename ScalarType, typename OrdinalType, class DeviceType, class MemoryTraitsType, typename SizeType>
auto KokkosSparse::coo2crs(KokkosSparse::CooMatrix<ScalarType, OrdinalType, DeviceType, MemoryTraitsType, SizeType> &cooMatrix) Blocking function that converts a CooMatrix into a CrsMatrix. Values are summed.
- Template Parameters:
ScalarType – The
KokkosSparse::CooMatrix::scalar_typeOrdinalType – The KokkosSparse::CooMatrix::ordinal_type
DeviceType – The KokkosSparse::CooMatrix::device_type
MemoryTraits – The KokkosSparse::CooMatrix::memory_traits
SizeType – The KokkosSparse::CooMatrix::size_type
- Parameters:
cooMatrix – The sparse matrix stored in coordinate (“Coo”) format.
- Returns:
crs2coo
-
template<class OrdinalType, class SizeType, class ValViewType, class RowMapViewType, class ColIdViewType>
auto KokkosSparse::crs2coo(OrdinalType nrows, OrdinalType ncols, SizeType nnz, ValViewType vals, RowMapViewType row_map, ColIdViewType col_ids) Blocking function that converts a CrsMatrix to a CooMatrix. Crs values are copied into the CooMatrix in the order they appear within the CrsMatrix, starting from row 0 to row nrows - 1.
- Template Parameters:
OrdinalType – The view value type associated with the RowIdViewType
SizeType – The type of nnz
ValViewType – The values view type
RowMapViewType – The column map view type
ColIdViewType – The row ids view type
- Parameters:
nrows – The number of rows in the crs matrix
ncols – The number of columns in the crs matrix
nnz – The number of non-zeros in the crs matrix
vals – The values view of the crs matrix
row_map – The row map view of the crs matrix
col_ids – The col ids view of the crs matrix
- Returns:
-
template<typename ScalarType, typename OrdinalType, class DeviceType, class MemoryTraitsType, typename SizeType>
auto KokkosSparse::crs2coo(KokkosSparse::CrsMatrix<ScalarType, OrdinalType, DeviceType, MemoryTraitsType, SizeType> &crsMatrix) Blocking function that converts a CrsMatrix to a CooMatrix. Crs values are copied into the CooMatrix in the order they appear within the CrsMatrix, starting from row 0 to row nrows - 1.
- Template Parameters:
ScalarType – The crsMatrix::scalar_type
OrdinalType – The crsMatrix::ordinal_type
DeviceType – The crsMatrix::device_type
MemoryTraits – The crsMatrix::memory_traits
SizeType – The crsMatrix::size_type
- Parameters:
crsMatrix – The KokkosSparse::CrsMatrix.
- Returns:
spmv
-
template<class ExecutionSpace, class AlphaType, class AMatrix, class XVector, class BetaType, class YVector>
void KokkosSparse::spmv(const ExecutionSpace &space, KokkosKernels::Experimental::Controls controls, const char mode[], const AlphaType &alpha, const AMatrix &A, const XVector &x, const BetaType &beta, const YVector &y)
-
template<class AlphaType, class AMatrix, class XVector, class BetaType, class YVector>
void KokkosSparse::spmv(KokkosKernels::Experimental::Controls controls, const char mode[], const AlphaType &alpha, const AMatrix &A, const XVector &x, const BetaType &beta, const YVector &y)
-
template<class ExecutionSpace, class AlphaType, class AMatrix, class XVector, class BetaType, class YVector, typename = std::enable_if_t<Kokkos::is_execution_space<ExecutionSpace>::value>>
void KokkosSparse::spmv(const ExecutionSpace &space, const char mode[], const AlphaType &alpha, const AMatrix &A, const XVector &x, const BetaType &beta, const YVector &y) Kokkos sparse matrix-vector multiply. Computes y := alpha*Op(A)*x + beta*y, where Op(A) is controlled by mode (see below).
- Template Parameters:
ExecutionSpace – A Kokkos execution space. Must be able to access the memory spaces of A, x, and y.
AlphaType – Type of coefficient alpha. Must be convertible to YVector::value_type.
AMatrix – A KokkosSparse::CrsMatrix, or KokkosSparse::Experimental::BsrMatrix
XVector – Type of x, must be a rank-1 or rank-2 Kokkos::View
BetaType – Type of coefficient beta. Must be convertible to YVector::value_type.
YVector – Type of y, must be a Kokkos::View and its rank must match that of XVector
- Parameters:
space – [in] The execution space instance on which to run the kernel.
mode – [in] Select A’s operator mode: “N” for normal, “T” for transpose, “C” for conjugate or “H” for conjugate transpose.
alpha – [in] Scalar multiplier for the matrix A.
A – [in] The sparse matrix A.
x – [in] A vector to multiply on the left by A.
beta – [in] Scalar multiplier for the vector y.
y – [in/out] Result vector.
-
template<class AlphaType, class AMatrix, class XVector, class BetaType, class YVector>
void KokkosSparse::spmv(const char mode[], const AlphaType &alpha, const AMatrix &A, const XVector &x, const BetaType &beta, const YVector &y) Kokkos sparse matrix-vector multiply. Computes y := alpha*Op(A)*x + beta*y, where Op(A) is controlled by mode (see below).
- Template Parameters:
AlphaType – Type of coefficient alpha. Must be convertible to YVector::value_type.
AMatrix – A KokkosSparse::CrsMatrix, or KokkosSparse::Experimental::BsrMatrix
XVector – Type of x, must be a rank-1 or rank-2 Kokkos::View
BetaType – Type of coefficient beta. Must be convertible to YVector::value_type.
YVector – Type of y, must be a Kokkos::View and its rank must match that of XVector
- Parameters:
mode – [in] Select A’s operator mode: “N” for normal, “T” for transpose, “C” for conjugate or “H” for conjugate transpose.
alpha – [in] Scalar multiplier for the matrix A.
A – [in] The sparse matrix A.
x – [in] A vector to multiply on the left by A.
beta – [in] Scalar multiplier for the vector y.
y – [in/out] Result vector.
trsv
-
template<class AMatrix, class BMV, class XMV>
void KokkosSparse::trsv(const char uplo[], const char trans[], const char diag[], const AMatrix &A, const BMV &b, const XMV &x) Solve the triangular sparse linear system Op(A) x = b.
- Template Parameters:
AMatrix – KokkosSparse::CrsMatrix specialization.
BMV – The type of the input (right-hand side) (multi)vector.
XMV – The type of the output (left-hand side) (multi)vector.
- Parameters:
uplo – [in] “U” (for upper triangular) or “L” (for lower triangular).
trans – [in] “C” (for conjugate transpose), “T” (for transpose), or “N” (for no transpose).
diag – [in] “U” (for implicit unit diagonal) or “N” (for not).
A – [in] The input matrix A; must be upper triangular or lower triangular.
b – [in] The input (right-hand side) (multi)vector.
x – [in] The output (left-hand side) (multi)vector.
spgemm
-
template<class KernelHandle, class AMatrix, class BMatrix, class CMatrix>
void KokkosSparse::spgemm_symbolic(KernelHandle &kh, const AMatrix &A, const bool Amode, const BMatrix &B, const bool Bmode, CMatrix &C) - Template Parameters:
KernelHandle –
AMatrix –
BMatrix –
CMatrix –
- Parameters:
kh –
A –
Amode –
B –
Bmode –
C –
-
template<class KernelHandle, class AMatrix, class BMatrix, class CMatrix>
void KokkosSparse::spgemm_numeric(KernelHandle &kh, const AMatrix &A, const bool Amode, const BMatrix &B, const bool Bmode, CMatrix &C) - Template Parameters:
KernelHandle –
AMatrix –
BMatrix –
CMatrix –
- Parameters:
kh –
A –
Amode –
B –
Bmode –
C –
block_spgemm
-
template<class KernelHandle, class AMatrixType, class BMatrixType, class CMatrixType>
void KokkosSparse::block_spgemm_symbolic(KernelHandle &kh, const AMatrixType &A, const bool transposeA, const BMatrixType &B, const bool transposeB, CMatrixType &C) Symbolic phase for block SpGEMM (BSR matrices)
- Template Parameters:
KernelHandle –
AMatrixType –
BMatrixType –
CMatrixType –
- Parameters:
kh –
A –
transposeA –
B –
transposeB –
C –
-
template<class KernelHandle, class AMatrix, class BMatrix, class CMatrix>
void KokkosSparse::block_spgemm_numeric(KernelHandle &kh, const AMatrix &A, const bool Amode, const BMatrix &B, const bool Bmode, CMatrix &C) - Template Parameters:
KernelHandle –
AMatrix –
BMatrix –
CMatrix –
- Parameters:
kh –
A –
Amode –
B –
Bmode –
C –
gauss_seidel
-
inline void KokkosKernels::Experimental::KokkosKernelsHandle::create_gs_handle(KokkosSparse::GSAlgorithm gs_algorithm = KokkosSparse::GS_DEFAULT, KokkosGraph::ColoringAlgorithm coloring_algorithm = KokkosGraph::COLORING_DEFAULT)
Create a gauss seidel handle object.
- Parameters:
gs_algorithm – Specifies which algorithm to use:
KokkosSpace::GS_DEFAULT PointGaussSeidel or BlockGaussSeidel, depending on matrix type. KokkosSpace::GS_PERMUTED Reorders rows/cols into colors to improve locality. Uses RangePolicy over rows. KokkosSpace::GS_TEAM Uses TeamPolicy over batches of rows with ThreadVector within rows. KokkosSpace::GS_CLUSTER Uses independent clusters of nodes in the graph. Within a cluster, x is updated sequentially. For more information, see: https://arxiv.org/pdf/2204.02934.pdf. KokkosSpace::GS_TWOSTAGE Uses spmv to parallelize inner sweeps of x. For more information, see: https://arxiv.org/pdf/2104.01196.pdf.
coloring_algorithm – Specifies which coloring algorithm to color the graph with:
KokkosGraph::COLORING_DEFAULT Depends on execution space: COLORING_SERIAL on Kokkos::Serial; COLORING_EB on GPUs; COLORING_VBBIT on Kokkos::Sycl or elsewhere. KokkosGraph::COLORING_SERIAL Serial Greedy Coloring KokkosGraph::COLORING_VB Vertex Based Coloring KokkosGraph::COLORING_VBBIT Vertex Based Coloring with bit array KokkosGraph::COLORING_VBCS Vertex Based Color Set KokkosGraph::COLORING_VBD Vertex Based Deterministic Coloring KokkosGraph::COLORING_VBDBIT Vertex Based Deterministic Coloring with bit array KokkosGraph::COLORING_EB Edge Based Coloring KokkosGraph::COLORING_SERIAL2 Serial Distance-2 Graph Coloring (kept here for backwards compatibility for SPGEMM and other use cases)
-
inline void KokkosKernels::Experimental::KokkosKernelsHandle::create_gs_handle(const HandleExecSpace &handle_exec_space, int num_streams, KokkosSparse::GSAlgorithm gs_algorithm = KokkosSparse::GS_DEFAULT, KokkosGraph::ColoringAlgorithm coloring_algorithm = KokkosGraph::COLORING_DEFAULT)
Create a gauss seidel handle object.
- Parameters:
handle_exec_space – The execution space instance to execute kernels on.
num_streams – The number of streams to allocate memory for.
gs_algorithm – Specifies which algorithm to use:
KokkosSpace::GS_DEFAULT PointGaussSeidel KokkosSpace::GS_PERMUTED ?? KokkosSpace::GS_TEAM ?? KokkosSpace::GS_CLUSTER ?? KokkosSpace::GS_TWOSTAGE ??coloring_algorithm – Specifies which coloring algorithm to color the graph with:
KokkosGraph::COLORING_DEFAULT ?? KokkosGraph::COLORING_SERIAL Serial Greedy Coloring KokkosGraph::COLORING_VB Vertex Based Coloring KokkosGraph::COLORING_VBBIT Vertex Based Coloring with bit array KokkosGraph::COLORING_VBCS Vertex Based Color Set KokkosGraph::COLORING_VBD Vertex Based Deterministic Coloring KokkosGraph::COLORING_VBDBIT Vertex Based Deterministic Coloring with bit array KokkosGraph::COLORING_EB Edge Based Coloring KokkosGraph::COLORING_SERIAL2 Serial Distance-2 Graph Coloring (kept here for backwards compatibility for SPGEMM and other use cases)
-
inline void KokkosKernels::Experimental::KokkosKernelsHandle::create_gs_handle(KokkosSparse::ClusteringAlgorithm clusterAlgo, nnz_lno_t hint_verts_per_cluster, KokkosGraph::ColoringAlgorithm coloring_algorithm = KokkosGraph::COLORING_DEFAULT)
Create a gs handle object.
- Parameters:
clusterAlgo – Specifies which clustering algorithm to use:
KokkosSparse::CLUSTER_DEFAULT ?? KokkosSparse::CLUSTER_MIS2 ?? KokkosSparse::CLUSTER_BALLOON ?? KokkosSparse::NUM_CLUSTERING_ALGORITHMS ??hint_verts_per_cluster – Hint how many verticies to use per cluster
coloring_algorithm – Specifies which coloring algorithm to color the graph with:
KokkosGraph::COLORING_DEFAULT ?? KokkosGraph::COLORING_SERIAL Serial Greedy Coloring KokkosGraph::COLORING_VB Vertex Based Coloring KokkosGraph::COLORING_VBBIT Vertex Based Coloring with bit array KokkosGraph::COLORING_VBCS Vertex Based Color Set KokkosGraph::COLORING_VBD Vertex Based Deterministic Coloring KokkosGraph::COLORING_VBDBIT Vertex Based Deterministic Coloring with bit array KokkosGraph::COLORING_EB Edge Based Coloring KokkosGraph::COLORING_SERIAL2 Serial Distance-2 Graph Coloring (kept here for backwards compatibility for SPGEMM and other use cases)
-
template<typename ExecutionSpace, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_>
void KokkosSparse::gauss_seidel_symbolic(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (first phase, based on sparsity pattern only)
- Template Parameters:
ExecutionSpace – This kernels execution space type.
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
- Parameters:
space – The execution space instance this kernel will be run on.
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
- Pre:
handle->create_gs_handle(...)has been called previously
-
template<typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_>
void KokkosSparse::gauss_seidel_symbolic(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (first phase, based on sparsity pattern only)
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
- Pre:
handle->create_gs_handle(...)has been called previously
-
template<class ExecutionSpace, KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::gauss_seidel_numeric(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (second phase, based on matrix’s numeric values)
- Template Parameters:
ExecutionSpace – This kernels execution space type.
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
- Parameters:
space – The execution space instance this kernel will be run on.
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::gauss_seidel_numeric(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (second phase, based on matrix’s numeric values). This version accepts the matrix’s inverse diagonal from the user.
Remark
If the inverse diagonal is not already available, it’s best to call the version of
gauss_seidel_numericthat doesn’t take it as an argument. The inverse diagonal will be computed internally.- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type. The user-provided inverse diagonal must share this type.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
-
template<class ExecutionSpace, KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::gauss_seidel_numeric(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, scalar_nnz_view_t_ given_inverse_diagonal, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (second phase, based on matrix’s numeric values). This version accepts the matrix’s inverse diagonal from the user.
Remark
If the inverse diagonal is not already available, it’s best to call the version of
gauss_seidel_numericthat doesn’t take it as an argument. The inverse diagonal will be computed internally.- Template Parameters:
ExecutionSpace – This kernels execution space type.
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type. The user-provided inverse diagonal must share this type.
- Parameters:
space – The execution space instance this kernel will be run on.
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
given_inverse_diagonal – The inverse (reciprocal) of diagonal
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::gauss_seidel_numeric(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, scalar_nnz_view_t_ given_inverse_diagonal, bool is_graph_symmetric = true) Gauss-Seidel preconditioner setup (second phase, based on matrix’s numeric values). This version accepts the matrix’s inverse diagonal from the user.
Remark
If the inverse diagonal is not already available, it’s best to call the version of
gauss_seidel_numericthat doesn’t take it as an argument. The inverse diagonal will be computed internally.- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type. The user-provided inverse diagonal must share this type.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
given_inverse_diagonal – The inverse (reciprocal) of diagonal
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
-
template<class ExecutionSpace, KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::symmetric_gauss_seidel_apply(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply symmetric (forward + backward) Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
ExecutionSpace – This kernels execution space type.
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
space – The execution space instance this kernel will be run on. NOTE: Currently only used for GS_DEFAULT.
handle – handle A KokkosKernelsHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run (forward and backward counts as 1)
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::symmetric_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply symmetric (forward + backward) Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – handle A KokkosKernelsHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run (forward and backward counts as 1)
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<class ExecutionSpace, KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, class KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::forward_sweep_gauss_seidel_apply(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply forward Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
space – The execution space instance this kernel will be run on. NOTE: Currently only used for GS_DEFAULT.
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, class KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::forward_sweep_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply forward Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<class ExecutionSpace, KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, class KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::backward_sweep_gauss_seidel_apply(const ExecutionSpace &space, KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply backward Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
ExecutionSpace – This kernels execution space type.
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
space – The execution space instance this kernel will be run on. NOTE: Currently only used for GS_DEFAULT.
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::CRS, class KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::backward_sweep_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply backward Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
block_gauss_seidel
-
template<typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_>
void KokkosSparse::block_gauss_seidel_symbolic(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, typename KernelHandle::const_nnz_lno_t block_size, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, bool is_graph_symmetric = true) Block Gauss-Seidel preconditioner setup (first phase, based on sparsity pattern only)
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
block_size – The number of degrees of freedom per block
row_map – The matrix’s rowmap
entries – The matrix’s entries
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
- Pre:
handle->create_gs_handle(...)has been called previously
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::BSR, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::block_gauss_seidel_numeric(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, typename KernelHandle::const_nnz_lno_t block_size, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, bool is_graph_symmetric = true) Block Gauss-Seidel preconditioner setup (second phase, based on matrix’s numeric values)
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
- Parameters:
handle – handle A KokkosKernelsHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
block_size – The number of degrees of freedom per block
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
is_graph_symmetric – Whether the upper-left
num_rows x num_rowssubmatrix of A is structurally symmetric
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::BSR, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::symmetric_block_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, typename KernelHandle::const_nnz_lno_t block_size, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply symmetric (forward + backward) Block Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – handle A KokkosKernelsHandle instance.
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
block_size – The number of degrees of freedom per block
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run (forward and backward counts as 1)
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::BSR, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::forward_sweep_block_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, typename KernelHandle::const_nnz_lno_t block_size, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply forward Block Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
block_size – The number of degrees of freedom per block
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
-
template<KokkosSparse::SparseMatrixFormat format = KokkosSparse::SparseMatrixFormat::BSR, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, typename x_scalar_view_t, typename y_scalar_view_t>
void KokkosSparse::backward_sweep_block_gauss_seidel_apply(KernelHandle *handle, typename KernelHandle::const_nnz_lno_t num_rows, typename KernelHandle::const_nnz_lno_t num_cols, typename KernelHandle::const_nnz_lno_t block_size, lno_row_view_t_ row_map, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, x_scalar_view_t x_lhs_output_vec, y_scalar_view_t y_rhs_input_vec, bool init_zero_x_vector, bool update_y_vector, typename KernelHandle::nnz_scalar_t omega, int numIter) Apply backward Block Gauss-Seidel preconditioner to system AX=Y.
- Template Parameters:
format – The matrix storage format, CRS or BSR
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The matrix’s rowmap type
lno_nnz_view_t_ – The matrix’s entries type
scalar_nnz_view_t_ – The matrix’s values type
x_scalar_view_t – The type of the X (left-hand side, unknown) vector. May be rank-1 or rank-2 View.
y_scalar_view_t – The type of the Y (right-hand side) vector. May be rank-1 or rank-2 View.
- Parameters:
handle – KernelHandle instance
num_rows – Number of rows in the matrix
num_cols – Number of columns in the matrix
block_size – The number of degrees of freedom per block
row_map – The matrix’s rowmap
entries – The matrix’s entries
values – The matrix’s values
x_lhs_output_vec – The X (left-hand side, unknown) vector
y_rhs_input_vec – The Y (right-hand side) vector
init_zero_x_vector – Whether to zero out X before applying
update_y_vector – Whether Y has changed since the last call to apply
omega – The damping factor for successive over-relaxation
numIter – How many iterations to run
- Pre:
x_lhs_output_vec.extent(0) == num_cols- Pre:
y_rhs_input_vec.extent(0) == num_rows- Pre:
x_lhs_output_vec.extent(1) == y_rhs_input_vec.extent(1)
par_ilut
-
template<typename KernelHandle, typename ARowMapType, typename AEntriesType, typename LRowMapType, typename URowMapType>
void KokkosSparse::Experimental::par_ilut_symbolic(KernelHandle *handle, ARowMapType &A_rowmap, AEntriesType &A_entries, LRowMapType &L_rowmap, URowMapType &U_rowmap) Performs the symbolic phase of par_ilut. This is a non-blocking function.
The sparsity pattern of A will be analyzed and L_rowmap and U_rowmap will be populated with the L (lower triangular) and U (upper triagular) non-zero counts respectively. Having a separate symbolic phase allows for reuse when dealing with multiple matrices with the same sparsity pattern. This routine will set some values on handle for symbolic info (row count, nnz counts).
- Template Parameters:
KernelHandle – Template for the KernelHandle type
ARowMapType – Template for A_rowmap type
AEntriesType – Template for A_entries type
LRowMapType – Template for L_rowmap type
URowMapType – Template for U_rowmap type
- Parameters:
handle – The kernel handle. It is expected that create_par_ilut_handle has been called on it
A_rowmap – The row map (row nnz offsets) for the A CSR (Input)
A_entries – The entries (column ids) for the A CSR (Input)
L_rowmap – The row map for the L CSR, should already be sized correctly (numRows+1) (Output)
U_rowmap – The row map for the U CSR, should already be sized correctly (numRows+1) (Output)
-
template<typename KernelHandle, typename ARowMapType, typename AEntriesType, typename AValuesType, typename LRowMapType, typename LEntriesType, typename LValuesType, typename URowMapType, typename UEntriesType, typename UValuesType>
void KokkosSparse::Experimental::par_ilut_numeric(KernelHandle *handle, ARowMapType &A_rowmap, AEntriesType &A_entries, AValuesType &A_values, LRowMapType &L_rowmap, LEntriesType &L_entries, LValuesType &L_values, URowMapType &U_rowmap, UEntriesType &U_entries, UValuesType &U_values) Performs the numeric phase (for specific CSRs, not reusable) of the par_ilut algorithm (described in the header). This is a non-blocking functions. It is expected that par_ilut_symbolic has already been called for the.
- Template Parameters:
KernelHandle – Template for the handle type
ARowMapType – Template for the A_rowmap type
AEntriesType – Template for the A_entries type
AValuesType – Template for the A_values type
LRowMapType – Template for the L_rowmap type
LEntriesType – Template for the L_entries type
LValuesType – Template for the L_values type
URowMapType – Template for the U_rowmap type
UEntriesType – Template for the U_entries type
UValuesType – Template for the U_values type
- Parameters:
handle – The kernel handle. It is expected that create_par_ilut_handle has been called on it
A_rowmap – The row map (row nnz offsets) for the A CSR (Input)
A_entries – The entries (column ids) for the A CSR (Input)
A_values – The values (non-zero matrix values) for the A CSR (Input)
L_rowmap – The row map (row nnz offsets) for the L CSR (Input/Output)
L_entries – The entries (column ids) for the L CSR (Output)
L_values – The values (non-zero matrix values) for the L CSR (Output)
U_rowmap – The row map (row nnz offsets) for the U CSR (Input/Output)
U_entries – The entries (column ids) for the U CSR (Output)
U_values – The values (non-zero matrix values) for the U CSR (Output)
-
template<class size_type_, class lno_t_, class scalar_t_, class ExecutionSpace, class TemporaryMemorySpace, class PersistentMemorySpace>
class PAR_ILUTHandle Handle for par_ilut. Contains useful types, par_ilut configuration settings, symbolic settings and scalar output info.
For more info, see KokkosSparse_par_ilut.hpp doxygen
Public Functions
-
inline PAR_ILUTHandle(const size_type max_iter_, const float_t residual_norm_delta_stop_, const float_t fill_in_limit_, const bool async_update_, const bool verbose_)
The A - LU residual norm at the time the algorithm finished
-
inline PAR_ILUTHandle(const size_type max_iter_, const float_t residual_norm_delta_stop_, const float_t fill_in_limit_, const bool async_update_, const bool verbose_)
gmres
-
template<typename KernelHandle, typename AMatrix, typename BType, typename XType>
void KokkosSparse::Experimental::gmres(KernelHandle *handle, AMatrix &A, BType &B, XType &X, Preconditioner<AMatrix> *precond = nullptr) - Template Parameters:
KernelHandle –
AMatrix –
BType –
XType –
- Parameters:
handle –
A –
B –
X –
precond –
sptrsv
-
template<typename ExecutionSpace, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_>
void KokkosSparse::sptrsv_symbolic(const ExecutionSpace &space, KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries) sptrsv symbolic phase for linear system Ax=b
- Template Parameters:
ExecutionSpace – This kernels execution space type
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
- Parameters:
space – The execution space instance this kernel will run on
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
-
template<typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_>
void KokkosSparse::sptrsv_symbolic(KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries) sptrsv symbolic phase for linear system Ax=b
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
- Parameters:
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
-
template<typename ExecutionSpace, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::sptrsv_symbolic(ExecutionSpace &space, KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values) sptrsv symbolic phase for linear system Ax=b
- Template Parameters:
ExecutionSpace – This kernels execution space type
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
- Parameters:
space – The execution space instance this kernel will run on
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
values – The CRS matrix’s (A) values
-
template<typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_>
void KokkosSparse::sptrsv_symbolic(KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values) sptrsv symbolic phase for linear system Ax=b
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
- Parameters:
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
values – The CRS matrix’s (A) values
-
template<typename ExecutionSpace, typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, class BType, class XType>
void KokkosSparse::sptrsv_solve(ExecutionSpace &space, KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, BType b, XType x) sptrsv solve phase of x for linear system Ax=b
- Template Parameters:
ExecutionSpace – This kernels execution space
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
scalar_nnz_view_t_ – The CRS matrix’s (A) values type
BType – The b vector type
XType – The x vector type
- Parameters:
space – The execution space instance this kernel will be run on
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
values – The CRS matrix’s (A) values
b – The b vector
x – The x vector
-
template<typename KernelHandle, typename lno_row_view_t_, typename lno_nnz_view_t_, typename scalar_nnz_view_t_, class BType, class XType>
void KokkosSparse::sptrsv_solve(KernelHandle *handle, lno_row_view_t_ rowmap, lno_nnz_view_t_ entries, scalar_nnz_view_t_ values, BType b, XType x) sptrsv solve phase of x for linear system Ax=b
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
lno_row_view_t_ – The CRS matrix’s (A) rowmap type
lno_nnz_view_t_ – The CRS matrix’s (A) entries type
scalar_nnz_view_t_ – The CRS matrix’s (A) values type
BType – The b vector type
XType – The x vector type
- Parameters:
handle – KernelHandle instance
rowmap – The CRS matrix’s (A) rowmap
entries – The CRS matrix’s (A) entries
values – The CRS matrix’s (A) values
b – The b vector
x – The x vector
-
template<typename ExecutionSpace, typename KernelHandle, class XType>
void KokkosSparse::Experimental::sptrsv_solve(ExecutionSpace &space, KernelHandle *handle, XType x, XType b) Supernodal sptrsv solve phase of x for linear system Ax=b.
- Template Parameters:
ExecutionSpace – This kernels execution space
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
XType – The x and b vector type
- Parameters:
space – The execution space instance this kernel will run on
handle – KernelHandle instance
x – The x vector
b – The b vector
-
template<typename KernelHandle, class XType>
void KokkosSparse::Experimental::sptrsv_solve(KernelHandle *handle, XType x, XType b) Supernodal sptrsv solve phase of x for linear system Ax=b.
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
XType – The x and b vector type
- Parameters:
handle – KernelHandle instance
x – The x vector
b – The b vector
-
template<typename ExecutionSpace, typename KernelHandle, class XType>
void KokkosSparse::Experimental::sptrsv_solve(ExecutionSpace &space, KernelHandle *handleL, KernelHandle *handleU, XType x, XType b) Supernodal sptrsv solve phase of x for linear system Ax=b.
- Template Parameters:
ExecutionSpace – This kernels execution space
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
XType – The x and b vector type
- Parameters:
space – The execution space instance this kernel will run on
handleL – KernelHandle instance for lower triangular matrix
handleU – KernelHandle instance for upper triangular matrix
x – The x vector
b – The b vector
-
template<typename KernelHandle, class XType>
void KokkosSparse::Experimental::sptrsv_solve(KernelHandle *handleL, KernelHandle *handleU, XType x, XType b) Supernodal sptrsv solve phase of x for linear system Ax=b.
- Template Parameters:
KernelHandle – A specialization of KokkosKernels::Experimental::KokkosKernelsHandle
XType – The x and b vector type
- Parameters:
handleL – KernelHandle instance for lower triangular matrix
handleU – KernelHandle instance for upper triangular matrix
x – The x vector
b – The b vector