42#ifndef KOKKOS_EXPERIMENTAL_VIEW_MP_VECTOR_CONTIGUOUS_HPP
43#define KOKKOS_EXPERIMENTAL_VIEW_MP_VECTOR_CONTIGUOUS_HPP
50#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
51#define KOKKOS_IMPL_PUBLIC_INCLUDE
52#define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
54#include "Kokkos_Layout.hpp"
55#ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
56#undef KOKKOS_IMPL_PUBLIC_INCLUDE
57#undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
66namespace Experimental {
71template<
class ... Args >
74template<
class D ,
class ... P ,
class ... Args >
77 std::is_same<
typename Kokkos::ViewTraits<D,P...>::specialize
80 ( (
sizeof...(Args) == 0 ) ||
90template <
typename T,
typename ... P>
94 std::is_same<
typename view_type::specialize,
98template <
typename T,
typename ... P>
103 return view.impl_map().dimension_scalar();
110#include "Sacado_Traits.hpp"
113#include "Kokkos_Core.hpp"
117template <
typename D,
typename ... P>
119 typename
std::enable_if< is_view_mp_vector< View<D,P...> >::value >
::type > {
121 typedef typename view_type::traits::dimension
dimension;
123 typedef typename Kokkos::Impl::ViewDataType< flat_value_type , dimension >::type
flat_data_type;
127template<
class T ,
class ... P >
129typename std::enable_if<
130 std::is_same<
typename ViewTraits<T,P...>::specialize ,
132 !std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
133 Kokkos::LayoutStride >::value,
134 typename Kokkos::View<T,P...>::HostMirror>
::type
137 typedef View<T,P...> src_type ;
138 typedef typename src_type::HostMirror dst_type ;
140 typename src_type::array_layout layout = src.layout();
143 return dst_type(std::string(src.label()).append(
"_mirror"), layout);
146template<
class T ,
class ... P >
148typename std::enable_if<
149 std::is_same<
typename ViewTraits<T,P...>::specialize ,
151 std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
152 Kokkos::LayoutStride >::value,
153 typename Kokkos::View<T,P...>::HostMirror>::type
156 typedef View<T,P...> src_type ;
157 typedef typename src_type::HostMirror dst_type ;
159 Kokkos::LayoutStride layout ;
161 layout.dimension[0] = src.extent(0);
162 layout.dimension[1] = src.extent(1);
163 layout.dimension[2] = src.extent(2);
164 layout.dimension[3] = src.extent(3);
165 layout.dimension[4] = src.extent(4);
166 layout.dimension[5] = src.extent(5);
167 layout.dimension[6] = src.extent(6);
168 layout.dimension[7] = src.extent(7);
170 layout.stride[0] = src.stride_0();
171 layout.stride[1] = src.stride_1();
172 layout.stride[2] = src.stride_2();
173 layout.stride[3] = src.stride_3();
174 layout.stride[4] = src.stride_4();
175 layout.stride[5] = src.stride_5();
176 layout.stride[6] = src.stride_6();
177 layout.stride[7] = src.stride_7();
181 return dst_type(std::string(src.label()).append(
"_mirror"), layout);
184template<
class Space,
class T,
class ... P,
typename Enabled>
185typename std::enable_if<
186 std::is_same<
typename ViewTraits<T,P...>::specialize ,
188 typename Impl::MirrorType<Space,T,P ...>::view_type>::type
191 typedef View<T,P...> src_type ;
192 typename src_type::array_layout layout = src.layout();
197template<
class T ,
class ... P >
199typename std::enable_if<
200 std::is_same<
typename ViewTraits<T,P...>::specialize ,
202 !std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
203 Kokkos::LayoutStride >::value,
204 typename Kokkos::View<T,P...>::HostMirror>::type
206 const Kokkos::View<T,P...> & src)
208 typedef View<T,P...> src_type ;
209 typedef typename src_type::HostMirror dst_type ;
211 typename src_type::array_layout layout = src.layout();
215 Kokkos::view_alloc(std::string(src.label()).append(
"_mirror"), wi), layout);
218template<
class T ,
class ... P >
220typename std::enable_if<
221 std::is_same<
typename ViewTraits<T,P...>::specialize ,
223 std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
224 Kokkos::LayoutStride >::value,
225 typename Kokkos::View<T,P...>::HostMirror>::type
227 const Kokkos::View<T,P...> & src)
229 typedef View<T,P...> src_type ;
230 typedef typename src_type::HostMirror dst_type ;
232 Kokkos::LayoutStride layout ;
234 layout.dimension[0] = src.extent(0);
235 layout.dimension[1] = src.extent(1);
236 layout.dimension[2] = src.extent(2);
237 layout.dimension[3] = src.extent(3);
238 layout.dimension[4] = src.extent(4);
239 layout.dimension[5] = src.extent(5);
240 layout.dimension[6] = src.extent(6);
241 layout.dimension[7] = src.extent(7);
243 layout.stride[0] = src.stride_0();
244 layout.stride[1] = src.stride_1();
245 layout.stride[2] = src.stride_2();
246 layout.stride[3] = src.stride_3();
247 layout.stride[4] = src.stride_4();
248 layout.stride[5] = src.stride_5();
249 layout.stride[6] = src.stride_6();
250 layout.stride[7] = src.stride_7();
255 Kokkos::view_alloc(std::string(src.label()).append(
"_mirror"), wi), layout);
258template<
class Space,
class T,
class ... P,
typename Enable>
259typename std::enable_if<
260 std::is_same<
typename ViewTraits<T,P...>::specialize ,
262 typename Impl::MirrorType<Space,T,P ...>::view_type>::type
264 const Space&,
const Kokkos::View<T,P...> & src)
266 typedef View<T,P...> src_type ;
267 typename src_type::array_layout layout = src.layout();
270 Kokkos::view_alloc(src.label(), wi), layout);
273template <
class Space,
class T,
class... P>
274typename Impl::MirrorViewType<Space, T, P...>::view_type
276 const Space&,
const Kokkos::View<T, P...>& src,
277 std::string
const& name,
278 typename std::enable_if<
279 std::is_same<
typename ViewTraits<T, P...>::specialize,
285 "Kokkos::create_mirror_view_and_copy: fence before returning src view");
289template <
class Space,
class T,
class... P>
290typename Impl::MirrorViewType<Space, T, P...>::view_type
292 const Space&,
const Kokkos::View<T, P...>& src,
293 std::string
const& name,
294 typename std::enable_if<
295 std::is_same<
typename ViewTraits<T, P...>::specialize,
299 using src_type =
View<T,P...>;
301 std::string label = name.empty() ? src.label() : name;
302 typename src_type::array_layout layout = src.layout();
304 auto mirror =
typename Mirror::non_const_type{
305 view_alloc(WithoutInitializing, label), layout};
311template<
class DT,
class ... DP >
315 ,
typename std::enable_if<(
316 std::is_same<
typename ViewTraits<DT,DP...>::specialize
321 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
322 typename ViewTraits<DT,DP...>::non_const_value_type >::value
323 ,
"Can only deep copy into non-const type" );
330template<
class DT,
class ... DP >
334 ,
typename std::enable_if<(
335 std::is_same<
typename ViewTraits<DT,DP...>::specialize
340 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
341 typename ViewTraits<DT,DP...>::non_const_value_type >::value
342 ,
"Can only deep copy into non-const type" );
355template<
class ExecSpace ,
class DT,
class ... DP >
360 ,
typename std::enable_if<(
361 Kokkos::is_execution_space< ExecSpace >::value &&
362 std::is_same<
typename ViewTraits<DT,DP...>::specialize
367 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
368 typename ViewTraits<DT,DP...>::non_const_value_type >::value
369 ,
"Can only deep copy into non-const type" );
376template<
class ExecSpace ,
class DT,
class ... DP >
381 ,
typename std::enable_if<(
382 Kokkos::is_execution_space< ExecSpace >::value &&
383 std::is_same<
typename ViewTraits<DT,DP...>::specialize
388 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
389 typename ViewTraits<DT,DP...>::non_const_value_type >::value
390 ,
"Can only deep copy into non-const type" );
403template<
class ExecSpace,
class DT ,
class ... DP ,
class ST ,
class ... SP >
408 ,
typename std::enable_if<(
409 std::is_same<
typename ViewTraits<DT,DP...>::specialize
412 std::is_same<
typename ViewTraits<ST,SP...>::specialize
417 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
418 typename ViewTraits<DT,DP...>::non_const_value_type >::value
419 ,
"Deep copy destination must be non-const" );
422 ( unsigned(ViewTraits<DT,DP...>::rank) ==
423 unsigned(ViewTraits<ST,SP...>::rank) )
424 ,
"Deep copy destination and source must have same rank" );
444template<
class DT ,
class ... DP ,
class ST ,
class ... SP >
448 ,
typename std::enable_if<(
449 std::is_same<
typename ViewTraits<DT,DP...>::specialize
452 std::is_same<
typename ViewTraits<ST,SP...>::specialize
464template <
unsigned N,
typename... Args>
465KOKKOS_FUNCTION std::enable_if_t<
466 N ==
View<Args...>::rank &&
467 std::is_same<
typename ViewTraits<Args...>::specialize,
476template <
unsigned N,
typename T,
typename... Args>
478 N !=
View<T, Args...>::rank &&
479 std::is_same<
typename ViewTraits<T, Args...>::specialize,
481 View<
typename RankDataType<
typename View<T, Args...>::value_type, N>
::type,
484 Kokkos::Impl::throw_runtime_exception(
485 "Trying to get at a View of the wrong rank");
496template<
class DataType ,
class ArrayLayout ,
typename StorageType >
497struct ViewDataAnalysis< DataType
499 ,
Sacado::MP::Vector< StorageType > >
519 ViewDataType< value_type , dimension >::type
type ;
521 ViewDataType< const_value_type , dimension >::type
const_type ;
528 enum {
is_const = std::is_same< value_type , const_value_type >::value };
532 std::conditional< is_const , const ScalarType , ScalarType >::type
540 typedef typename array_analysis::dimension::
541 template prepend<0>::type
543 typedef typename array_analysis::dimension::
544 template append<DimVector>::type
546 typedef typename std::conditional<
547 std::is_same< ArrayLayout, Kokkos::LayoutLeft>::value,
558 ViewDataType< const_scalar_type , scalar_dimension >::type
562 ViewDataType< non_const_scalar_type , scalar_dimension >::type
572namespace Experimental {
575 template <
class ValueType,
576 bool is_static = Sacado::IsStaticallySized<ValueType>::value >
582template <
class ValueType>
590 KOKKOS_INLINE_FUNCTION
591 static constexpr size_t
596 KOKKOS_INLINE_FUNCTION
599 template <
typename T>
600 KOKKOS_INLINE_FUNCTION
607 KOKKOS_INLINE_FUNCTION
613 template <
class ExecSpace>
615 typedef Kokkos::Impl::ViewValueFunctor< ExecSpace, scalar_type >
FunctorType ;
624 const bool initialize,
626 const unsigned vector_size,
628 m_functor( space ,
scalar_ptr , span*vector_size ,
"Stokhos_MP_VectorContig_ConstructDestructFunctor1" ),
643 template <
class ExecSpace>
644 inline ConstructDestructFunctor<ExecSpace>
646 const bool initialize,
648 const unsigned vector_size)
const {
653 template <
typename T>
654 KOKKOS_INLINE_FUNCTION
667template <
class ValueType>
675 KOKKOS_INLINE_FUNCTION
676 static constexpr size_t
681 KOKKOS_INLINE_FUNCTION
684 template <
typename T>
685 KOKKOS_INLINE_FUNCTION
695 KOKKOS_INLINE_FUNCTION
701 template <
class ExecSpace>
718 const unsigned vector_size) :
722 if ( !
m_space.in_parallel() ) {
723 typedef Kokkos::RangePolicy< ExecSpace > PolicyType ;
724 const Kokkos::Impl::ParallelFor< VectorConstruct , PolicyType >
725 closure( *
this , PolicyType( 0 ,
m_span ) );
730 for (
size_t i = 0 ; i <
m_span ; ++i )
operator()(i);
734 KOKKOS_INLINE_FUNCTION
735 void operator() (
const size_t i)
const {
740 template <
class ExecSpace>
753 const bool initialize,
755 const unsigned vector_size,
789 template <
class ExecSpace>
790 inline ConstructDestructFunctor<ExecSpace>
792 const bool initialize,
794 const unsigned vector_size)
const {
800 template <
typename T>
801 KOKKOS_INLINE_FUNCTION
816template<
class Traits >
818 typename
std::enable_if<
819 ( std::is_same< typename Traits::specialize
820 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
822 ( std::is_same< typename Traits::array_layout
823 , Kokkos::LayoutLeft >::value
825 std::is_same< typename Traits::array_layout
826 , Kokkos::LayoutRight >::value
828 std::is_same< typename Traits::array_layout
829 , Kokkos::LayoutStride >::value
832 , typename Traits::specialize
838 template< class ,
class ... >
friend class Kokkos::View ;
847 typedef Sacado::integral_nonzero< unsigned , StokhosStorageStaticDimension >
sacado_size_type;
851 typedef ViewOffset<
typename Traits::dimension
852 ,
typename Traits::array_layout
860 typedef ViewOffset<
typename array_dimension::
861 template append<StokhosStorageStaticDimension>::type,
862 typename Traits::array_layout,
865 typedef ViewOffset<
typename array_dimension::
866 template prepend<0>::type,
867 typename Traits::array_layout,
870 typedef typename std::conditional<
871 std::is_same< typename Traits::array_layout, Kokkos::LayoutLeft>::value,
905 enum {
Rank = Traits::dimension::rank };
908 enum {
Sacado_Rank = std::is_same< typename Traits::array_layout, Kokkos::LayoutLeft >::value ? 0 :
Rank+1 };
911 template<
typename iType >
912 KOKKOS_INLINE_FUNCTION
constexpr size_t extent(
const iType & r )
const
915 KOKKOS_INLINE_FUNCTION
constexpr
916 typename Traits::array_layout
layout()
const
942 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_0()
const
944 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_1()
const
946 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_2()
const
948 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_3()
const
950 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_4()
const
952 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_5()
const
954 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_6()
const
956 KOKKOS_INLINE_FUNCTION
constexpr size_t stride_7()
const
959 template<
typename iType >
960 KOKKOS_INLINE_FUNCTION
void stride( iType *
const s )
const
968 static const bool is_static = stokhos_storage_type::is_static ;
983 KOKKOS_INLINE_FUNCTION
constexpr size_t span()
const
996 KOKKOS_FORCEINLINE_FUNCTION
1001 template<
typename I0 >
1002 KOKKOS_FORCEINLINE_FUNCTION
1004 std::enable_if< std::is_integral<I0>::value &&
1005 ! std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value
1011 template<
typename I0 >
1012 KOKKOS_FORCEINLINE_FUNCTION
1014 std::enable_if< std::is_integral<I0>::value &&
1015 std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value
1020 template<
typename I0 ,
typename I1 >
1021 KOKKOS_FORCEINLINE_FUNCTION
1025 template<
typename I0 ,
typename I1 ,
typename I2 >
1026 KOKKOS_FORCEINLINE_FUNCTION
1030 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3 >
1031 KOKKOS_FORCEINLINE_FUNCTION
1035 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
1037 KOKKOS_FORCEINLINE_FUNCTION
1039 ,
const I4 & i4 )
const
1042 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
1043 ,
typename I4 ,
typename I5 >
1044 KOKKOS_FORCEINLINE_FUNCTION
1046 ,
const I4 & i4 ,
const I5 & i5 )
const
1049 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
1050 ,
typename I4 ,
typename I5 ,
typename I6 >
1051 KOKKOS_FORCEINLINE_FUNCTION
1053 ,
const I4 & i4 ,
const I5 & i5 ,
const I6 & i6 )
const
1056 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
1057 ,
typename I4 ,
typename I5 ,
typename I6 ,
typename I7 >
1058 KOKKOS_FORCEINLINE_FUNCTION
1060 ,
const I4 & i4 ,
const I5 & i5 ,
const I6 & i6 ,
const I7 & i7 )
const
1066 KOKKOS_INLINE_FUNCTION
1070 typedef std::integral_constant< unsigned , 0 > padding ;
1076 return handle_type::memory_span( offset.span(), static_dim );
1079 const size_t sacado_size =
1081 return handle_type::memory_span( offset.span(), sacado_size );
1100 template<
class ... P >
1101 KOKKOS_INLINE_FUNCTION
1103 ( ViewCtorProp< P ... >
const & prop
1104 ,
typename Traits::array_layout
const &
layout
1112 m_impl_handle.set( ( (ViewCtorProp<void,pointer_type>
const &) prop ).value,
1117 KOKKOS_INLINE_FUNCTION
1126 template<
class ... P >
1127 SharedAllocationRecord<> *
1129 ,
typename Traits::array_layout
const &
layout )
1131 typedef ViewCtorProp< P... > ctor_prop ;
1134 typedef typename Traits::memory_space memory_space ;
1135 typedef typename handle_type::template ConstructDestructFunctor<execution_space> functor_type ;
1136 typedef SharedAllocationRecord< memory_space , functor_type > record_type ;
1139 typedef std::integral_constant< unsigned , 0 > padding ;
1145 const size_t alloc_size =
1149 record_type *
const record =
1150 record_type::allocate( ( (ViewCtorProp<void,memory_space>
const &) prop ).value
1151 , ( (ViewCtorProp<void,std::string>
const &) prop ).value
1158 auto space = ((ViewCtorProp<void,execution_space>
const &) prop).value;
1166 , ctor_prop::initialize
1171 record->m_destroy.construct_shared_allocation();
1178 template<
class ... P >
1179 SharedAllocationRecord<> *
1181 ,
typename Traits::array_layout
const &
layout
1217template<
class DstTraits ,
class SrcTraits >
1218class ViewMapping< DstTraits , SrcTraits ,
1219 typename
std::enable_if<(
1220 Kokkos::Impl::MemorySpaceAccess< typename DstTraits::memory_space
1221 , typename SrcTraits::memory_space >::assignable
1224 std::is_same< typename DstTraits::specialize
1225 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1228 std::is_same< typename SrcTraits::specialize
1229 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1231 , typename DstTraits::specialize
1240 typedef ViewMapping< DstTraits , typename DstTraits::specialize >
DstType ;
1241 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize >
SrcType ;
1243 KOKKOS_INLINE_FUNCTION
static
1250 std::is_same<
typename DstTraits::array_layout
1251 , Kokkos::LayoutLeft >::value ||
1252 std::is_same<
typename DstTraits::array_layout
1253 , Kokkos::LayoutRight >::value ||
1254 std::is_same<
typename DstTraits::array_layout
1255 , Kokkos::LayoutStride >::value
1259 std::is_same<
typename SrcTraits::array_layout
1260 , Kokkos::LayoutLeft >::value ||
1261 std::is_same<
typename SrcTraits::array_layout
1262 , Kokkos::LayoutRight >::value ||
1263 std::is_same<
typename SrcTraits::array_layout
1264 , Kokkos::LayoutStride >::value
1266 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
1269 std::is_same<
typename DstTraits::array_layout
1270 ,
typename SrcTraits::array_layout >::value ||
1271 std::is_same<
typename DstTraits::array_layout
1272 , Kokkos::LayoutStride >::value ||
1273 ( unsigned(DstTraits::rank) == 0 && unsigned(SrcTraits::rank) == 0 ) ||
1274 ( unsigned(DstTraits::rank) == 1 && unsigned(SrcTraits::rank) == 1 ) ,
1275 "View assignment must have compatible layout" );
1278 std::is_same<
typename DstTraits::value_type
1279 ,
typename SrcTraits::value_type >::value ||
1280 std::is_same<
typename DstTraits::value_type
1281 ,
typename SrcTraits::const_value_type >::value ,
1282 "View assignment must have same value type or const = non-const" );
1285 ViewDimensionAssignable
1286 <
typename DstType::offset_type::dimension_type
1287 ,
typename SrcType::offset_type::dimension_type >::value ,
1288 "View assignment must have compatible dimensions" );
1290 dst.m_impl_handle = src.m_impl_handle ;
1291 dst.m_impl_offset = src.m_impl_offset ;
1292 dst.m_stride = src.m_stride ;
1293 dst.m_sacado_size = src.m_sacado_size ;
1302template<
class DstTraits ,
class SrcTraits >
1303class ViewMapping< DstTraits , SrcTraits ,
1304 typename
std::enable_if<(
1305 Kokkos::Impl::MemorySpaceAccess< typename DstTraits::memory_space
1306 , typename SrcTraits::memory_space >::assignable
1309 std::is_same< typename DstTraits::specialize , void >::value
1312 std::is_same< typename SrcTraits::specialize
1313 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1316 unsigned(DstTraits::dimension::rank) == unsigned(SrcTraits::dimension::rank)+1
1318 , typename DstTraits::specialize
1327 typedef ViewMapping< DstTraits , typename DstTraits::specialize >
DstType ;
1328 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize >
SrcType ;
1330 KOKKOS_INLINE_FUNCTION
static
1337 std::is_same<
typename DstTraits::array_layout
1338 , Kokkos::LayoutLeft >::value ||
1339 std::is_same<
typename DstTraits::array_layout
1340 , Kokkos::LayoutRight >::value ||
1341 std::is_same<
typename DstTraits::array_layout
1342 , Kokkos::LayoutStride >::value
1346 std::is_same<
typename SrcTraits::array_layout
1347 , Kokkos::LayoutLeft >::value ||
1348 std::is_same<
typename SrcTraits::array_layout
1349 , Kokkos::LayoutRight >::value ||
1350 std::is_same<
typename SrcTraits::array_layout
1351 , Kokkos::LayoutStride >::value
1353 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
1356 std::is_same<
typename DstTraits::array_layout
1357 ,
typename SrcTraits::array_layout >::value ||
1358 std::is_same<
typename DstTraits::array_layout
1359 , Kokkos::LayoutStride >::value ,
1360 "View assignment must have compatible layout" );
1363 std::is_same<
typename DstTraits::scalar_array_type
1364 ,
typename SrcTraits::scalar_array_type >::value ||
1365 std::is_same<
typename DstTraits::scalar_array_type
1366 ,
typename SrcTraits::const_scalar_array_type >::value ,
1367 "View assignment must have same value type or const = non-const" );
1370 ViewDimensionAssignable<
1371 typename DstType::offset_type::dimension_type,
1372 typename SrcType::array_offset_type::dimension_type >::value,
1373 "View assignment must have compatible dimensions" );
1375 if ( src.m_stride != 1 ) {
1376 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > cannot assign with non-unit stride ******\n\n");
1380 dims[0] = src.m_impl_offset.dimension_0();
1381 dims[1] = src.m_impl_offset.dimension_1();
1382 dims[2] = src.m_impl_offset.dimension_2();
1383 dims[3] = src.m_impl_offset.dimension_3();
1384 dims[4] = src.m_impl_offset.dimension_4();
1385 dims[5] = src.m_impl_offset.dimension_5();
1386 dims[6] = src.m_impl_offset.dimension_6();
1387 dims[7] = src.m_impl_offset.dimension_7();
1388 unsigned rank = SrcTraits::dimension::rank;
1389 unsigned sacado_size = src.m_sacado_size.value;
1390 if (std::is_same<typename SrcTraits::array_layout, LayoutLeft>::value) {
1392 for (
unsigned i=rank; i>0; --i)
1393 dims[i] = dims[i-1];
1394 dims[0] = sacado_size;
1397 dims[rank] = sacado_size;
1399 typedef typename DstType::offset_type dst_offset_type;
1400 dst.m_impl_offset = dst_offset_type( std::integral_constant< unsigned , 0 >(),
1401 typename DstTraits::array_layout(
1402 dims[0] , dims[1] , dims[2] , dims[3] ,
1403 dims[4] , dims[5] , dims[6] , dims[7] ) );
1404 dst.m_impl_handle = src.m_impl_handle.scalar_ptr ;
1414template<
class DstTraits ,
class SrcTraits >
1415class ViewMapping< DstTraits , SrcTraits ,
1416 typename
std::enable_if<(
1417 Kokkos::Impl::MemorySpaceAccess< typename DstTraits::memory_space
1418 , typename SrcTraits::memory_space >::assignable
1421 std::is_same< typename DstTraits::specialize , void >::value
1424 std::is_same< typename SrcTraits::specialize
1425 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1428 unsigned(DstTraits::dimension::rank) == unsigned(SrcTraits::dimension::rank)
1430 , typename DstTraits::specialize
1439 typedef ViewMapping< DstTraits , typename DstTraits::specialize >
DstType ;
1440 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize >
SrcType ;
1442 KOKKOS_INLINE_FUNCTION
static
1449 std::is_same<
typename DstTraits::array_layout
1450 , Kokkos::LayoutLeft >::value ||
1451 std::is_same<
typename DstTraits::array_layout
1452 , Kokkos::LayoutRight >::value ||
1453 std::is_same<
typename DstTraits::array_layout
1454 , Kokkos::LayoutStride >::value
1458 std::is_same<
typename SrcTraits::array_layout
1459 , Kokkos::LayoutLeft >::value ||
1460 std::is_same<
typename SrcTraits::array_layout
1461 , Kokkos::LayoutRight >::value ||
1462 std::is_same<
typename SrcTraits::array_layout
1463 , Kokkos::LayoutStride >::value
1465 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
1468 std::is_same<
typename DstTraits::array_layout
1469 ,
typename SrcTraits::array_layout >::value ||
1470 std::is_same<
typename DstTraits::array_layout
1471 , Kokkos::LayoutStride >::value ,
1472 "View assignment must have compatible layout" );
1475 std::is_same<
typename DstTraits::value_type
1476 ,
typename SrcTraits::non_const_value_type::value_type >::value ||
1477 std::is_same<
typename DstTraits::value_type
1478 ,
const typename SrcTraits::non_const_value_type::value_type >::value ,
1479 "View assignment must have same value type or const = non-const" );
1482 ViewDimensionAssignable<
1483 typename DstType::offset_type::dimension_type,
1484 typename SrcType::offset_type::dimension_type >::value,
1485 "View assignment must have compatible dimensions" );
1487 if ( src.m_stride != 1 ) {
1488 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > cannot assign with non-unit stride ******\n\n");
1492 dims[0] = src.m_impl_offset.dimension_0();
1493 dims[1] = src.m_impl_offset.dimension_1();
1494 dims[2] = src.m_impl_offset.dimension_2();
1495 dims[3] = src.m_impl_offset.dimension_3();
1496 dims[4] = src.m_impl_offset.dimension_4();
1497 dims[5] = src.m_impl_offset.dimension_5();
1498 dims[6] = src.m_impl_offset.dimension_6();
1499 dims[7] = src.m_impl_offset.dimension_7();
1500 unsigned rank = SrcTraits::dimension::rank;
1501 unsigned sacado_size = src.m_sacado_size.value;
1502 if (std::is_same<typename DstTraits::array_layout, LayoutLeft>::value) {
1503 dims[0] = dims[0]*sacado_size;
1507 dims[rank-1] = dims[rank-1]*sacado_size;
1510 typedef typename DstType::offset_type dst_offset_type;
1511 dst.m_impl_offset = dst_offset_type( std::integral_constant< unsigned , 0 >(),
1512 typename DstTraits::array_layout(
1513 dims[0] , dims[1] , dims[2] , dims[3] ,
1514 dims[4] , dims[5] , dims[6] , dims[7] ) );
1515 dst.m_impl_handle = src.m_impl_handle.scalar_ptr ;
1529template<
class DataType,
class ... P ,
class Arg0,
class ... Args >
1531 < typename
std::enable_if<(
1533 std::is_same< typename Kokkos::ViewTraits<DataType,P...>::specialize
1534 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1537 std::is_same< typename Kokkos::ViewTraits<DataType,P...>::array_layout
1538 , Kokkos::LayoutLeft >::value ||
1539 std::is_same< typename Kokkos::ViewTraits<DataType,P...>::array_layout
1540 , Kokkos::LayoutRight >::value ||
1541 std::is_same< typename Kokkos::ViewTraits<DataType,P...>::array_layout
1542 , Kokkos::LayoutStride >::value
1544 && !Sacado::MP::is_vector_partition<Arg0>::value
1546 , Kokkos::ViewTraits<DataType,P...>
1557 ,
R0 = bool(is_integral_extent<0,Arg0,Args...>::value)
1558 ,
R1 = bool(is_integral_extent<1,Arg0,Args...>::value)
1559 ,
R2 = bool(is_integral_extent<2,Arg0,Args...>::value)
1560 ,
R3 = bool(is_integral_extent<3,Arg0,Args...>::value)
1561 ,
R4 = bool(is_integral_extent<4,Arg0,Args...>::value)
1562 ,
R5 = bool(is_integral_extent<5,Arg0,Args...>::value)
1563 ,
R6 = bool(is_integral_extent<6,Arg0,Args...>::value)
1568 + unsigned(
R4) + unsigned(
R5) + unsigned(
R6) };
1572 1 == SrcTraits::rank ?
R0 : (
1573 2 == SrcTraits::rank ?
R1 : (
1574 3 == SrcTraits::rank ?
R2 : (
1575 4 == SrcTraits::rank ?
R3 : (
1576 5 == SrcTraits::rank ?
R4 : (
1577 6 == SrcTraits::rank ?
R5 :
R6 ))))))) };
1580 typedef typename std::conditional<
1586 ( rank <= 2 && R0 && std::is_same< typename SrcTraits::array_layout , Kokkos::LayoutLeft >::value )
1590 ( rank <= 2 && R0_rev && std::is_same< typename SrcTraits::array_layout , Kokkos::LayoutRight >::value )
1591 ),
typename SrcTraits::array_layout , Kokkos::LayoutStride
1609 typedef Kokkos::ViewTraits
1612 ,
typename SrcTraits::device_type
1615 typedef Kokkos::View
1618 ,
typename SrcTraits::device_type
1619 ,
typename SrcTraits::memory_traits >
type ;
1624 template<
class DstTraits >
1625 KOKKOS_INLINE_FUNCTION
1626 static void assign( ViewMapping< DstTraits , typename DstTraits::specialize > & dst
1627 , ViewMapping< SrcTraits , typename SrcTraits::specialize >
const & src
1628 , Arg0 arg0, Args ... args )
1631 ViewMapping< DstTraits , traits_type , typename DstTraits::specialize >::is_assignable ,
1632 "Subview destination type must be compatible with subview derived type" );
1634 typedef ViewMapping< DstTraits , typename DstTraits::specialize > DstType ;
1635 typedef typename DstType::offset_type dst_offset_type ;
1637 const SubviewExtents< SrcTraits::rank , rank >
1638 extents( src.m_impl_offset.m_dim , arg0 , args... );
1640 const size_t offset = src.m_impl_offset( extents.domain_offset(0)
1641 , extents.domain_offset(1)
1642 , extents.domain_offset(2)
1643 , extents.domain_offset(3)
1644 , extents.domain_offset(4)
1645 , extents.domain_offset(5)
1646 , extents.domain_offset(6)
1647 , extents.domain_offset(7) );
1649 dst.m_impl_offset = dst_offset_type( src.m_impl_offset , extents );
1650 dst.m_impl_handle.value_ptr = src.m_impl_handle.value_ptr + offset;
1651 dst.m_impl_handle.scalar_ptr =
1652 src.m_impl_handle.scalar_ptr + offset * src.m_stride * src.m_sacado_size.value;
1653 dst.m_stride = src.m_stride;
1654 dst.m_sacado_size = src.m_sacado_size;
1671template<
class DataType,
class ...P,
unsigned Size >
1674 ViewTraits<DataType,P...> ,
1675 Sacado::MP::VectorPartition<Size> >
1683 typedef ViewMapping< src_traits , typename src_traits::specialize >
src_type ;
1695 typedef ViewMapping< dst_traits , typename dst_traits::specialize >
dst_type ;
1697 KOKKOS_INLINE_FUNCTION
static
1700 ,
const Sacado::MP::VectorPartition<Size> & part )
1704 static_assert( storage_type::is_static,
1705 "For performance reasons, partitioned assignment is only implemented for statically-sized MP::Vector types" );
1707 unsigned len = part.end - part.begin;
1708 if ( Size != len || Size == 0 ) {
1709 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > Invalid size in partitioned view assignment ******\n\n");
1712 dst.m_impl_handle.value_ptr =
1715 dst.m_impl_handle.scalar_ptr = src.m_impl_handle.scalar_ptr +
1716 (part.begin / len) * src.m_stride * src.m_sacado_size.value ;
1717 dst.m_impl_offset = src.m_impl_offset ;
1718 dst.m_stride = src.m_stride * src.m_sacado_size.value / Size ;
1719 dst.m_sacado_size = len ;
1728template<
unsigned Size,
typename D,
typename ... P >
1729KOKKOS_INLINE_FUNCTION
1730typename Kokkos::Impl::ViewMapping< void,
typename Kokkos::ViewTraits<D,P...>, Sacado::MP::VectorPartition<Size> >::type
1732 const unsigned beg )
1734 typedef Kokkos::ViewTraits<D,P...> traits;
1735 typedef typename Kokkos::Impl::ViewMapping< void, traits, Sacado::MP::VectorPartition<Size> >
::type DstViewType;
1736 const Sacado::MP::VectorPartition<Size> part( beg , beg+Size );
1737 return DstViewType(src, part);
1750#if defined( KOKKOS_ENABLE_CUDA )
1751template<
class OutputView >
1753 typename std::enable_if< std::is_same< typename OutputView::specialize,
1754 Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&
1755 std::is_same< typename OutputView::execution_space,
1756 Cuda >::value >::type >
1760 typedef typename OutputView::size_type size_type ;
1762 template <
unsigned VectorLength>
1765 const OutputView output;
1766 const_value_type input;
1768 Kernel(
const OutputView & arg_out , const_value_type & arg_in ) :
1769 output(arg_out), input(arg_in) {}
1771 typedef typename Kokkos::TeamPolicy< execution_space >::member_type team_member ;
1773 KOKKOS_INLINE_FUNCTION
1774 void operator()(
const team_member & dev )
const
1776 const size_type tidx = dev.team_rank() % VectorLength;
1777 const size_type tidy = dev.team_rank() / VectorLength;
1778 const size_type nrow = dev.team_size() / VectorLength;
1781 const size_type i0 = dev.league_rank() * nrow + tidy;
1782 if ( i0 >= output.extent(0) )
return;
1784 for ( size_type i1 = 0 ; i1 < output.extent(1) ; ++i1 ) {
1785 for ( size_type i2 = 0 ; i2 < output.extent(2) ; ++i2 ) {
1786 for ( size_type i3 = 0 ; i3 < output.extent(3) ; ++i3 ) {
1787 for ( size_type i4 = 0 ; i4 < output.extent(4) ; ++i4 ) {
1788 for ( size_type i5 = 0 ; i5 < output.extent(5) ; ++i5 ) {
1789 for ( size_type i6 = 0 ; i6 < output.extent(6) ; ++i6 ) {
1790 for ( size_type i7 = 0 ; i7 < output.extent(7) ; ++i7 ) {
1791 for ( size_type is = tidx ; is < nvec ; is+=VectorLength ) {
1792 output.access(i0,i1,i2,i3,i4,i5,i6,i7).fastAccessCoeff(is) =
1793 input.fastAccessCoeff(is) ;
1806 typedef typename OutputView::array_type::value_type
scalar_type;
1807 const unsigned vector_length =
1808 ( 128 +
sizeof(
scalar_type)-1 ) /
sizeof(scalar_type);
1811 const size_type block_size = 256;
1813 const size_type rows_per_block = block_size / vector_length;
1814 const size_type n =
output.extent(0);
1815 const size_type league_size = ( n + rows_per_block-1 ) / rows_per_block;
1816 const size_type team_size = rows_per_block * vector_length;
1817 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
1819 parallel_for( config, Kernel<vector_length>(
output,
input) );
1837struct ViewSpecializeSacadoFad;
1845template<
class DstTraits ,
class SrcTraits >
1846class ViewMapping< DstTraits , SrcTraits ,
1847 typename
std::enable_if<(
1848 Kokkos::Impl::MemorySpaceAccess< typename DstTraits::memory_space
1849 , typename SrcTraits::memory_space >::assignable
1852 std::is_same< typename DstTraits::specialize
1853 , Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value
1856 std::is_same< typename SrcTraits::specialize
1857 , ViewSpecializeSacadoFad >::value
1859 , typename DstTraits::specialize
1868 typedef ViewMapping< DstTraits , typename DstTraits::specialize >
DstType ;
1869 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize >
SrcFadType ;
1871 template<
class DstType >
1872 KOKKOS_INLINE_FUNCTION
static
1879 std::is_same<
typename DstTraits::array_layout
1880 , Kokkos::LayoutLeft >::value ||
1881 std::is_same<
typename DstTraits::array_layout
1882 , Kokkos::LayoutRight >::value ||
1883 std::is_same<
typename DstTraits::array_layout
1884 , Kokkos::LayoutStride >::value
1888 std::is_same<
typename SrcTraits::array_layout
1889 , Kokkos::LayoutLeft >::value ||
1890 std::is_same<
typename SrcTraits::array_layout
1891 , Kokkos::LayoutRight >::value ||
1892 std::is_same<
typename SrcTraits::array_layout
1893 , Kokkos::LayoutStride >::value
1895 ,
"View of FAD requires LayoutLeft, LayoutRight, or LayoutStride" );
1898 std::is_same<
typename DstTraits::array_layout
1899 ,
typename SrcTraits::array_layout >::value ||
1900 std::is_same<
typename DstTraits::array_layout
1901 , Kokkos::LayoutStride >::value ,
1902 "View assignment must have compatible layout" );
1905 std::is_same<
typename DstTraits::data_type
1906 ,
typename SrcTraits::scalar_array_type >::value ||
1907 std::is_same<
typename DstTraits::data_type
1908 ,
typename SrcTraits::const_scalar_array_type >::value ,
1909 "View assignment must have same value type or const = non-const" );
1912 ViewDimensionAssignable
1913 <
typename DstType::offset_type::dimension_type
1914 ,
typename SrcFadType::array_offset_type::dimension_type >::value ,
1915 "View assignment must have compatible dimensions" );
1917 typedef typename DstType::offset_type dst_offset_type ;
1919 dst.m_impl_offset = dst_offset_type( src.m_array_offset );
1920 dst.m_impl_handle.assign(src.m_impl_handle) ;
1924 static_assert( DstType::is_static,
1925 "Destination view must be statically allocated" );
Kokkos::DefaultHostExecutionSpace execution_space
ViewMapping< DstTraits, typename DstTraits::specialize > DstType
ViewMapping< SrcTraits, typename SrcTraits::specialize > SrcType
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
Kokkos::Impl::SharedAllocationTracker TrackType
@ is_assignable_data_type
ViewMapping< DstTraits, typename DstTraits::specialize > DstType
ViewMapping< SrcTraits, typename SrcTraits::specialize > SrcType
@ is_assignable_data_type
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
Kokkos::Impl::SharedAllocationTracker TrackType
ViewMapping< SrcTraits, typename SrcTraits::specialize > SrcType
Kokkos::Impl::SharedAllocationTracker TrackType
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
@ is_assignable_data_type
ViewMapping< DstTraits, typename DstTraits::specialize > DstType
ViewMapping< SrcTraits, typename SrcTraits::specialize > SrcFadType
ViewMapping< DstTraits, typename DstTraits::specialize > DstType
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcFadType &src, const TrackType &)
Kokkos::Impl::SharedAllocationTracker TrackType
@ is_assignable_data_type
KOKKOS_INLINE_FUNCTION constexpr size_t span() const
Span of the mapped range : [ data() .. data() + span() ).
SharedAllocationRecord * allocate_shared(ViewCtorProp< P... > const &prop, typename Traits::array_layout const &layout)
ViewOffset< typename array_dimension::template prepend< 0 >::type, typename Traits::array_layout, void > prepend_offset_type
KOKKOS_FORCEINLINE_FUNCTION reference_type reference() const
sacado_size_type m_sacado_size
KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const
Is the mapped range span contiguous.
handle_type m_impl_handle
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5) const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const
@ StokhosStorageStaticDimension
KOKKOS_INLINE_FUNCTION ViewMapping(ViewCtorProp< P ... > const &prop, typename Traits::array_layout const &layout)
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4) const
KOKKOS_FORCEINLINE_FUNCTION constexpr unsigned dimension_scalar() const
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const
KOKKOS_INLINE_FUNCTION constexpr size_t extent(const iType &r) const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const
KOKKOS_INLINE_FUNCTION void stride(iType *const s) const
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1) const
ViewOffset< typename Traits::dimension, typename Traits::array_layout, void > offset_type
ViewOffset< typename array_dimension::template append< StokhosStorageStaticDimension >::type, typename Traits::array_layout, void > append_offset_type
Kokkos::Experimental::Impl::MPVectorAllocation< sacado_mp_vector_type > handle_type
sacado_mp_vector_type & reference_type
SharedAllocationRecord * allocate_shared(ViewCtorProp< P... > const &prop, typename Traits::array_layout const &layout, bool)
static const bool is_static
std::false_type is_regular
array_analysis::dimension array_dimension
static KOKKOS_INLINE_FUNCTION size_t memory_span(typename Traits::array_layout const &layout)
Span, in bytes, of the required memory.
KOKKOS_DEFAULTED_FUNCTION ~ViewMapping()=default
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const
KOKKOS_DEFAULTED_FUNCTION ViewMapping(const ViewMapping &)=default
std::conditional< std::is_same< typenameTraits::array_layout, Kokkos::LayoutLeft >::value, prepend_offset_type, append_offset_type >::type array_offset_type
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6) const
Sacado::integral_nonzero< unsigned, StokhosStorageStaticDimension > sacado_size_type
std::add_const< intrinsic_scalar_type >::type const_intrinsic_scalar_type
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< std::is_integral< I0 >::value &&!std::is_same< typenameTraits::array_layout, Kokkos::LayoutStride >::value, reference_type >::type reference(const I0 &i0) const
Traits::value_type sacado_mp_vector_type
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< std::is_integral< I0 >::value &&std::is_same< typenameTraits::array_layout, Kokkos::LayoutStride >::value, reference_type >::type reference(const I0 &i0) const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2) const
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3) const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const
ViewArrayAnalysis< typename Traits::data_type > array_analysis
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const
KOKKOS_DEFAULTED_FUNCTION ViewMapping(ViewMapping &&)=default
static const bool is_contiguous
offset_type m_impl_offset
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const
KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const
Raw data access.
KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const
stokhos_storage_type::value_type intrinsic_scalar_type
KOKKOS_INLINE_FUNCTION ViewMapping()
KOKKOS_INLINE_FUNCTION constexpr Traits::array_layout layout() const
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const
KOKKOS_INLINE_FUNCTION void assign_data(pointer_type arg_ptr)
Assign data.
sacado_mp_vector_type * pointer_type
Pointer to underlying memory type.
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4, const I5 &i5, const I6 &i6, const I7 &i7) const
sacado_mp_vector_type::storage_type stokhos_storage_type
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const
src_type::offset_type::dimension_type src_dimension
ViewMapping< dst_traits, typename dst_traits::specialize > dst_type
ViewDataType< strided_value_type, src_dimension >::type strided_data_type
src_traits::value_type mp_vector_type
@ is_assignable_data_type
storage_apply::type strided_storage_type
static KOKKOS_INLINE_FUNCTION void assign(dst_type &dst, const src_type &src, const Sacado::MP::VectorPartition< Size > &part)
ViewTraits< DataType, P... > src_traits
View< strided_data_type, P... > type
storage_type::template apply_N< Size > storage_apply
ViewMapping< src_traits, typename src_traits::specialize > src_type
Sacado::MP::Vector< strided_storage_type > strided_value_type
ViewTraits< strided_data_type, P... > dst_traits
mp_vector_type::storage_type storage_type
KOKKOS_FUNCTION std::enable_if_t< N==View< Args... >::rank &&std::is_same< typename ViewTraits< Args... >::specialize, Kokkos::Experimental::Impl::ViewPCEContiguous >::value, View< Args... > > as_view_of_rank_n(View< Args... > v)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< is_view_uq_pce< View< T, P... > >::value, unsigned >::type dimension_scalar(const View< T, P... > &view)
KOKKOS_INLINE_FUNCTION Kokkos::Impl::ViewMapping< void, typenameKokkos::ViewTraits< D, P... >, Sacado::MP::VectorPartition< Size > >::type partition(const Kokkos::View< D, P... > &src, const unsigned beg)
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
Stokhos::CrsMatrix< ValueType, Device, Layout >::HostMirror create_mirror(const Stokhos::CrsMatrix< ValueType, Device, Layout > &A)
Impl::MirrorViewType< Space, T, P... >::view_type create_mirror_view_and_copy(const Space &, const Kokkos::View< T, P... > &src, std::string const &name="", typename std::enable_if< std::is_same< typename ViewTraits< T, P... >::specialize, Kokkos::Experimental::Impl::ViewPCEContiguous >::value &&Impl::MirrorViewType< Space, T, P... >::is_same_memspace >::type *=nullptr)
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
void destroy_shared_allocation()
ConstructDestructFunctor & operator=(const ConstructDestructFunctor &)=default
VectorFunctorType m_vector_functor
VectorConstruct< ExecSpace > VectorFunctorType
ConstructDestructFunctor(const ConstructDestructFunctor &)=default
ConstructDestructFunctor()=default
Kokkos::Impl::ViewValueFunctor< ExecSpace, scalar_type > ScalarFunctorType
void construct_shared_allocation()
ConstructDestructFunctor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size, scalar_type *scalar_ptr, value_type *value_ptr)
ScalarFunctorType m_scalar_functor
VectorConstruct(const VectorConstruct &)=default
VectorConstruct(const ExecSpace &space, value_type *p, scalar_type *sp, const size_t span, const unsigned vector_size)
VectorConstruct & operator=(const VectorConstruct &)=default
VectorConstruct()=default
Sacado::ValueType< value_type >::type scalar_type
KOKKOS_INLINE_FUNCTION void assign(T *ptr)
ConstructDestructFunctor< ExecSpace > create_functor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size) const
KOKKOS_INLINE_FUNCTION MPVectorAllocation()
KOKKOS_INLINE_FUNCTION void set(value_type *ptr, const size_t span, const unsigned vector_size)
KOKKOS_INLINE_FUNCTION MPVectorAllocation & operator=(const MPVectorAllocation< T, false > &a)
static KOKKOS_INLINE_FUNCTION constexpr size_t memory_span(const size_t span, const unsigned vector_size)
ConstructDestructFunctor & operator=(const ConstructDestructFunctor &)=default
ConstructDestructFunctor()=default
ConstructDestructFunctor(const ConstructDestructFunctor &)=default
Kokkos::Impl::ViewValueFunctor< ExecSpace, scalar_type > FunctorType
void destroy_shared_allocation()
ConstructDestructFunctor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size, scalar_type *scalar_ptr)
void construct_shared_allocation()
ConstructDestructFunctor< ExecSpace > create_functor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size) const
KOKKOS_INLINE_FUNCTION MPVectorAllocation()
Sacado::ValueType< value_type >::type scalar_type
KOKKOS_INLINE_FUNCTION MPVectorAllocation & operator=(const MPVectorAllocation< T, true > &a)
static KOKKOS_INLINE_FUNCTION constexpr size_t memory_span(const size_t span, const unsigned vector_size)
KOKKOS_INLINE_FUNCTION void set(value_type *ptr, const size_t span, const unsigned vector_size)
KOKKOS_INLINE_FUNCTION void assign(T *ptr)
Kokkos::Impl::ViewDataType< flat_value_type, dimension >::type flat_data_type
view_type::array_type::value_type flat_value_type
View< flat_data_type, P... > type
View< D, P... > view_type
view_type::traits::dimension dimension
OutputView::const_value_type const_value_type
OutputView::execution_space execution_space
StokhosViewFill(const OutputView &arg_out, const_value_type &arg_in)
array_analysis::const_value_type const_value_type
std::conditional< std::is_same< ArrayLayout, Kokkos::LayoutLeft >::value, prepend_scalar_dimension, append_scalar_dimension >::type scalar_dimension
const ScalarType const_scalar_type
array_analysis::dimension::template append< DimVector >::type append_scalar_dimension
ViewDataType< scalar_type, scalar_dimension >::type scalar_array_type
Kokkos::Experimental::Impl::ViewMPVectorContiguous specialize
ViewDataType< value_type, dimension >::type type
StorageType::value_type ScalarType
ViewArrayAnalysis< DataType > array_analysis
ScalarType non_const_scalar_type
array_analysis::value_type value_type
array_analysis::dimension::template prepend< 0 >::type prepend_scalar_dimension
ViewDataType< non_const_scalar_type, scalar_dimension >::type non_const_scalar_array_type
ViewDataType< non_const_value_type, dimension >::type non_const_type
array_analysis::non_const_value_type non_const_value_type
ViewDataType< const_scalar_type, scalar_dimension >::type const_scalar_array_type
std::conditional< is_const, constScalarType, ScalarType >::type scalar_type
ViewDataType< const_value_type, dimension >::type const_type
static const int DimVector
array_analysis::dimension dimension
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::type Kokkos::View< data_type, array_layout, typename SrcTraits::device_type, typename SrcTraits::memory_traits > type
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::RZ @ RZ
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R1 @ R1
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R5 @ R5
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R0 @ R0
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R3 @ R3
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R6 @ R6
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R4 @ R4
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R2 @ R2
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::sacado_mp_vector_type SrcTraits::value_type sacado_mp_vector_type
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::traits_type Kokkos::ViewTraits< data_type, array_layout, typename SrcTraits::device_type, typename SrcTraits::memory_traits > traits_type
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::rank @ rank
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::data_type std::conditional< rank==0, sacado_mp_vector_type, typenamestd::conditional< rank==1, sacado_mp_vector_type *, typenamestd::conditional< rank==2, sacado_mp_vector_type **, typenamestd::conditional< rank==3, sacado_mp_vector_type ***, typenamestd::conditional< rank==4, sacado_mp_vector_type ****, typenamestd::conditional< rank==5, sacado_mp_vector_type *****, typenamestd::conditional< rank==6, sacado_mp_vector_type ******, sacado_mp_vector_type ******* >::type >::type >::type >::type >::type >::type >::type data_type
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::SrcTraits Kokkos::ViewTraits< DataType, P... > SrcTraits
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::assign static KOKKOS_INLINE_FUNCTION void assign(ViewMapping< DstTraits, typename DstTraits::specialize > &dst, ViewMapping< SrcTraits, typename SrcTraits::specialize > const &src, Arg0 arg0, Args ... args)
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::R0_rev @ R0_rev
Kokkos::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::specialize, Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::ViewTraits< DataType, P... >, Arg0, Args ... >::array_layout std::conditional<((rank==0)||(rank<=2 &&R0 &&std::is_same< typenameSrcTraits::array_layout, Kokkos::LayoutLeft >::value)||(rank<=2 &&R0_rev &&std::is_same< typenameSrcTraits::array_layout, Kokkos::LayoutRight >::value)), typenameSrcTraits::array_layout, Kokkos::LayoutStride >::type array_layout
View< T, P... > view_type