Tpetra parallel linear algebra
Version of the Day
|
Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or multivector. More...
#include <Tpetra_Experimental_BlockView.hpp>
Public Types | |
typedef Kokkos::LayoutRight | array_layout |
Data layout (in the same sense as Kokkos::View). More... | |
Public Member Functions | |
LittleVector (Scalar *const A, const LO blockSize, const LO strideX) | |
Constructor. More... | |
template<class T > | |
LittleVector (T *const A, const LO blockSize, const LO strideX, typename std::enable_if< !std::is_same< Scalar, T >::value &&std::is_convertible< Scalar, T >::value &&sizeof(Scalar)==sizeof(T), int * >::type ignoreMe=NULL) | |
Constructor that takes an impl_scalar_type pointer. More... | |
Scalar * | getRawPtr () const |
Pointer to the vector's entries. More... | |
Scalar * | ptr_on_device () const |
Pointer to the vector's entries. More... | |
LO | getBlockSize () const |
The block size (number of degrees of freedom per mesh point). More... | |
LO | dimension_0 () const |
Number of entries in the vector. More... | |
LO | size () const |
Number of entries in the vector. More... | |
LO | getStride () const |
Stride between consecutive entries. More... | |
template<class IntegerType > | |
void | stride (IntegerType *const s) const |
Stride between consecutive entries. More... | |
impl_scalar_type & | operator() (const LO i) const |
Reference to entry (i) of the vector. More... | |
Static Public Attributes | |
static const int | rank = 1 |
Number of dimensions. More... | |
Nonowning view of a set of degrees of freedom corresponding to a mesh point in a block vector or multivector.
Scalar | The type of entries. |
LO | The type of local indices. See the documentation of the first template parameter of Map for requirements. |
"Little" means local (not distributed over multiple MPI processes; stored to maximize locality) and small (think length 3, not length 1000).
The Scalar
template parameter may be const or nonconst. This is one reason why instance methods below that take a LittleVector accept it as a template parameter: that lets you add a const LittleVector (e.g., LittleVector<const double, int>) to a nonconst LittleVector (e.g., LittleVector<double, int>).
Definition at line 1259 of file Tpetra_Experimental_BlockView.hpp.
typedef Kokkos::LayoutRight Tpetra::Experimental::LittleVector< Scalar, LO >::array_layout |
Data layout (in the same sense as Kokkos::View).
Definition at line 1272 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Constructor.
A | [in] Pointer to the vector's entries |
blockSize | [in] Dimension of the vector |
strideX | [in] Stride between consecutive entries |
Definition at line 1278 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Constructor that takes an impl_scalar_type
pointer.
A | [in] Pointer to the vector's entries, as impl_scalar_type* rather than Scalar* |
blockSize | [in] Dimension of the vector |
strideX | [in] Stride between consecutive entries |
While this constructor is templated on a type T
, the intent is that T == impl_scalar_type
. (We must template on T rather than using impl_scalar_type
directly, because of how std::enable_if works.) The long, complicated std::enable_if expression ensures that this constructor only exists if Scalar
differs from impl_scalar_type
, but the two types are mutually compatible and have the same size. (They must be bitwise compatible, so that reinterpret_cast
makes sense between them.)
Definition at line 1301 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Pointer to the vector's entries.
Definition at line 1315 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Pointer to the vector's entries.
Definition at line 1320 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
The block size (number of degrees of freedom per mesh point).
Definition at line 1325 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Number of entries in the vector.
Definition at line 1330 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Number of entries in the vector.
Definition at line 1335 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Stride between consecutive entries.
Definition at line 1340 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Stride between consecutive entries.
This exists for compatibility with Kokkos::View.
Definition at line 1348 of file Tpetra_Experimental_BlockView.hpp.
|
inline |
Reference to entry (i) of the vector.
impl_scalar_type
and not as Scalar
, in order to avoid a lot of reinterpret_cast calls in the inner loop of the sparse matrix-vector multiply kernel of Tpetra::Experimental::BlockCrsMatrix. Any pair of types impl_scalar_type
, Scalar
used here should always be convertible in either direction, so the return type should not pose any issues in practice. Definition at line 1362 of file Tpetra_Experimental_BlockView.hpp.
|
static |
Number of dimensions.
Definition at line 1269 of file Tpetra_Experimental_BlockView.hpp.