Stokhos Development
Loading...
Searching...
No Matches
Stokhos::CrsProductTensor< ValueType, ExecutionSpace, Memory > Class Template Reference

Sparse product tensor with replicated entries to provide subsets with a given coordinate. More...

#include <Stokhos_CrsProductTensor.hpp>

Public Types

typedef ExecutionSpace execution_space
typedef int size_type
typedef ValueType value_type
typedef Memory memory_type
typedef Kokkos::ViewTraits< size_type *, execution_space, void, void >::host_mirror_space host_mirror_space
typedef CrsProductTensor< value_type, host_mirror_space > HostMirror

Public Member Functions

template<class M>
KOKKOS_INLINE_FUNCTION CrsProductTensor (const CrsProductTensor< value_type, execution_space, M > &rhs)
template<class M>
KOKKOS_INLINE_FUNCTION CrsProductTensor & operator= (const CrsProductTensor< value_type, execution_space, M > &rhs)
KOKKOS_INLINE_FUNCTION size_type dimension () const
 Dimension of the tensor.
KOKKOS_INLINE_FUNCTION bool is_empty () const
 Is the tensor empty.
KOKKOS_INLINE_FUNCTION size_type entry_count () const
 Number of sparse entries.
KOKKOS_INLINE_FUNCTION size_type entry_maximum () const
 Maximum sparse entries for any coordinate.
KOKKOS_INLINE_FUNCTION size_type entry_begin (size_type i) const
 Begin entries with a coordinate 'i'.
KOKKOS_INLINE_FUNCTION size_type entry_end (size_type i) const
 End entries with a coordinate 'i'.
KOKKOS_INLINE_FUNCTION size_type num_entry (size_type i) const
 Number of entries with a coordinate 'i'.
KOKKOS_INLINE_FUNCTION const size_type & coord (const size_type entry, const size_type c) const
 Coordinates of an entry.
KOKKOS_INLINE_FUNCTION const size_type & coord (const size_type entry) const
 Coordinates of an entry.
KOKKOS_INLINE_FUNCTION const value_type & value (const size_type entry) const
 Value of an entry.
KOKKOS_INLINE_FUNCTION size_type num_non_zeros () const
 Number of non-zero's.
KOKKOS_INLINE_FUNCTION size_type num_flops () const
 Number flop's per multiply-add.
KOKKOS_INLINE_FUNCTION size_type avg_entries_per_row () const
 Number average number of entries per row.

Static Public Member Functions

template<typename OrdinalType>
static CrsProductTensor create (const Stokhos::ProductBasis< OrdinalType, ValueType > &basis, const Stokhos::Sparse3Tensor< OrdinalType, ValueType > &Cijk, const Teuchos::ParameterList &params=Teuchos::ParameterList())
static CrsProductTensor createMeanBased ()
static HostMirror create_mirror_view (const CrsProductTensor &tensor)
template<class DstDevice, class DstMemory>
static void deep_copy (const CrsProductTensor< ValueType, DstDevice, DstMemory > &dst, const CrsProductTensor &src)

Static Public Attributes

static const size_type host_vectorsize = 2
static const bool use_intrinsics = false
static const size_type num_entry_align = 1
static const size_type cuda_vectorsize = 32
static const bool is_cuda
static const size_type vectorsize = is_cuda ? cuda_vectorsize : host_vectorsize
static const size_type tensor_align = vectorsize

Detailed Description

template<typename ValueType, class ExecutionSpace, class Memory = void>
class Stokhos::CrsProductTensor< ValueType, ExecutionSpace, Memory >

Sparse product tensor with replicated entries to provide subsets with a given coordinate.

This allows product tensor multiplication to be partitioned on a given coordinate values.

for ( size_type i = 0 ; i < p.dimension() ; ++i ) { y[i] = 0 ; for ( size_type e = p.entry_begin(i) ; e < p.entry_end(i) ; ++e ) { const size_type j = p.coord(e,0); const size_type k = p.coord(e,1); Scalar tmp = a[j] * x[k] ; if ( j != k ) tmp += a[k] * x[j] ; y[i] += p.value(e) * tmp ; } }

Member Data Documentation

◆ is_cuda

template<typename ValueType, class ExecutionSpace, class Memory = void>
const bool Stokhos::CrsProductTensor< ValueType, ExecutionSpace, Memory >::is_cuda
static
Initial value:
=
false

The documentation for this class was generated from the following file: