10 #ifndef STOKHOS_BLOCKCRSMATRIX_HPP
11 #define STOKHOS_BLOCKCRSMATRIX_HPP
13 #include "Kokkos_Core.hpp"
14 #include "Kokkos_StaticCrsGraph.hpp"
28 template <
typename BlockSpec,
typename ValueType,
class Device>
33 typedef typename execution_space::size_type
size_type;
36 typedef Kokkos::StaticCrsGraph< size_type , execution_space >
graph_type;
37 typedef Kokkos::View< value_type**, Kokkos::LayoutLeft, execution_space >
block_vector_type ;
44 template <
typename BlockSpec,
49 Kokkos::
View< VectorValue**, Kokkos::LayoutLeft, Device >,
50 Kokkos::View< VectorValue**, Kokkos::LayoutLeft, Device > >
77 KOKKOS_INLINE_FUNCTION
82 VectorValue *
const y = & m_y(0,iBlockRow);
84 const size_type iEntryBegin = m_A.graph.row_map[ iBlockRow ];
85 const size_type iEntryEnd = m_A.graph.row_map[ iBlockRow + 1 ];
88 for (
size_type j = 0 ;
j < m_A.block.dimension() ; ++
j ) { y[
j] = 0 ; }
90 for (
size_type iEntry = iEntryBegin ; iEntry < iEntryEnd ; ++iEntry ) {
91 const VectorValue *
const x = & m_x( 0 , m_A.graph.entries(iEntry) );
92 const MatrixValue *
const a = & m_A.values( 0 , iEntry );
103 const size_t row_count = A.
graph.row_map.extent(0) - 1;
104 Kokkos::parallel_for( row_count ,
Multiply(A,x,y) );
BlockCrsMatrix< BlockSpec, MatrixValue, Device > matrix_type
BlockSpec::size_type size_type
execution_space::size_type size_type
KOKKOS_INLINE_FUNCTION void operator()(const size_type iBlockRow) const
Kokkos::View< VectorValue **, Kokkos::LayoutLeft, Device > block_vector_type
Multiply(const matrix_type &A, const block_vector_type &x, block_vector_type &y)
Kokkos::View< value_type **, Kokkos::LayoutLeft, execution_space > block_vector_type
Kokkos::StaticCrsGraph< size_type, execution_space > graph_type
CRS matrix of dense blocks.
const block_vector_type m_x
static void apply(const matrix_type &A, const block_vector_type &x, block_vector_type &y)