Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_Cuda_StochasticProductTensor.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_CUDA_STOCHASTICPRODUCTTENSOR_HPP
11 #define STOKHOS_CUDA_STOCHASTICPRODUCTTENSOR_HPP
12 
13 #include "Kokkos_Core.hpp"
14 
15 #include "Stokhos_Multiply.hpp"
18 
19 namespace Stokhos {
20 
21 //----------------------------------------------------------------------------
22 //----------------------------------------------------------------------------
23 
24 template< typename TensorScalar ,
25  typename MatrixScalar ,
26  typename VectorScalar ,
27  typename TensorType >
28 class Multiply<
30  StochasticProductTensor<TensorScalar, TensorType, Kokkos::Cuda>,
31  MatrixScalar, Kokkos::Cuda> ,
32  Kokkos::View<VectorScalar**, Kokkos::LayoutLeft, Kokkos::Cuda>,
33  Kokkos::View<VectorScalar**, Kokkos::LayoutLeft, Kokkos::Cuda> >
34 {
35 public:
36 
37  typedef Kokkos::Cuda execution_space ;
38  typedef execution_space::size_type size_type ;
39 
42  typedef Kokkos::View< VectorScalar** , Kokkos::LayoutLeft , Kokkos::Cuda > vector_type ;
43 
44 
45  static void apply( const matrix_type & A ,
46  const vector_type & x ,
47  const vector_type & y )
48  {
50 
52  base_multiply_type ;
53 
54  base_matrix_type base_matrix ;
55 
56  base_matrix.values = A.values ;
57  base_matrix.graph = A.graph ;
58  base_matrix.block = A.block.tensor();
59 
60  base_multiply_type::apply( base_matrix , x , y );
61  }
62 };
63 
64 //----------------------------------------------------------------------------
65 //----------------------------------------------------------------------------
66 
67 } // namespace Stokhos
68 
69 #endif /* #ifndef STOKHOS_CUDA_STOCHASTICPRODUCTTENSOR_HPP */
Bases defined by combinatorial product of polynomial bases.
CRS matrix of dense blocks.