Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Classes | Protected Member Functions | Private Attributes
Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node > Class Template Reference

Sparse matrix-vector multiplication and solve routines with first-touch allocation of matrix data.Effectively, this class is identical to DefaultSparseOps, except for the allocRowPtrs() and allocStorage() methods, which are modified to use a first-touch allocation. The relationship is done using private inheritence, though this class should never be accessed via a reference to its parent class. (Tpetra is unaware this relationship, and so will never do that.) More...

#include <Kokkos_FirstTouchSparseOps.hpp>

Inheritance diagram for Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >:
Inheritance graph
[legend]

List of all members.

Classes

struct  bind_scalar
 Rebind struct, for specifying type information for a different scalar. More...

Public Types

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

Public Member Functions

Constructors/Destructor
 FirstTouchSparseOps (const RCP< Node > &node)
 Constructor accepting and retaining a node object.
virtual ~FirstTouchSparseOps ()
 Destructor.

Static Public Member Functions

Overloaded from DefaultHostSparseOps for first-touch allocation.
static ArrayRCP< size_t > allocRowPtrs (const RCP< Node > &node, const ArrayView< const size_t > &numEntriesPerRow)
 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 > &rowPtrs)
 Allocate and initialize the storage for a sparse graph.

Protected Member Functions

 FirstTouchSparseOps (const DefaultHostSparseOps< Scalar, Ordinal, Node > &source)
 Copy constructor (protected and unimplemented)

Private Member Functions

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 := beta * 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.

Private Attributes

RCP< Node > node_
 The Kokkos Node instance given to this object's constructor.

Initialization of graph and matrix

void setGraphAndMatrix (const RCP< const DefaultCrsGraph< Ordinal, Node > > &graph, const RCP< const DefaultCrsMatrix< Scalar, Ordinal, Node > > &matrix)
static void finalizeGraph (Teuchos::EUplo uplo, Teuchos::EDiag diag, DefaultCrsGraph< Ordinal, Node > &graph, const RCP< ParameterList > &params)
 Finalize a graph.
static void finalizeMatrix (const DefaultCrsGraph< Ordinal, Node > &graph, DefaultCrsMatrix< Scalar, Ordinal, Node > &matrix, const RCP< ParameterList > &params)
 Finalize the matrix of an already-finalized graph.
static void finalizeGraphAndMatrix (Teuchos::EUplo uplo, Teuchos::EDiag diag, DefaultCrsGraph< Ordinal, Node > &graph, DefaultCrsMatrix< Scalar, Ordinal, Node > &matrix, const RCP< ParameterList > &params)
 Finalize a graph and a matrix.

Detailed Description

template<class Scalar, class Ordinal, class Node>
class Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >

Sparse matrix-vector multiplication and solve routines with first-touch allocation of matrix data.

Effectively, this class is identical to DefaultSparseOps, except for the allocRowPtrs() and allocStorage() methods, which are modified to use a first-touch allocation. The relationship is done using private inheritence, though this class should never be accessed via a reference to its parent class. (Tpetra is unaware this relationship, and so will never do that.)

Definition at line 50 of file Kokkos_FirstTouchSparseOps.hpp.


Member Typedef Documentation

template<class Scalar , class Ordinal , class Node >
typedef Scalar Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::scalar_type

The type of the individual entries of the sparse matrix.

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 56 of file Kokkos_FirstTouchSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Ordinal Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::ordinal_type

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

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 58 of file Kokkos_FirstTouchSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef Node Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::node_type

The Kokkos Node type.

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 60 of file Kokkos_FirstTouchSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
typedef FirstTouchSparseOps<Scalar,Ordinal,Node> Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::sparse_ops_type

The type of this object, the sparse operator object.

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 62 of file Kokkos_FirstTouchSparseOps.hpp.


Constructor & Destructor Documentation

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

Constructor accepting and retaining a node object.

Definition at line 177 of file Kokkos_FirstTouchSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::~FirstTouchSparseOps ( ) [virtual]

Destructor.

Definition at line 182 of file Kokkos_FirstTouchSparseOps.hpp.

template<class Scalar , class Ordinal , class Node >
Kokkos::FirstTouchSparseOps< Scalar, Ordinal, Node >::FirstTouchSparseOps ( const DefaultHostSparseOps< Scalar, Ordinal, Node > &  source) [protected]

Copy constructor (protected and unimplemented)


Member Function Documentation

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

Allocate and initialize the storage for the matrix values.

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 138 of file Kokkos_FirstTouchSparseOps.hpp.

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

Allocate and initialize the storage for a sparse graph.

Reimplemented from Kokkos::DefaultHostSparseOps< Scalar, Ordinal, Node >.

Definition at line 158 of file Kokkos_FirstTouchSparseOps.hpp.


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