42 #ifndef KOKKOS_EXPERIMENTAL_VIEW_MP_VECTOR_CONTIGUOUS_HPP 43 #define KOKKOS_EXPERIMENTAL_VIEW_MP_VECTOR_CONTIGUOUS_HPP 45 #include "Sacado_Traits.hpp" 49 #include "Kokkos_Core.hpp" 53 #include "impl/KokkosExp_ViewMapping.hpp" 58 namespace Experimental {
63 template<
class ... Args >
66 template<
class D ,
class ... P ,
class ... Args >
69 std::is_same<
typename Kokkos::ViewTraits<D,P...>::specialize
72 ( (
sizeof...(Args) == 0 ) ||
82 template <
typename T,
typename ... P>
86 std::is_same<
typename view_type::specialize,
90 template <
typename T,
typename ... P>
91 KOKKOS_INLINE_FUNCTION
95 return view.implementation_map().dimension_scalar();
98 template <
typename D,
typename ... P>
100 typename std::enable_if< is_view_mp_vector< View<D,P...> >::value >
::type > {
102 typedef typename view_type::traits::dimension
dimension;
104 typedef typename Kokkos::Experimental::Impl::ViewDataType< flat_value_type , dimension >::type
flat_data_type;
109 template<
class DT,
class ... DP >
111 const View<DT,DP...> & view ,
113 ,
typename std::enable_if<(
114 std::is_same<
typename ViewTraits<DT,DP...>::specialize
120 typename ViewTraits<DT,DP...>::non_const_value_type >::value
121 ,
"Can only deep copy into non-const type" );
123 typedef typename FlatArrayType< View<DT,DP...> >::type flat_array_type;
124 Kokkos::Experimental::Impl::ViewFill< flat_array_type >( view , value );
128 template<
class DT,
class ... DP >
130 const View<DT,DP...> & view ,
132 ,
typename std::enable_if<(
133 std::is_same<
typename ViewTraits<DT,DP...>::specialize
139 typename ViewTraits<DT,DP...>::non_const_value_type >::value
140 ,
"Can only deep copy into non-const type" );
149 Kokkos::Experimental::Impl::ViewFill< View<DT,DP...> >( view , value );
153 template<
class DT ,
class ... DP ,
class ST ,
class ... SP >
156 const View<ST,SP...> & src
157 ,
typename std::enable_if<(
158 std::is_same<
typename ViewTraits<DT,DP...>::specialize
161 std::is_same<
typename ViewTraits<ST,SP...>::specialize
167 typename ViewTraits<DT,DP...>::non_const_value_type >::value
168 ,
"Deep copy destination must be non-const" );
171 (
unsigned(ViewTraits<DT,DP...>::rank) ==
172 unsigned(ViewTraits<ST,SP...>::rank) )
173 ,
"Deep copy destination and source must have same rank" );
195 namespace Experimental {
198 template<
class DataType ,
class ArrayLayout ,
typename StorageType >
199 struct ViewDataAnalysis< DataType
201 ,
Sacado::MP::Vector< StorageType > >
207 static const int DimVector = StorageType::static_size;
221 ViewDataType< value_type , dimension >::type
type ;
223 ViewDataType< const_value_type , dimension >::type
const_type ;
230 enum { is_const = std::is_same< value_type , const_value_type >::value };
234 std::conditional< is_const , const ScalarType , ScalarType >::type
242 typedef typename array_analysis::dimension::
243 template prepend<0>::type
245 typedef typename array_analysis::dimension::
246 template append<DimVector>::type
248 typedef typename std::conditional<
249 std::is_same< ArrayLayout, Kokkos::LayoutLeft>::value,
260 ViewDataType< const_scalar_type , scalar_dimension >::type
264 ViewDataType< non_const_scalar_type , scalar_dimension >::type
275 namespace Experimental {
278 template <
class ValueType,
279 bool is_static = Sacado::IsStaticallySized<ValueType>::value >
285 template <
class ValueType>
293 KOKKOS_INLINE_FUNCTION
294 static constexpr
size_t 299 KOKKOS_INLINE_FUNCTION
302 template <
typename T>
303 KOKKOS_INLINE_FUNCTION
305 value_ptr = a.value_ptr;
306 scalar_ptr = a.scalar_ptr;
310 KOKKOS_INLINE_FUNCTION
311 void set(
value_type* ptr,
const size_t span,
const unsigned vector_size) {
316 template <
class ExecSpace>
317 struct ConstructDestructFunctor {
322 ConstructDestructFunctor() =
default;
323 ConstructDestructFunctor(
const ConstructDestructFunctor&) =
default;
324 ConstructDestructFunctor& operator=(
const ConstructDestructFunctor&) =
default;
327 const bool initialize,
329 const unsigned vector_size,
331 m_functor( space , scalar_ptr , span*vector_size ),
332 m_initialize(initialize) {}
336 m_functor.construct_shared_allocation();
341 m_functor.destroy_shared_allocation();
346 template <
class ExecSpace>
347 inline ConstructDestructFunctor<ExecSpace>
349 const bool initialize,
351 const unsigned vector_size)
const {
352 return ConstructDestructFunctor<ExecSpace>(space, initialize, span, vector_size, scalar_ptr);
356 template <
typename T>
358 value_ptr =
reinterpret_cast<value_type*
>(ptr);
369 template <
class ValueType>
377 KOKKOS_INLINE_FUNCTION
378 static constexpr
size_t 383 KOKKOS_INLINE_FUNCTION
386 template <
typename T>
387 KOKKOS_INLINE_FUNCTION
389 value_ptr = a.value_ptr;
390 scalar_ptr = a.scalar_ptr;
397 KOKKOS_INLINE_FUNCTION
398 void set(
value_type* ptr,
const size_t span,
const unsigned vector_size) {
400 scalar_ptr =
reinterpret_cast<scalar_type*
>(ptr+span);
403 template <
class ExecSpace>
404 struct VectorConstruct {
411 VectorConstruct() =
default;
412 VectorConstruct(
const VectorConstruct&) =
default;
413 VectorConstruct& operator=(
const VectorConstruct&) =
default;
420 const unsigned vector_size) :
421 m_space(space), m_p(p), m_sp(sp), m_span(span), m_vector_size(vector_size) {}
424 if ( ! m_space.in_parallel() ) {
425 typedef Kokkos::RangePolicy< ExecSpace > PolicyType ;
426 const Kokkos::Impl::ParallelFor< VectorConstruct , PolicyType >
427 closure( *
this , PolicyType( 0 , m_span ) );
432 for (
size_t i = 0 ; i < m_span ; ++i )
operator()(i);
436 KOKKOS_INLINE_FUNCTION
437 void operator() (
const size_t i)
const {
438 new (m_p+i)
value_type(m_vector_size, m_sp+i*m_vector_size,
false);
442 template <
class ExecSpace>
443 struct ConstructDestructFunctor {
450 ConstructDestructFunctor() =
default;
451 ConstructDestructFunctor(
const ConstructDestructFunctor&) =
default;
452 ConstructDestructFunctor& operator=(
const ConstructDestructFunctor&) =
default;
455 const bool initialize,
457 const unsigned vector_size,
460 m_scalar_functor( space , scalar_ptr , span*vector_size ),
461 m_vector_functor( space , value_ptr , scalar_ptr , span , vector_size ),
462 m_initialize(initialize) {}
467 m_scalar_functor.construct_shared_allocation();
479 m_vector_functor.execute();
486 m_scalar_functor.destroy_shared_allocation();
491 template <
class ExecSpace>
492 inline ConstructDestructFunctor<ExecSpace>
494 const bool initialize,
496 const unsigned vector_size)
const {
497 return ConstructDestructFunctor<ExecSpace>(space, initialize, span, vector_size, scalar_ptr, value_ptr);
502 template <
typename T>
504 value_ptr =
reinterpret_cast<value_type*
>(ptr);
506 scalar_ptr = value_ptr->coeff();
512 template<
class Traits >
513 class ViewMapping< Traits ,
514 typename std::enable_if<
515 ( std::is_same< typename Traits::specialize
516 , ViewMPVectorContiguous >::value
518 ( std::is_same< typename Traits::array_layout
519 , Kokkos::LayoutLeft >::value
521 std::is_same< typename Traits::array_layout
522 , Kokkos::LayoutRight >::value
524 std::is_same< typename Traits::array_layout
525 , Kokkos::LayoutStride >::value
531 template< class ,
class ... >
friend class ViewMapping ;
532 template< class ,
class ... >
friend class Kokkos::Experimental::View ;
540 enum { StokhosStorageStaticDimension = stokhos_storage_type::static_size };
541 typedef Sacado::integral_nonzero< unsigned , StokhosStorageStaticDimension >
sacado_size_type;
545 typedef ViewOffset<
typename Traits::dimension
546 ,
typename Traits::array_layout
554 typedef ViewOffset<
typename array_dimension::
555 template append<StokhosStorageStaticDimension>::type,
556 typename Traits::array_layout,
559 typedef ViewOffset<
typename array_dimension::
560 template prepend<0>::type,
561 typename Traits::array_layout,
564 typedef typename std::conditional<
565 std::is_same< typename Traits::array_layout, Kokkos::LayoutLeft>::value,
599 enum { Rank = Traits::dimension::rank };
602 enum { Sacado_Rank = std::is_same< typename Traits::array_layout, Kokkos::LayoutLeft >::value ? 0 : Rank+1 };
605 template<
typename iType >
606 KOKKOS_INLINE_FUNCTION constexpr
size_t extent(
const iType & r )
const 607 {
return m_offset.m_dim.extent(r); }
609 KOKKOS_INLINE_FUNCTION constexpr
610 typename Traits::array_layout
layout()
const 611 {
return m_offset.layout(); }
614 {
return m_offset.dimension_0(); }
616 {
return m_offset.dimension_1(); }
618 {
return m_offset.dimension_2(); }
620 {
return m_offset.dimension_3(); }
622 {
return m_offset.dimension_4(); }
624 {
return m_offset.dimension_5(); }
626 {
return m_offset.dimension_6(); }
628 {
return m_offset.dimension_7(); }
636 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_0()
const 637 {
return m_offset.stride_0(); }
638 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_1()
const 639 {
return m_offset.stride_1(); }
640 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_2()
const 641 {
return m_offset.stride_2(); }
642 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_3()
const 643 {
return m_offset.stride_3(); }
644 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_4()
const 645 {
return m_offset.stride_4(); }
646 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_5()
const 647 {
return m_offset.stride_5(); }
648 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_6()
const 649 {
return m_offset.stride_6(); }
650 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_7()
const 651 {
return m_offset.stride_7(); }
653 template<
typename iType >
654 KOKKOS_INLINE_FUNCTION
void stride( iType *
const s )
const 655 { m_offset.stride(s); }
659 {
return m_sacado_size.value; }
662 static const bool is_static = stokhos_storage_type::is_static ;
665 static const bool is_contiguous =
true;
677 KOKKOS_INLINE_FUNCTION constexpr
size_t span()
const 678 {
return m_offset.span(); }
682 {
return m_offset.span_is_contiguous() && (m_stride == 1); }
686 {
return m_handle.value_ptr ; }
690 KOKKOS_FORCEINLINE_FUNCTION
692 {
return *m_handle.value_ptr; }
695 template<
typename I0 >
696 KOKKOS_FORCEINLINE_FUNCTION
698 std::enable_if< std::is_integral<I0>::value &&
699 ! std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value
700 , reference_type >::type
702 {
return m_handle.value_ptr[m_stride * i0]; }
705 template<
typename I0 >
706 KOKKOS_FORCEINLINE_FUNCTION
708 std::enable_if< std::is_integral<I0>::value &&
709 std::is_same< typename Traits::array_layout , Kokkos::LayoutStride >::value
710 , reference_type >::type
712 {
return m_handle.value_ptr[ m_stride * m_offset(i0) ]; }
714 template<
typename I0 ,
typename I1 >
715 KOKKOS_FORCEINLINE_FUNCTION
717 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1) ]; }
719 template<
typename I0 ,
typename I1 ,
typename I2 >
720 KOKKOS_FORCEINLINE_FUNCTION
722 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2) ]; }
724 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3 >
725 KOKKOS_FORCEINLINE_FUNCTION
727 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2,i3) ]; }
729 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
731 KOKKOS_FORCEINLINE_FUNCTION
733 ,
const I4 & i4 )
const 734 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2,i3,i4) ]; }
736 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
737 ,
typename I4 ,
typename I5 >
738 KOKKOS_FORCEINLINE_FUNCTION
740 ,
const I4 & i4 ,
const I5 & i5 )
const 741 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2,i3,i4,i5) ]; }
743 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
744 ,
typename I4 ,
typename I5 ,
typename I6 >
745 KOKKOS_FORCEINLINE_FUNCTION
747 ,
const I4 & i4 ,
const I5 & i5 ,
const I6 & i6 )
const 748 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2,i3,i4,i5,i6) ]; }
750 template<
typename I0 ,
typename I1 ,
typename I2 ,
typename I3
751 ,
typename I4 ,
typename I5 ,
typename I6 ,
typename I7 >
752 KOKKOS_FORCEINLINE_FUNCTION
754 ,
const I4 & i4 ,
const I5 & i5 ,
const I6 & i6 ,
const I7 & i7 )
const 755 {
return m_handle.value_ptr[ m_stride * m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; }
760 KOKKOS_INLINE_FUNCTION
761 static size_t memory_span(
typename Traits::array_layout
const & layout )
764 typedef std::integral_constant< unsigned , 0 > padding ;
768 return handle_type::memory_span( offset.span(), sacado_size.value );
773 KOKKOS_INLINE_FUNCTION ~ViewMapping() = default ;
781 KOKKOS_INLINE_FUNCTION ViewMapping(
const ViewMapping & ) = default ;
782 KOKKOS_INLINE_FUNCTION ViewMapping & operator = (
const ViewMapping & ) = default ;
784 KOKKOS_INLINE_FUNCTION ViewMapping( ViewMapping && ) = default ;
785 KOKKOS_INLINE_FUNCTION ViewMapping & operator = ( ViewMapping && ) = default ;
787 template<
class ... P >
788 KOKKOS_INLINE_FUNCTION
790 ( ViewCtorProp< P ... >
const & prop
791 ,
typename Traits::array_layout
const & layout
794 , m_offset( std::integral_constant< unsigned , 0 >()
799 m_handle.set( ( (ViewCtorProp<void,pointer_type>
const &) prop ).value,
800 m_offset.span(), m_sacado_size.value );
808 template<
class ... P >
809 SharedAllocationRecord<> *
811 ,
typename Traits::array_layout
const & layout )
813 typedef ViewCtorProp< P... > ctor_prop ;
816 typedef typename Traits::memory_space memory_space ;
817 typedef typename handle_type::template ConstructDestructFunctor<execution_space> functor_type ;
818 typedef SharedAllocationRecord< memory_space , functor_type > record_type ;
821 typedef std::integral_constant< unsigned , 0 > padding ;
827 const size_t alloc_size =
828 handle_type::memory_span( m_offset.span(), m_sacado_size.value );
831 record_type *
const record =
832 record_type::allocate( ( (ViewCtorProp<void,memory_space>
const &) prop ).value
833 , ( (ViewCtorProp<void,std::string>
const &) prop ).value
840 m_handle.set( reinterpret_cast< pointer_type >( record->data() ),
841 m_offset.span(), m_sacado_size.value );
845 record->m_destroy = m_handle.create_functor(
846 ( (ViewCtorProp<void,execution_space>
const &) prop).value
847 , ctor_prop::initialize
849 , m_sacado_size.value );
852 record->m_destroy.construct_shared_allocation();
883 namespace Experimental {
890 template<
class DstTraits ,
class SrcTraits >
891 class ViewMapping< DstTraits , SrcTraits ,
892 typename std::enable_if<(
893 std::is_same< typename DstTraits::memory_space
894 , typename SrcTraits::memory_space >::value
897 std::is_same< typename DstTraits::specialize
898 , ViewMPVectorContiguous >::value
901 std::is_same< typename SrcTraits::specialize
902 , ViewMPVectorContiguous >::value
907 enum { is_assignable =
true };
909 typedef Kokkos::Experimental::Impl::SharedAllocationTracker
TrackType ;
910 typedef ViewMapping< DstTraits , void >
DstType ;
911 typedef ViewMapping< SrcTraits , void >
SrcType ;
913 KOKKOS_INLINE_FUNCTION
static 920 std::is_same<
typename DstTraits::array_layout
921 , Kokkos::LayoutLeft >::value ||
922 std::is_same<
typename DstTraits::array_layout
923 , Kokkos::LayoutRight >::value ||
924 std::is_same<
typename DstTraits::array_layout
925 , Kokkos::LayoutStride >::value
929 std::is_same<
typename SrcTraits::array_layout
930 , Kokkos::LayoutLeft >::value ||
931 std::is_same<
typename SrcTraits::array_layout
932 , Kokkos::LayoutRight >::value ||
933 std::is_same<
typename SrcTraits::array_layout
934 , Kokkos::LayoutStride >::value
936 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
939 std::is_same<
typename DstTraits::array_layout
940 ,
typename SrcTraits::array_layout >::value ||
941 std::is_same<
typename DstTraits::array_layout
942 , Kokkos::LayoutStride >::value ||
943 (
unsigned(DstTraits::rank) == 1 &&
unsigned(SrcTraits::rank) == 1 ) ,
944 "View assignment must have compatible layout" );
950 ,
typename SrcTraits::const_value_type >::value ,
951 "View assignment must have same value type or const = non-const" );
954 ViewDimensionAssignable
955 <
typename DstType::offset_type::dimension_type
956 ,
typename SrcType::offset_type::dimension_type >::value ,
957 "View assignment must have compatible dimensions" );
959 dst.m_handle = src.m_handle ;
960 dst.m_offset = src.m_offset ;
961 dst.m_stride = src.m_stride ;
962 dst.m_sacado_size = src.m_sacado_size ;
971 template<
class DstTraits ,
class SrcTraits >
972 class ViewMapping< DstTraits , SrcTraits ,
973 typename std::enable_if<(
974 std::is_same< typename DstTraits::memory_space
975 , typename SrcTraits::memory_space >::value
978 std::is_same< typename DstTraits::specialize , void >::value
981 std::is_same< typename SrcTraits::specialize
982 , ViewMPVectorContiguous >::value
985 unsigned(DstTraits::dimension::rank) == unsigned(SrcTraits::dimension::rank)+1
990 enum { is_assignable =
true };
992 typedef Kokkos::Experimental::Impl::SharedAllocationTracker
TrackType ;
993 typedef ViewMapping< DstTraits , void >
DstType ;
994 typedef ViewMapping< SrcTraits , void >
SrcType ;
996 KOKKOS_INLINE_FUNCTION
static 1003 std::is_same<
typename DstTraits::array_layout
1004 , Kokkos::LayoutLeft >::value ||
1005 std::is_same<
typename DstTraits::array_layout
1006 , Kokkos::LayoutRight >::value ||
1007 std::is_same<
typename DstTraits::array_layout
1008 , Kokkos::LayoutStride >::value
1012 std::is_same<
typename SrcTraits::array_layout
1013 , Kokkos::LayoutLeft >::value ||
1014 std::is_same<
typename SrcTraits::array_layout
1015 , Kokkos::LayoutRight >::value ||
1016 std::is_same<
typename SrcTraits::array_layout
1017 , Kokkos::LayoutStride >::value
1019 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
1022 std::is_same<
typename DstTraits::array_layout
1023 ,
typename SrcTraits::array_layout >::value ||
1024 std::is_same<
typename DstTraits::array_layout
1025 , Kokkos::LayoutStride >::value ,
1026 "View assignment must have compatible layout" );
1029 std::is_same<
typename DstTraits::scalar_array_type
1030 ,
typename SrcTraits::scalar_array_type >::value ||
1031 std::is_same<
typename DstTraits::scalar_array_type
1032 ,
typename SrcTraits::const_scalar_array_type >::value ,
1033 "View assignment must have same value type or const = non-const" );
1036 ViewDimensionAssignable<
1037 typename DstType::offset_type::dimension_type,
1038 typename SrcType::array_offset_type::dimension_type >::value,
1039 "View assignment must have compatible dimensions" );
1041 if ( src.m_stride != 1 ) {
1042 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > cannot assign with non-unit stride ******\n\n");
1046 dims[0] = src.m_offset.dimension_0();
1047 dims[1] = src.m_offset.dimension_1();
1048 dims[2] = src.m_offset.dimension_2();
1049 dims[3] = src.m_offset.dimension_3();
1050 dims[4] = src.m_offset.dimension_4();
1051 dims[5] = src.m_offset.dimension_5();
1052 dims[6] = src.m_offset.dimension_6();
1053 dims[7] = src.m_offset.dimension_7();
1054 unsigned rank = SrcTraits::dimension::rank;
1055 unsigned sacado_size = src.m_sacado_size.value;
1056 if (std::is_same<typename SrcTraits::array_layout, LayoutLeft>::value) {
1058 for (
unsigned i=rank; i>0; --i)
1059 dims[i] = dims[i-1];
1060 dims[0] = sacado_size;
1063 dims[rank] = sacado_size;
1065 typedef typename DstType::offset_type dst_offset_type;
1066 dst.m_offset = dst_offset_type( std::integral_constant< unsigned , 0 >(),
1067 typename DstTraits::array_layout(
1068 dims[0] , dims[1] , dims[2] , dims[3] ,
1069 dims[4] , dims[5] , dims[6] , dims[7] ) );
1070 dst.m_handle = src.m_handle.scalar_ptr ;
1080 template<
class DstTraits ,
class SrcTraits >
1081 class ViewMapping< DstTraits , SrcTraits ,
1082 typename std::enable_if<(
1083 std::is_same< typename DstTraits::memory_space
1084 , typename SrcTraits::memory_space >::value
1087 std::is_same< typename DstTraits::specialize , void >::value
1090 std::is_same< typename SrcTraits::specialize
1091 , ViewMPVectorContiguous >::value
1094 unsigned(DstTraits::dimension::rank) == unsigned(SrcTraits::dimension::rank)
1099 enum { is_assignable =
true };
1101 typedef Kokkos::Experimental::Impl::SharedAllocationTracker
TrackType ;
1105 KOKKOS_INLINE_FUNCTION
static 1112 std::is_same<
typename DstTraits::array_layout
1113 , Kokkos::LayoutLeft >::value ||
1114 std::is_same<
typename DstTraits::array_layout
1115 , Kokkos::LayoutRight >::value ||
1116 std::is_same<
typename DstTraits::array_layout
1117 , Kokkos::LayoutStride >::value
1121 std::is_same<
typename SrcTraits::array_layout
1122 , Kokkos::LayoutLeft >::value ||
1123 std::is_same<
typename SrcTraits::array_layout
1124 , Kokkos::LayoutRight >::value ||
1125 std::is_same<
typename SrcTraits::array_layout
1126 , Kokkos::LayoutStride >::value
1128 ,
"View of MP::Vector requires LayoutLeft, LayoutRight, or LayoutStride" );
1131 std::is_same<
typename DstTraits::array_layout
1132 ,
typename SrcTraits::array_layout >::value ||
1133 std::is_same<
typename DstTraits::array_layout
1134 , Kokkos::LayoutStride >::value ,
1135 "View assignment must have compatible layout" );
1142 "View assignment must have same value type or const = non-const" );
1145 ViewDimensionAssignable<
1146 typename DstType::offset_type::dimension_type,
1147 typename SrcType::offset_type::dimension_type >::value,
1148 "View assignment must have compatible dimensions" );
1150 if ( src.m_stride != 1 ) {
1151 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > cannot assign with non-unit stride ******\n\n");
1155 dims[0] = src.m_offset.dimension_0();
1156 dims[1] = src.m_offset.dimension_1();
1157 dims[2] = src.m_offset.dimension_2();
1158 dims[3] = src.m_offset.dimension_3();
1159 dims[4] = src.m_offset.dimension_4();
1160 dims[5] = src.m_offset.dimension_5();
1161 dims[6] = src.m_offset.dimension_6();
1162 dims[7] = src.m_offset.dimension_7();
1163 unsigned rank = SrcTraits::dimension::rank;
1164 unsigned sacado_size = src.m_sacado_size.value;
1165 if (std::is_same<typename DstTraits::array_layout, LayoutLeft>::value) {
1166 dims[0] = dims[0]*sacado_size;
1170 dims[rank-1] = dims[rank-1]*sacado_size;
1173 typedef typename DstType::offset_type dst_offset_type;
1174 dst.m_offset = dst_offset_type( std::integral_constant< unsigned , 0 >(),
1175 typename DstTraits::array_layout(
1176 dims[0] , dims[1] , dims[2] , dims[3] ,
1177 dims[4] , dims[5] , dims[6] , dims[7] ) );
1178 dst.m_handle = src.m_handle.scalar_ptr ;
1189 namespace Experimental {
1194 template<
class DataType,
class ... P ,
class Arg0,
class ... Args >
1196 < typename std::enable_if<(
1198 std::is_same< typename Kokkos::Experimental::ViewTraits<DataType,P...>::specialize
1199 , ViewMPVectorContiguous >::value
1202 std::is_same< typename Kokkos::Experimental::ViewTraits<DataType,P...>::array_layout
1203 , Kokkos::LayoutLeft >::value ||
1204 std::is_same< typename Kokkos::Experimental::ViewTraits<DataType,P...>::array_layout
1205 , Kokkos::LayoutRight >::value ||
1206 std::is_same< typename Kokkos::Experimental::ViewTraits<DataType,P...>::array_layout
1207 , Kokkos::LayoutStride >::value
1209 && !Sacado::MP::is_vector_partition<Arg0>::value
1211 , Kokkos::Experimental::ViewTraits<DataType,P...>
1216 typedef Kokkos::Experimental::ViewTraits<DataType,P...>
SrcTraits;
1222 , R0 = bool(is_integral_extent<0,Arg0,Args...>::value)
1223 , R1 = bool(is_integral_extent<1,Arg0,Args...>::value)
1224 , R2 = bool(is_integral_extent<2,Arg0,Args...>::value)
1225 , R3 = bool(is_integral_extent<3,Arg0,Args...>::value)
1226 , R4 = bool(is_integral_extent<4,Arg0,Args...>::value)
1227 , R5 = bool(is_integral_extent<5,Arg0,Args...>::value)
1228 , R6 = bool(is_integral_extent<6,Arg0,Args...>::value)
1232 enum { rank = unsigned(R0) + unsigned(R1) + unsigned(R2) + unsigned(R3)
1233 + unsigned(R4) + unsigned(R5) + unsigned(R6) };
1236 enum { R0_rev = ( 0 == SrcTraits::rank ? RZ : (
1237 1 == SrcTraits::rank ? R0 : (
1238 2 == SrcTraits::rank ? R1 : (
1239 3 == SrcTraits::rank ? R2 : (
1240 4 == SrcTraits::rank ? R3 : (
1241 5 == SrcTraits::rank ? R4 : (
1242 6 == SrcTraits::rank ? R5 : R6 ))))))) };
1245 typedef typename std::conditional<
1251 ( rank <= 2 && R0 && std::is_same< typename SrcTraits::array_layout , Kokkos::LayoutLeft >::value )
1255 ( rank <= 2 && R0_rev && std::is_same< typename SrcTraits::array_layout , Kokkos::LayoutRight >::value )
1256 ),
typename SrcTraits::array_layout , Kokkos::LayoutStride
1274 typedef Kokkos::Experimental::ViewTraits
1277 ,
typename SrcTraits::device_type
1280 typedef Kokkos::Experimental::View
1283 ,
typename SrcTraits::device_type
1284 ,
typename SrcTraits::memory_traits >
type ;
1289 template<
class DstTraits >
1290 KOKKOS_INLINE_FUNCTION
1291 static void assign( ViewMapping< DstTraits , void > & dst
1292 , ViewMapping< SrcTraits , void >
const & src
1293 , Arg0 arg0, Args ... args )
1296 ViewMapping< DstTraits , traits_type , void >::is_assignable ,
1297 "Subview destination type must be compatible with subview derived type" );
1299 typedef ViewMapping< DstTraits , void > DstType ;
1300 typedef typename DstType::offset_type dst_offset_type ;
1302 const SubviewExtents< SrcTraits::rank , rank >
1303 extents( src.m_offset.m_dim , arg0 , args... );
1305 const size_t offset = src.m_offset( extents.domain_offset(0)
1306 , extents.domain_offset(1)
1307 , extents.domain_offset(2)
1308 , extents.domain_offset(3)
1309 , extents.domain_offset(4)
1310 , extents.domain_offset(5)
1311 , extents.domain_offset(6)
1312 , extents.domain_offset(7) );
1314 dst.m_offset = dst_offset_type( src.m_offset , extents );
1315 dst.m_handle.value_ptr = src.m_handle.value_ptr + offset;
1316 dst.m_handle.scalar_ptr =
1317 src.m_handle.scalar_ptr + offset * src.m_stride * src.m_sacado_size.value;
1318 dst.m_stride = src.m_stride;
1319 dst.m_sacado_size = src.m_sacado_size;
1333 namespace Experimental {
1338 template<
class DataType,
class ...P,
unsigned Size >
1341 ViewTraits<DataType,P...> ,
1342 Sacado::MP::VectorPartition<Size> >
1346 enum { is_assignable =
true };
1363 KOKKOS_INLINE_FUNCTION
static 1366 ,
const Sacado::MP::VectorPartition<Size> & part )
1370 static_assert( storage_type::is_static,
1371 "For performance reasons, partitioned assignment is only implemented for statically-sized MP::Vector types" );
1373 unsigned len = part.end - part.begin;
1374 if ( Size != len || Size == 0 ) {
1375 Kokkos::abort(
"\n\n ****** Kokkos::View< Sacado::MP::Vector ... > Invalid size in partitioned view assignment ******\n\n");
1378 dst.m_handle.value_ptr =
1381 dst.m_handle.scalar_ptr = src.m_handle.scalar_ptr +
1382 (part.begin / len) * src.m_stride * src.m_sacado_size.value ;
1383 dst.m_offset = src.m_offset ;
1384 dst.m_stride = src.m_stride * src.m_sacado_size.value / Size ;
1385 dst.m_sacado_size = len ;
1392 template<
unsigned Size,
typename D,
typename ... P >
1393 KOKKOS_INLINE_FUNCTION
1394 typename Kokkos::Experimental::Impl::ViewMapping< void,
typename Kokkos::Experimental::ViewTraits<D,P...>, Sacado::MP::VectorPartition<Size> >::type
1396 const unsigned beg )
1398 typedef Kokkos::Experimental::ViewTraits<D,P...> traits;
1399 typedef typename Kokkos::Experimental::Impl::ViewMapping< void, traits, Sacado::MP::VectorPartition<Size> >::type DstViewType;
1400 const Sacado::MP::VectorPartition<Size> part( beg , beg+Size );
1401 return DstViewType(src, part);
1414 #if defined( KOKKOS_HAVE_CUDA ) 1415 template<
class OutputView >
1416 struct ViewFill< OutputView ,
1417 typename std::enable_if< std::is_same< typename OutputView::specialize,
1418 Experimental::Impl::ViewMPVectorContiguous >::value &&
1419 std::is_same< typename OutputView::execution_space,
1420 Cuda >::value >::type >
1422 typedef typename OutputView::const_value_type const_value_type ;
1424 typedef typename OutputView::size_type size_type ;
1426 template <
unsigned VectorLength>
1429 const OutputView output;
1430 const_value_type input;
1432 Kernel(
const OutputView & arg_out , const_value_type & arg_in ) :
1433 output(arg_out), input(arg_in) {}
1435 typedef typename Kokkos::TeamPolicy< execution_space >::member_type team_member ;
1437 KOKKOS_INLINE_FUNCTION
1438 void operator()(
const team_member & dev )
const 1440 const size_type tidx = dev.team_rank() % VectorLength;
1441 const size_type tidy = dev.team_rank() / VectorLength;
1442 const size_type nrow = dev.team_size() / VectorLength;
1445 const size_type i0 = dev.league_rank() * nrow + tidy;
1446 if ( i0 >= output.dimension_0() )
return;
1448 for ( size_type i1 = 0 ; i1 < output.dimension_1() ; ++i1 ) {
1449 for ( size_type i2 = 0 ; i2 < output.dimension_2() ; ++i2 ) {
1450 for ( size_type i3 = 0 ; i3 < output.dimension_3() ; ++i3 ) {
1451 for ( size_type i4 = 0 ; i4 < output.dimension_4() ; ++i4 ) {
1452 for ( size_type i5 = 0 ; i5 < output.dimension_5() ; ++i5 ) {
1453 for ( size_type i6 = 0 ; i6 < output.dimension_6() ; ++i6 ) {
1454 for ( size_type i7 = 0 ; i7 < output.dimension_7() ; ++i7 ) {
1455 for ( size_type is = tidx ; is < nvec ; is+=VectorLength ) {
1456 output(i0,i1,i2,i3,i4,i5,i6,i7).fastAccessCoeff(is) =
1457 input.fastAccessCoeff(is) ;
1462 ViewFill(
const OutputView & output , const_value_type & input )
1465 deep_copy( output , input.fastAccessCoeff(0) );
1471 const unsigned vector_length =
1475 const size_type block_size = 256;
1477 const size_type rows_per_block = block_size / vector_length;
1478 const size_type n = output.dimension_0();
1479 const size_type league_size = ( n + rows_per_block-1 ) / rows_per_block;
1480 const size_type team_size = rows_per_block * vector_length;
1481 Kokkos::TeamPolicy< execution_space > config( league_size, team_size );
1483 parallel_for( config, Kernel<vector_length>(output, input) );
1484 execution_space::fence();
1499 namespace Experimental {
1502 struct ViewSpecializeSacadoFad;
1510 template<
class DstTraits ,
class SrcTraits >
1511 class ViewMapping< DstTraits , SrcTraits ,
1512 typename std::enable_if<(
1513 std::is_same< typename DstTraits::memory_space
1514 , typename SrcTraits::memory_space >::value
1517 std::is_same< typename DstTraits::specialize
1518 , ViewMPVectorContiguous >::value
1521 std::is_same< typename SrcTraits::specialize
1522 , ViewSpecializeSacadoFad >::value
1527 enum { is_assignable =
true };
1529 typedef Kokkos::Experimental::Impl::SharedAllocationTracker
TrackType ;
1533 template<
class DstType >
1534 KOKKOS_INLINE_FUNCTION
static 1541 std::is_same<
typename DstTraits::array_layout
1542 , Kokkos::LayoutLeft >::value ||
1543 std::is_same<
typename DstTraits::array_layout
1544 , Kokkos::LayoutRight >::value ||
1545 std::is_same<
typename DstTraits::array_layout
1546 , Kokkos::LayoutStride >::value
1550 std::is_same<
typename SrcTraits::array_layout
1551 , Kokkos::LayoutLeft >::value ||
1552 std::is_same<
typename SrcTraits::array_layout
1553 , Kokkos::LayoutRight >::value ||
1554 std::is_same<
typename SrcTraits::array_layout
1555 , Kokkos::LayoutStride >::value
1557 ,
"View of FAD requires LayoutLeft, LayoutRight, or LayoutStride" );
1560 std::is_same<
typename DstTraits::array_layout
1561 ,
typename SrcTraits::array_layout >::value ||
1562 std::is_same<
typename DstTraits::array_layout
1563 , Kokkos::LayoutStride >::value ,
1564 "View assignment must have compatible layout" );
1567 std::is_same<
typename DstTraits::data_type
1568 ,
typename SrcTraits::scalar_array_type >::value ||
1569 std::is_same<
typename DstTraits::data_type
1570 ,
typename SrcTraits::const_scalar_array_type >::value ,
1571 "View assignment must have same value type or const = non-const" );
1574 ViewDimensionAssignable
1575 <
typename DstType::offset_type::dimension_type
1576 ,
typename SrcFadType::offset_type::dimension_type >::value ,
1577 "View assignment must have compatible dimensions" );
1579 typedef typename DstType::offset_type dst_offset_type ;
1581 dst.m_offset = dst_offset_type( src.m_offset );
1582 dst.m_handle.assign(src.m_handle) ;
1586 static_assert( DstType::is_static,
1587 "Destination view must be statically allocated" );
array_analysis::dimension array_dimension
Sacado::ValueType< value_type >::type scalar_type
Kokkos::Experimental::Impl::SharedAllocationTracker TrackType
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const
KOKKOS_INLINE_FUNCTION MPVectorAllocation & operator=(const MPVectorAllocation< T, true > &a)
Stokhos::StandardStorage< int, double > storage_type
sacado_mp_vector_type & reference_type
void destroy_shared_allocation()
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
VectorConstruct< ExecSpace > VectorFunctorType
VectorFunctorType m_vector_functor
ViewMapping< src_traits, void > src_type
Kokkos::Experimental::Impl::SharedAllocationTracker TrackType
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1) const
ViewMapping< DstTraits, void > DstType
KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const
Is the mapped range span contiguous.
array_analysis::dimension dimension
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::type Kokkos::Experimental::View< data_type, array_layout, typename SrcTraits::device_type, typename SrcTraits::memory_traits > type
SharedAllocationRecord * allocate_shared(ViewCtorProp< P... > const &prop, typename Traits::array_layout const &layout)
KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3, const I4 &i4) const
static KOKKOS_INLINE_FUNCTION constexpr size_t memory_span(const size_t span, const unsigned vector_size)
KOKKOS_INLINE_FUNCTION MPVectorAllocation & operator=(const MPVectorAllocation< T, false > &a)
std::conditional< std::is_same< typename Traits::array_layout, Kokkos::LayoutLeft >::value, prepend_offset_type, append_offset_type >::type array_offset_type
Kokkos::DefaultExecutionSpace execution_space
array_analysis::non_const_value_type non_const_value_type
Sacado::integral_nonzero< unsigned, StokhosStorageStaticDimension > sacado_size_type
array_analysis::value_type value_type
KOKKOS_INLINE_FUNCTION MPVectorAllocation()
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() 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
KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const
ViewDataType< const_scalar_type, scalar_dimension >::type const_scalar_array_type
array_analysis::dimension::template prepend< 0 >::type prepend_scalar_dimension
Traits::value_type sacado_mp_vector_type
mp_vector_type::storage_type storage_type
ViewDataType< value_type, dimension >::type type
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const
View< strided_data_type, P... > type
ViewMapping< SrcTraits, void > SrcType
view_type::array_type::value_type flat_value_type
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2, const I3 &i3) const
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
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
ViewDataType< strided_value_type, src_dimension >::type strided_data_type
std::conditional< is_const, const ScalarType, ScalarType >::type scalar_type
View< D, P... > view_type
KOKKOS_FORCEINLINE_FUNCTION reference_type reference() const
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const
storage_apply::type strided_storage_type
KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const
Raw data access.
src_traits::value_type mp_vector_type
ViewMapping< DstTraits, void > DstType
ViewMapping< SrcTraits, void > SrcType
static KOKKOS_INLINE_FUNCTION size_t memory_span(typename Traits::array_layout const &layout)
Span, in bytes, of the required memory.
ViewOffset< typename array_dimension::template append< StokhosStorageStaticDimension >::type, typename Traits::array_layout, void > append_offset_type
array_analysis::const_value_type const_value_type
ConstructDestructFunctor< ExecSpace > create_functor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size) const
sacado_size_type m_sacado_size
storage_type::template apply_N< Size > storage_apply
KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const
ViewDataType< non_const_value_type, dimension >::type non_const_type
std::false_type is_regular
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::assign static KOKKOS_INLINE_FUNCTION void assign(ViewMapping< DstTraits, void > &dst, ViewMapping< SrcTraits, void > const &src, Arg0 arg0, Args ... args)
void construct_shared_allocation()
Impl::MPVectorAllocation< sacado_mp_vector_type > handle_type
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const
KOKKOS_INLINE_FUNCTION constexpr size_t span() const
Span of the mapped range : [ data() .. data() + span() )
VectorConstruct(const ExecSpace &space, value_type *p, scalar_type *sp, const size_t span, const unsigned vector_size)
sacado_mp_vector_type * pointer_type
Pointer to underlying memory type.
KOKKOS_INLINE_FUNCTION constexpr size_t extent(const iType &r) const
static KOKKOS_INLINE_FUNCTION void assign(dst_type &dst, const src_type &src, const Sacado::MP::VectorPartition< Size > &part)
void construct_shared_allocation()
void destroy_shared_allocation()
ViewDataType< non_const_scalar_type, scalar_dimension >::type non_const_scalar_array_type
static KOKKOS_INLINE_FUNCTION constexpr size_t memory_span(const size_t span, const unsigned vector_size)
KOKKOS_FORCEINLINE_FUNCTION constexpr unsigned dimension_scalar() const
ViewArrayAnalysis< typename Traits::data_type > array_analysis
std::conditional< std::is_same< ArrayLayout, Kokkos::LayoutLeft >::value, prepend_scalar_dimension, append_scalar_dimension >::type scalar_dimension
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcType &src, const TrackType &)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< is_view_uq_pce< View< T, P... > >::value, unsigned >::type dimension_scalar(const View< T, P... > &view)
View< flat_data_type, P... > type
array_analysis::dimension::template append< DimVector >::type append_scalar_dimension
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const
ViewMapping< SrcTraits, void > SrcFadType
Sacado::MP::Vector< strided_storage_type > strided_value_type
ScalarType non_const_scalar_type
KOKKOS_INLINE_FUNCTION Kokkos::Experimental::Impl::ViewMapping< void, typename Kokkos::Experimental::ViewTraits< D, P... >, Sacado::MP::VectorPartition< Size > >::type partition(const Kokkos::Experimental::View< D, P... > &src, const unsigned beg)
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::sacado_mp_vector_type SrcTraits::value_type sacado_mp_vector_type
KOKKOS_FORCEINLINE_FUNCTION reference_type reference(const I0 &i0, const I1 &i1, const I2 &i2) const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const
ViewValueFunctor< ExecSpace, scalar_type > FunctorType
ConstructDestructFunctor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size, scalar_type *scalar_ptr, value_type *value_ptr)
ViewOffset< typename array_dimension::template prepend< 0 >::type, typename Traits::array_layout, void > prepend_offset_type
ViewTraits< DataType, P... > src_traits
ViewMPVectorContiguous specialize
ConstructDestructFunctor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size, scalar_type *scalar_ptr)
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::array_layout std::conditional<((rank==0)||(rank<=2 &&R0 &&std::is_same< typename SrcTraits::array_layout, Kokkos::LayoutLeft >::value)||(rank<=2 &&R0_rev &&std::is_same< typename SrcTraits::array_layout, Kokkos::LayoutRight >::value)), typename SrcTraits::array_layout, Kokkos::LayoutStride >::type array_layout
ViewMapping< DstTraits, void > DstType
stokhos_storage_type::value_type intrinsic_scalar_type
view_type::traits::dimension dimension
KOKKOS_INLINE_FUNCTION void stride(iType *const s) const
Kokkos::Experimental::Impl::SharedAllocationTracker TrackType
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const
KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const
ViewMapping< DstTraits, void > DstType
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::SrcTraits Kokkos::Experimental::ViewTraits< DataType, P... > SrcTraits
KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::traits_type Kokkos::Experimental::ViewTraits< data_type, array_layout, typename SrcTraits::device_type, typename SrcTraits::memory_traits > traits_type
const ScalarType const_scalar_type
sacado_mp_vector_type::storage_type stokhos_storage_type
ViewDataType< scalar_type, scalar_dimension >::type scalar_array_type
StorageType::value_type ScalarType
Kokkos::Experimental::Impl::ViewDataType< flat_value_type, dimension >::type flat_data_type
KOKKOS_INLINE_FUNCTION MPVectorAllocation()
ViewTraits< strided_data_type, P... > dst_traits
ViewOffset< typename Traits::dimension, typename Traits::array_layout, void > offset_type
static KOKKOS_INLINE_FUNCTION void assign(DstType &dst, const SrcFadType &src, const TrackType &)
Sacado::ValueType< value_type >::type scalar_type
KOKKOS_INLINE_FUNCTION ViewMapping()
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< std::is_integral< I0 >::value &&std::is_same< typename Traits::array_layout, Kokkos::LayoutStride >::value, reference_type >::type reference(const I0 &i0) const
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< std::is_integral< I0 >::value &&! std::is_same< typename Traits::array_layout, Kokkos::LayoutStride >::value, reference_type >::type reference(const I0 &i0) const
Kokkos::Experimental::Impl::ViewMapping< typename std::enable_if<(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::specialize, ViewMPVectorContiguous >::value &&(std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutRight >::value||std::is_same< typename Kokkos::Experimental::ViewTraits< DataType, P... >::array_layout, Kokkos::LayoutStride >::value) &&!Sacado::MP::is_vector_partition< Arg0 >::value)>::type, Kokkos::Experimental::ViewTraits< DataType, P... >, Arg0, Args ... >::data_type std::conditional< rank==0, sacado_mp_vector_type, typename std::conditional< rank==1, sacado_mp_vector_type *, typename std::conditional< rank==2, sacado_mp_vector_type **, typename std::conditional< rank==3, sacado_mp_vector_type ***, typename std::conditional< rank==4, sacado_mp_vector_type ****, typename std::conditional< rank==5, sacado_mp_vector_type *****, typename std::conditional< rank==6, sacado_mp_vector_type ******, sacado_mp_vector_type *******>::type >::type >::type >::type >::type >::type >::type data_type
ViewArrayAnalysis< DataType > array_analysis
ViewMapping< dst_traits, void > dst_type
std::add_const< intrinsic_scalar_type >::type const_intrinsic_scalar_type
src_type::offset_type::dimension_type src_dimension
ScalarFunctorType m_scalar_functor
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const
ViewDataType< const_value_type, dimension >::type const_type
ViewMapping< SrcTraits, void > SrcType
KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const
ViewValueFunctor< ExecSpace, scalar_type > ScalarFunctorType
ConstructDestructFunctor< ExecSpace > create_functor(const ExecSpace &space, const bool initialize, const size_t span, const unsigned vector_size) const
Kokkos::Experimental::Impl::SharedAllocationTracker TrackType
View< T, P... > view_type
KOKKOS_INLINE_FUNCTION constexpr Traits::array_layout layout() const