Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Kokkos_View_MP_Vector_Utils.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 KOKKOS_VIEW_MP_VECTOR_UTILS_HPP
11 #define KOKKOS_VIEW_MP_VECTOR_UTILS_HPP
12 
13 #include "Kokkos_View_Utils.hpp"
14 #include "Sacado_MP_Vector.hpp"
15 
16 namespace Kokkos {
17 
18 // Type name for a local, unmanaged view with possibly a different static size
19 template <typename ViewType,
20  unsigned LocalSize,
21  bool isStatic = Sacado::IsStaticallySized<typename ViewType::value_type>::value>
23 
24 template <typename ViewType, unsigned LocalSize>
25 struct LocalMPVectorView<ViewType, LocalSize, false> {
26  typedef ViewType type;
27 };
28 
29 template <typename D, typename ... P, unsigned LocalSize>
30 struct LocalMPVectorView< View<D,P...>, LocalSize, true > {
31  typedef typename Kokkos::Impl::ViewMapping< void, typename Kokkos::ViewTraits<D,P...>, Sacado::MP::VectorPartition<LocalSize> >::type type;
32 };
33 
34 namespace Impl {
35 
36 template< class OldStorageType , class Device >
37 struct RebindStokhosStorageDevice< Sacado::MP::Vector< OldStorageType > , Device >
38 {
39  typedef typename
40  OldStorageType::template apply<
43  Device >
45 
46  typedef typename NewStorageApply::type NewStorageType ;
47  typedef typename Sacado::MP::Vector< OldStorageType >::template apply< NewStorageType > NewVectorApply ;
48 
49  typedef typename NewVectorApply::type type ;
50 };
51 
52 template< class OldStorageType , class Device >
53 struct RebindStokhosStorageDevice< const Sacado::MP::Vector< OldStorageType > , Device >
54 {
55  typedef typename
56  OldStorageType::template apply<
59  Device >
61 
62  typedef typename NewStorageApply::type NewStorageType ;
63  typedef typename Sacado::MP::Vector< OldStorageType >::template apply< NewStorageType > NewVectorApply ;
64 
65  typedef const typename NewVectorApply::type type ;
66 };
67 
68 } // namespace Impl
69 
70 // Whether a given type is a view with scalar type Sacado::MP::Vector
71 template <typename view_type>
72 struct is_view_mp_vector { static const bool value = false; };
73 
74 } // namespace Kokkos
75 
76 #endif // KOKKOS_VIEW_MP_VECTOR_UTILS_HPP
OldStorageType::template apply< typename OldStorageType::ordinal_type, typename OldStorageType::value_type, Device > NewStorageApply
OldStorageType::template apply< typename OldStorageType::ordinal_type, typename OldStorageType::value_type, Device > NewStorageApply
Sacado::MP::Vector< OldStorageType >::template apply< NewStorageType > NewVectorApply
Sacado::MP::Vector< OldStorageType >::template apply< NewStorageType > NewVectorApply
Kokkos::Impl::ViewMapping< void, typename Kokkos::ViewTraits< D, P...>, Sacado::MP::VectorPartition< LocalSize > >::type type