Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Classes
Kokkos::CUSPARSEOps< Scalar, Node > Class Template Reference

Default implementation of sparse matrix-vector multiply and solve routines, for host-based Kokkos Node types. More...

#include <Kokkos_CUSPARSEOps.hpp>

List of all members.

Classes

struct  bind_scalar
 Sparse operations type for a different scalar type. More...
struct  graph
 Typedef for local graph class. More...
struct  matrix
 Typedef for local matrix class. More...

Public Types

Typedefs and structs
typedef Scalar scalar_type
 The type of the individual entries of the sparse matrix.
typedef int ordinal_type
 The type of the (local) indices describing the structure of the sparse matrix.
typedef Node node_type
 The Kokkos Node type.
typedef CUSPARSEOps< Scalar, Node > sparse_ops_type
 The type of this object, the sparse operator object.

Public Member Functions

Constructors/Destructor
 CUSPARSEOps (const RCP< Node > &node)
 Constructor accepting and retaining a node object.
 ~CUSPARSEOps ()
 Destructor.
Accessor routines.
RCP< Node > getNode () const
 The Kokkos Node with which this object was instantiated.
Computational methods
template<class DomainScalar , class RangeScalar >
void multiply (Teuchos::ETransp trans, RangeScalar alpha, const MultiVector< DomainScalar, Node > &X, MultiVector< RangeScalar, Node > &Y) const
 Y := alpha * Op(A) * X.
template<class DomainScalar , class RangeScalar >
void multiply (Teuchos::ETransp trans, RangeScalar alpha, const MultiVector< DomainScalar, Node > &X, RangeScalar beta, MultiVector< RangeScalar, Node > &Y) const
 Y := Y + alpha * Op(A) * X.
template<class DomainScalar , class RangeScalar >
void solve (Teuchos::ETransp trans, const MultiVector< DomainScalar, Node > &Y, MultiVector< RangeScalar, Node > &X) const
 Solve Y = Op(A) X for X, where we assume A is triangular.

Initialization of graph and matrix

void setGraphAndMatrix (const RCP< const CUSPARSECrsGraph< Node > > &graph, const RCP< const CUSPARSECrsMatrix< Scalar, Node > > &matrix)
 Initialize sparse operations with a graph and matrix.
static ArrayRCP< size_t > allocRowPtrs (const RCP< Node > &node, const ArrayView< const size_t > &rowPtrs)
 Allocate and initialize the storage for the matrix values.
template<class T >
static ArrayRCP< T > allocStorage (const RCP< Node > &node, const ArrayView< const size_t > &ptrs)
 Allocate and initialize the storage for a sparse graph.
static void finalizeGraph (Teuchos::EUplo uplo, Teuchos::EDiag diag, CUSPARSECrsGraph< Node > &graph, const RCP< ParameterList > &params)
 Finalize a graph is null for CUSPARSE.
static void finalizeMatrix (const CUSPARSECrsGraph< Node > &graph, CUSPARSECrsMatrix< Scalar, Node > &matrix, const RCP< ParameterList > &params)
 Finalize the matrix of an already-finalized graph.
static void finalizeGraphAndMatrix (Teuchos::EUplo uplo, Teuchos::EDiag diag, CUSPARSECrsGraph< Node > &graph, CUSPARSECrsMatrix< Scalar, Node > &matrix, const RCP< ParameterList > &params)
 Finalize a graph and a matrix.

Detailed Description

template<class Scalar, class Node>
class Kokkos::CUSPARSEOps< Scalar, Node >

Default implementation of sparse matrix-vector multiply and solve routines, for host-based Kokkos Node types.

Template Parameters:
ScalarThe type of entries of the sparse matrix.
NodeThe Kokkos Node type.

Definition at line 560 of file Kokkos_CUSPARSEOps.hpp.


Member Typedef Documentation

template<class Scalar , class Node >
typedef Scalar Kokkos::CUSPARSEOps< Scalar, Node >::scalar_type

The type of the individual entries of the sparse matrix.

Definition at line 566 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
typedef int Kokkos::CUSPARSEOps< Scalar, Node >::ordinal_type

The type of the (local) indices describing the structure of the sparse matrix.

Definition at line 568 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
typedef Node Kokkos::CUSPARSEOps< Scalar, Node >::node_type

The Kokkos Node type.

Definition at line 570 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
typedef CUSPARSEOps<Scalar,Node> Kokkos::CUSPARSEOps< Scalar, Node >::sparse_ops_type

The type of this object, the sparse operator object.

Definition at line 572 of file Kokkos_CUSPARSEOps.hpp.


Constructor & Destructor Documentation

template<class Scalar , class Node >
Kokkos::CUSPARSEOps< Scalar, Node >::CUSPARSEOps ( const RCP< Node > &  node)

Constructor accepting and retaining a node object.

Definition at line 979 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
Kokkos::CUSPARSEOps< Scalar, Node >::~CUSPARSEOps ( )

Destructor.

Definition at line 991 of file Kokkos_CUSPARSEOps.hpp.


Member Function Documentation

template<class Scalar , class Node >
RCP< Node > Kokkos::CUSPARSEOps< Scalar, Node >::getNode ( ) const

The Kokkos Node with which this object was instantiated.

Definition at line 995 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
ArrayRCP< size_t > Kokkos::CUSPARSEOps< Scalar, Node >::allocRowPtrs ( const RCP< Node > &  node,
const ArrayView< const size_t > &  rowPtrs 
) [static]

Allocate and initialize the storage for the matrix values.

Definition at line 955 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
template<class T >
ArrayRCP< T > Kokkos::CUSPARSEOps< Scalar, Node >::allocStorage ( const RCP< Node > &  node,
const ArrayView< const size_t > &  ptrs 
) [static]

Allocate and initialize the storage for a sparse graph.

Definition at line 969 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
void Kokkos::CUSPARSEOps< Scalar, Node >::finalizeGraph ( Teuchos::EUplo  uplo,
Teuchos::EDiag  diag,
CUSPARSECrsGraph< Node > &  graph,
const RCP< ParameterList > &  params 
) [static]

Finalize a graph is null for CUSPARSE.

Definition at line 765 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
void Kokkos::CUSPARSEOps< Scalar, Node >::finalizeMatrix ( const CUSPARSECrsGraph< Node > &  graph,
CUSPARSECrsMatrix< Scalar, Node > &  matrix,
const RCP< ParameterList > &  params 
) [static]

Finalize the matrix of an already-finalized graph.

Definition at line 836 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
void Kokkos::CUSPARSEOps< Scalar, Node >::finalizeGraphAndMatrix ( Teuchos::EUplo  uplo,
Teuchos::EDiag  diag,
CUSPARSECrsGraph< Node > &  graph,
CUSPARSECrsMatrix< Scalar, Node > &  matrix,
const RCP< ParameterList > &  params 
) [static]

Finalize a graph and a matrix.

Definition at line 933 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
void Kokkos::CUSPARSEOps< Scalar, Node >::setGraphAndMatrix ( const RCP< const CUSPARSECrsGraph< Node > > &  graph,
const RCP< const CUSPARSECrsMatrix< Scalar, Node > > &  matrix 
)

Initialize sparse operations with a graph and matrix.

Definition at line 1000 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CUSPARSEOps< Scalar, Node >::multiply ( Teuchos::ETransp  trans,
RangeScalar  alpha,
const MultiVector< DomainScalar, Node > &  X,
MultiVector< RangeScalar, Node > &  Y 
) const

Y := alpha * Op(A) * X.

Apply the local sparse matrix A (or its transpose or conjugate transpose) to a multivector X, overwriting Y with the result. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to apply the matrix, its transpose, or its conjugate transpose (if applicable).
alpha[in] Scalar constant $\alpha$ by which to multiply the result: $Y := \alpha A X$.
X[in] Input multivector.
Y[out] Result multivector.

Definition at line 1084 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CUSPARSEOps< Scalar, Node >::multiply ( Teuchos::ETransp  trans,
RangeScalar  alpha,
const MultiVector< DomainScalar, Node > &  X,
RangeScalar  beta,
MultiVector< RangeScalar, Node > &  Y 
) const

Y := Y + alpha * Op(A) * X.

Apply the local sparse matrix A (or its transpose or conjugate transpose) to a multivector X, accumulating the result into Y. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to apply the matrix, its transpose, or its conjugate transpose (if applicable).
alpha[in] Scalar constant $\alpha$ by which to multiply the result: $Y := Y + \alpha A X$.
X[in] Input multivector.
Y[in/out] Result multivector.

Definition at line 1153 of file Kokkos_CUSPARSEOps.hpp.

template<class Scalar , class Node >
template<class DomainScalar , class RangeScalar >
void Kokkos::CUSPARSEOps< Scalar, Node >::solve ( Teuchos::ETransp  trans,
const MultiVector< DomainScalar, Node > &  Y,
MultiVector< RangeScalar, Node > &  X 
) const

Solve Y = Op(A) X for X, where we assume A is triangular.

Solve the (upper or lower) triangular system Y = Op(A) X. Op(A) means A, the transpose of A, or the conjugate transpose of A, depending on the trans argument.

Template Parameters:
DomainScalarThe type of entries in the input multivector X. This may differ from the type of entries in A or in Y.
RangeScalarThe type of entries in the output multivector Y. This may differ from the type of entries in A or in X.
Parameters:
trans[in] Whether to solve with the matrix, its transpose, or its conjugate transpose (if applicable).
uplo[in] UPPER_TRI if the matrix is upper triangular, else LOWER_TRI if the matrix is lower triangular.
diag[in] UNIT_DIAG if the matrix has an implicit unit diagonal, else NON_UNIT_DIAG (diagonal entries are explicitly stored in the matrix).
Y[in] Input multivector.
X[out] Result multivector.

Definition at line 1019 of file Kokkos_CUSPARSEOps.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends