#include <Kokkos_SparseOperation.hpp>
Public Member Functions | |
Constructors/Destructor | |
SparseOperation () | |
SparseOperation Constructor. | |
virtual | ~SparseOperation () |
SparseOperation Destructor. | |
Abstract Kokkos::CisMatrix Interface Initialization Methods | |
virtual int | initializeStructure (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepStructure)=0 |
Initialize structure of matrix. | |
virtual int | initializeValues (const CisMatrix< OrdinalType, ScalarType > &A, bool willKeepValues, bool checkStructure)=0 |
Initialize values of matrix. | |
Computational methods | |
virtual int | apply (const Vector< OrdinalType, ScalarType > &x, Vector< OrdinalType, ScalarType > &y, bool transA, bool conjA) const =0 |
Returns the result of a Kokkos_SparseOperation multiplied by a vector x in y. | |
virtual int | apply (const MultiVector< OrdinalType, ScalarType > &x, MultiVector< OrdinalType, ScalarType > &y, bool transA, bool conjA) const =0 |
Returns the result of a Kokkos_SparseOperation multiplied by multiple vectors in x, results in y. | |
Operator attribute access methods | |
virtual bool | getCanUseStructure () const =0 |
Returns true if this implementation of Kokkos::SparseOperation can benefit from the user keeping the passed in structure. | |
virtual bool | getCanUseValues () const =0 |
Returns true if this implementation of Kokkos::SparseOperation can benefit from the user keeping the passed in values. | |
virtual const CisMatrix < OrdinalType, ScalarType > & | getMatrix () const =0 |
Returns a reference to the most recent Kokkos::CisMatrix that was passed into the this object. | |
virtual const Permutation < OrdinalType, ScalarType > & | getLeftPermutation () const =0 |
Returns a reference to the left Kokkos::Permutation object. | |
virtual const Permutation < OrdinalType, ScalarType > & | getRightPermutation () const =0 |
Returns a reference to the right Kokkos::Permutation object, which is the identity for this implementation. |
The Kokkos::SparseOperation specifies the basic functionality that any Kokkos sparse operation must satisfy. This class is templated on the ordinal (integer) and scalar (floating point) types, so it can interface with any reasonable data type.
Constructing Kokkos::SparseOperation objects
Constructing Kokkos::SparseOperation objects is a multi-step process. The basic steps are as follows:
Counting Floating Point Operations
Each Kokkos::SparseOperation object keeps track of the number of floating point operations performed using the specified object as the this argument to the function. The getFlops() function returns this number as a double precision number. Using this information, in conjunction with the Kokkos::Time class, one can get accurate performance numbers. The resetFlops() function resets the floating point counter.
virtual int Kokkos::SparseOperation< OrdinalType, ScalarType >::apply | ( | const MultiVector< OrdinalType, ScalarType > & | x, | |
MultiVector< OrdinalType, ScalarType > & | y, | |||
bool | transA, | |||
bool | conjA | |||
) | const [pure virtual] |
Returns the result of a Kokkos_SparseOperation multiplied by multiple vectors in x, results in y.
x | (In) A Kokkos::MultiVector to operate on. | |
y | (Out) A Kokkos::MultiVector containing results. | |
transA | (In) If true, apply the transpose of matrix, otherwise just use matrix. | |
conjA | (In) If true, apply the conjugate of matrix values, otherwise just use matrix values. |
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.
virtual int Kokkos::SparseOperation< OrdinalType, ScalarType >::apply | ( | const Vector< OrdinalType, ScalarType > & | x, | |
Vector< OrdinalType, ScalarType > & | y, | |||
bool | transA, | |||
bool | conjA | |||
) | const [pure virtual] |
Returns the result of a Kokkos_SparseOperation multiplied by a vector x in y.
x | (In) A Kokkos::Vector to operate on. | |
y | (Out) A Kokkos::Vector containing results. | |
transA | (In) If true, apply the transpose of matrix, otherwise just use matrix. | |
conjA | (In) If true, applythe conjugate of matrix values, otherwise just use matrix values. |
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.
virtual bool Kokkos::SparseOperation< OrdinalType, ScalarType >::getCanUseStructure | ( | ) | const [pure virtual] |
Returns true if this implementation of Kokkos::SparseOperation can benefit from the user keeping the passed in structure.
Some implementations of optimized kernels do not rely on the user's data except for the initial analysis of structure. Other implementations, in order to reduce memory requirements, may find it beneficial to rely on the user's data. Since it is very possible that the user would retain this data anyway, we want to allow for this possibility. This method is related to the willKeepStructure parameter passed in to the initializeStructure() method.
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.
virtual bool Kokkos::SparseOperation< OrdinalType, ScalarType >::getCanUseValues | ( | ) | const [pure virtual] |
Returns true if this implementation of Kokkos::SparseOperation can benefit from the user keeping the passed in values.
Some implementations of optimized kernels do not rely on the user's data except for the initial copying of values. Other implementations, in order to reduce memory requirements, may find it beneficial to rely on the user's data. Since it is very possible that the user would retain this data anyway, we want to allow for this possibility. This method is related to the willKeepValues parameter passed in to the initializeValues() method.
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.
virtual int Kokkos::SparseOperation< OrdinalType, ScalarType >::initializeStructure | ( | const CisMatrix< OrdinalType, ScalarType > & | A, | |
bool | willKeepStructure | |||
) | [pure virtual] |
Initialize structure of matrix.
This interface supports matrices that implement the Kokkos::CisMatrix matrix interface.
A | (In) An instance of a class that implements the Kokkos::CisMatrix. All necessary information about the matrix can be obtained via this interface. | |
willKeepStructure | (In) If set to true, the user is asserting that the strucuture of the matrix, as defined in the getIndices() method of the CisMatrix object A will be kept. Specifically, the pointer to an array of indices returned for each i in that method will continue to point to valid index data. |
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.
virtual int Kokkos::SparseOperation< OrdinalType, ScalarType >::initializeValues | ( | const CisMatrix< OrdinalType, ScalarType > & | A, | |
bool | willKeepValues, | |||
bool | checkStructure | |||
) | [pure virtual] |
Initialize values of matrix.
This interface supports matrices that implement the Kokkos::CisMatrix matrix interface
A | (In) An instance of a class that implements the Kokkos::CisMatrix. All necessary information about the matrix can be obtained via this interface. | |
willKeepValues | (In) If set to true, the user is asserting that the strucuture of the matrix, as defined in the getIndices() method of the CisMatrix object A will be kept. Specifically, the pointer to an array of indices returned for each i in that method will continue to point to valid index data | |
checkStructure | (In) If set to true, the structure of A will be checked against the structure of the matrix passed in to the initializeStructure() methods. |
Implemented in Kokkos::BaseSparseMultiply< OrdinalType, ScalarType >, Kokkos::BaseSparseSolve< OrdinalType, ScalarType >, Kokkos::OskiSparseMultiply< OrdinalType, ScalarType >, and Kokkos::PackedSparseMultiply< OrdinalType, ScalarType >.