10 #ifndef KOKKOS_DYN_RANK_VIEW_SACADO_FAD_HPP
11 #define KOKKOS_DYN_RANK_VIEW_SACADO_FAD_HPP
18 #if defined(HAVE_SACADO_KOKKOS)
22 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
23 #define KOKKOS_IMPL_PUBLIC_INCLUDE
24 #define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
28 #include "Kokkos_Core_fwd.hpp"
29 #include "Kokkos_Layout.hpp"
31 #ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
32 #undef KOKKOS_IMPL_PUBLIC_INCLUDE
33 #undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE
38 template<
class DataType ,
class ... Properties >
41 template<
class DataType ,
class ... Properties >
46 template<
class Space,
class T,
class ... P>
47 struct MirrorDRViewType;
51 template <
typename view_type>
52 struct is_dynrankview_fad {
static const bool value =
false; };
54 template <
typename view_type>
55 struct is_dynrankview_fad_contiguous {
static const bool value =
false; };
59 #if defined(HAVE_SACADO_VIEW_SPEC) && !defined(SACADO_DISABLE_FAD_VIEW_SPEC)
68 template<
class T ,
class ... P >
70 typename Kokkos::DynRankView<
T,P...>::HostMirror
72 const Kokkos::DynRankView<T,P...> & src,
73 typename std::enable_if<
74 ( std::is_same<
typename ViewTraits<T,P...>::specialize ,
75 Kokkos::Impl::ViewSpecializeSacadoFad >::
value ||
76 std::is_same<
typename ViewTraits<T,P...>::specialize ,
77 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::
value ) &&
78 !std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
79 Kokkos::LayoutStride >::
value >::type * = 0);
82 template<
class T ,
class ... P >
84 typename Kokkos::DynRankView<
T,P...>::HostMirror
86 const Kokkos::DynRankView<T,P...> & src,
87 typename std::enable_if<
88 ( std::is_same<
typename ViewTraits<T,P...>::specialize ,
89 Kokkos::Impl::ViewSpecializeSacadoFad >::
value ||
90 std::is_same<
typename ViewTraits<T,P...>::specialize ,
91 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::
value ) &&
92 std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout,
93 Kokkos::LayoutStride >::
value >::type * = 0);
95 template<
class Space,
class T,
class ... P>
96 typename Impl::MirrorDRViewType<Space,
T,P ...>::dest_view_type
99 const Kokkos::DynRankView<T,P...> & src,
100 typename std::enable_if<
101 std::is_same<
typename ViewTraits<T,P...>::specialize ,
102 Kokkos::Impl::ViewSpecializeSacadoFad >::
value ||
103 std::is_same<
typename ViewTraits<T,P...>::specialize ,
104 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::
value >::type * = 0);
108 template <
unsigned N,
typename T,
typename... Args>
109 KOKKOS_FUNCTION
auto as_view_of_rank_n(
110 DynRankView<T, Args...> v,
111 typename std::enable_if<
112 ( std::is_same<
typename ViewTraits<T,Args...>::specialize,
113 Kokkos::Impl::ViewSpecializeSacadoFad >::
value ||
114 std::is_same<
typename ViewTraits<T,Args...>::specialize ,
115 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::
value )
122 #include "Kokkos_DynRankView.hpp"
128 struct DynRankDimTraits<Kokkos::Impl::ViewSpecializeSacadoFad> {
130 enum :
size_t{unspecified = ~size_t(0)};
134 KOKKOS_INLINE_FUNCTION
135 static size_t computeRank(
const size_t N0
145 ( (N7 == unspecified && N6 == unspecified && N5 == unspecified && N4 == unspecified && N3 == unspecified && N2 == unspecified && N1 == unspecified && N0 == unspecified) ? 0
146 : ( (N7 == unspecified && N6 == unspecified && N5 == unspecified && N4 == unspecified && N3 == unspecified && N2 == unspecified && N1 == unspecified) ? 0
147 : ( (N7 == unspecified && N6 == unspecified && N5 == unspecified && N4 == unspecified && N3 == unspecified && N2 == unspecified) ? 1
148 : ( (N7 == unspecified && N6 == unspecified && N5 == unspecified && N4 == unspecified && N3 == unspecified) ? 2
149 : ( (N7 == unspecified && N6 == unspecified && N5 == unspecified && N4 == unspecified) ? 3
150 : ( (N7 == unspecified && N6 == unspecified && N5 == unspecified) ? 4
151 : ( (N7 == unspecified && N6 == unspecified) ? 5
152 : ( (N7 == unspecified) ? 6
157 template <
typename Layout>
158 KOKKOS_INLINE_FUNCTION
159 static size_t computeRank(
const Layout& layout )
161 return computeRank( layout.dimension[0]
162 , layout.dimension[1]
163 , layout.dimension[2]
164 , layout.dimension[3]
165 , layout.dimension[4]
166 , layout.dimension[5]
167 , layout.dimension[6]
168 , layout.dimension[7] );
172 template <
typename Layout,
typename ... P>
173 KOKKOS_INLINE_FUNCTION
174 static size_t computeRank(
const ViewCtorProp<P...>& ,
const Layout& layout )
176 size_t rank = computeRank( layout.dimension[0]
177 , layout.dimension[1]
178 , layout.dimension[2]
179 , layout.dimension[3]
180 , layout.dimension[4]
181 , layout.dimension[5]
182 , layout.dimension[6]
183 , layout.dimension[7] );
186 enum { test_traits_check = Kokkos::Impl::check_has_common_view_alloc_prop< P... >
::value };
187 return (test_traits_check ==
true) ? rank+1 : rank;
193 template <
typename Layout>
194 KOKKOS_INLINE_FUNCTION
197 Layout l( layout.dimension[0] != unspecified ? layout.dimension[0] : 1
198 , layout.dimension[1] != unspecified ? layout.dimension[1] : 1
199 , layout.dimension[2] != unspecified ? layout.dimension[2] : 1
200 , layout.dimension[3] != unspecified ? layout.dimension[3] : 1
201 , layout.dimension[4] != unspecified ? layout.dimension[4] : 1
202 , layout.dimension[5] != unspecified ? layout.dimension[5] : 1
203 , layout.dimension[6] != unspecified ? layout.dimension[6] : 1
204 , layout.dimension[7] != unspecified ? layout.dimension[7] : 1 );
205 const unsigned fad_dim = computeRank(layout);
206 const size_t fad_size = layout.dimension[
fad_dim];
208 l.dimension[7] = fad_size;
214 template <
typename Layout>
215 KOKKOS_INLINE_FUNCTION
218 Layout l( layout.dimension[0] != unspecified ? layout.dimension[0] : 1
220 , layout.dimension[1] != unspecified ? layout.dimension[1] : 1
222 , layout.dimension[2] != unspecified ? layout.dimension[2] : 1
224 , layout.dimension[3] != unspecified ? layout.dimension[3] : 1
226 , layout.dimension[4] != unspecified ? layout.dimension[4] : 1
228 , layout.dimension[5] != unspecified ? layout.dimension[5] : 1
230 , layout.dimension[6] != unspecified ? layout.dimension[6] : 1
232 , layout.dimension[7] != unspecified ? layout.dimension[7] : 1
235 const unsigned fad_dim = computeRank(layout);
236 const size_t fad_size = layout.dimension[
fad_dim];
238 l.dimension[7] = fad_size;
239 const size_t fad_stride = layout.stride[
fad_dim];
241 l.stride[7] = fad_stride;
248 template <
typename Traits,
typename ... P>
249 KOKKOS_INLINE_FUNCTION
252 using Layout =
typename Traits::array_layout;
254 Layout l( layout.dimension[0] != unspecified ? layout.dimension[0] : 1
255 , layout.dimension[1] != unspecified ? layout.dimension[1] : 1
256 , layout.dimension[2] != unspecified ? layout.dimension[2] : 1
257 , layout.dimension[3] != unspecified ? layout.dimension[3] : 1
258 , layout.dimension[4] != unspecified ? layout.dimension[4] : 1
259 , layout.dimension[5] != unspecified ? layout.dimension[5] : 1
260 , layout.dimension[6] != unspecified ? layout.dimension[6] : 1
261 , layout.dimension[7] != unspecified ? layout.dimension[7] : 1 );
263 enum { test_traits_check = Kokkos::Impl::check_has_common_view_alloc_prop< P... >
::value };
264 if (test_traits_check ==
true) {
265 l.dimension[7] = compute_fad_dim_from_alloc_prop<P...>::eval(arg_prop);
268 const unsigned fad_dim = computeRank(layout);
269 const size_t fad_size = layout.dimension[
fad_dim];
271 l.dimension[7] = fad_size;
279 template <
typename Traits,
typename ... P>
280 KOKKOS_INLINE_FUNCTION
283 using Layout =
typename Traits::array_layout;
285 Layout l( layout.dimension[0] != unspecified ? layout.dimension[0] : 1
287 , layout.dimension[1] != unspecified ? layout.dimension[1] : 1
289 , layout.dimension[2] != unspecified ? layout.dimension[2] : 1
291 , layout.dimension[3] != unspecified ? layout.dimension[3] : 1
293 , layout.dimension[4] != unspecified ? layout.dimension[4] : 1
295 , layout.dimension[5] != unspecified ? layout.dimension[5] : 1
297 , layout.dimension[6] != unspecified ? layout.dimension[6] : 1
299 , layout.dimension[7] != unspecified ? layout.dimension[7] : 1
303 enum { test_traits_check = Kokkos::Impl::check_has_common_view_alloc_prop< P... >
::value };
304 const unsigned fad_dim = computeRank(layout);
305 if (test_traits_check ==
true) {
307 l.dimension[7] = compute_fad_dim_from_alloc_prop<P...>::eval(arg_prop);
310 const size_t fad_size = layout.dimension[
fad_dim];
312 l.dimension[7] = fad_size;
314 const size_t fad_stride = layout.stride[
fad_dim];
316 l.stride[7] = fad_stride;
323 template <
typename ViewType,
typename ViewArg>
324 static ViewType createView(
const ViewArg& arg
334 typename ViewType::array_layout l( N0, N1, N2, N3, N4, N5, N6, N7 );
335 typename ViewType::array_layout l_fad = createLayout(l);
344 , l_fad.dimension[7] );
354 template <
unsigned>
struct AssignDim7 {
355 template <
typename Dst>
356 KOKKOS_INLINE_FUNCTION
357 static void eval(Dst& dst,
const size_t src_dim) {}
359 template <>
struct AssignDim7<0u> {
360 template <
typename Dst>
361 KOKKOS_INLINE_FUNCTION
362 static void eval(Dst& dst,
const size_t src_dim) {
368 template <
unsigned,
unsigned>
struct AssignFadDimStride {};
369 template <
unsigned StaticDim>
struct AssignFadDimStride<0u,StaticDim> {
370 template <
typename Src,
typename Dst>
371 KOKKOS_INLINE_FUNCTION
372 static void eval(Dst& dst,
const Src& src) {
373 dst.m_stride.S0 = 0 ;
374 dst.m_stride.S1 = 0 ;
375 dst.m_stride.S2 = 0 ;
376 dst.m_stride.S3 = 0 ;
377 dst.m_stride.S4 = 0 ;
378 dst.m_stride.S5 = 0 ;
379 dst.m_stride.S6 = 0 ;
380 dst.m_stride.S7 = src.m_stride.S0 ;
389 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N0 );
392 template <
unsigned StaticDim>
struct AssignFadDimStride<1u,StaticDim> {
393 template <
typename Src,
typename Dst>
394 KOKKOS_INLINE_FUNCTION
395 static void eval(Dst& dst,
const Src& src) {
396 dst.m_stride.S0 = src.m_stride.S0 ;
397 dst.m_stride.S1 = 0 ;
398 dst.m_stride.S2 = 0 ;
399 dst.m_stride.S3 = 0 ;
400 dst.m_stride.S4 = 0 ;
401 dst.m_stride.S5 = 0 ;
402 dst.m_stride.S6 = 0 ;
403 dst.m_stride.S7 = src.m_stride.S1 ;
405 dst.m_dim.N0 = src.m_dim.N0 ;
412 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N1 );
415 template <
unsigned StaticDim>
struct AssignFadDimStride<2u,StaticDim> {
416 template <
typename Src,
typename Dst>
417 KOKKOS_INLINE_FUNCTION
418 static void eval(Dst& dst,
const Src& src) {
419 dst.m_stride.S0 = src.m_stride.S0 ;
420 dst.m_stride.S1 = src.m_stride.S1 ;
421 dst.m_stride.S2 = 0 ;
422 dst.m_stride.S3 = 0 ;
423 dst.m_stride.S4 = 0 ;
424 dst.m_stride.S5 = 0 ;
425 dst.m_stride.S6 = 0 ;
426 dst.m_stride.S7 = src.m_stride.S2 ;
428 dst.m_dim.N0 = src.m_dim.N0 ;
429 dst.m_dim.N1 = src.m_dim.N1 ;
435 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N2 );
438 template <
unsigned StaticDim>
struct AssignFadDimStride<3u,StaticDim> {
439 template <
typename Src,
typename Dst>
440 KOKKOS_INLINE_FUNCTION
441 static void eval(Dst& dst,
const Src& src) {
442 dst.m_stride.S0 = src.m_stride.S0 ;
443 dst.m_stride.S1 = src.m_stride.S1 ;
444 dst.m_stride.S2 = src.m_stride.S2 ;
445 dst.m_stride.S3 = 0 ;
446 dst.m_stride.S4 = 0 ;
447 dst.m_stride.S5 = 0 ;
448 dst.m_stride.S6 = 0 ;
449 dst.m_stride.S7 = src.m_stride.S3 ;
451 dst.m_dim.N0 = src.m_dim.N0 ;
452 dst.m_dim.N1 = src.m_dim.N1 ;
453 dst.m_dim.N2 = src.m_dim.N2 ;
458 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N3 );
461 template <
unsigned StaticDim>
struct AssignFadDimStride<4u,StaticDim> {
462 template <
typename Src,
typename Dst>
463 KOKKOS_INLINE_FUNCTION
464 static void eval(Dst& dst,
const Src& src) {
465 dst.m_stride.S0 = src.m_stride.S0 ;
466 dst.m_stride.S1 = src.m_stride.S1 ;
467 dst.m_stride.S2 = src.m_stride.S2 ;
468 dst.m_stride.S3 = src.m_stride.S3 ;
469 dst.m_stride.S4 = 0 ;
470 dst.m_stride.S5 = 0 ;
471 dst.m_stride.S6 = 0 ;
472 dst.m_stride.S7 = src.m_stride.S4 ;
474 dst.m_dim.N0 = src.m_dim.N0 ;
475 dst.m_dim.N1 = src.m_dim.N1 ;
476 dst.m_dim.N2 = src.m_dim.N2 ;
477 dst.m_dim.N3 = src.m_dim.N3 ;
481 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N4 );
484 template <
unsigned StaticDim>
struct AssignFadDimStride<5u,StaticDim> {
485 template <
typename Src,
typename Dst>
486 KOKKOS_INLINE_FUNCTION
487 static void eval(Dst& dst,
const Src& src) {
488 dst.m_stride.S0 = src.m_stride.S0 ;
489 dst.m_stride.S1 = src.m_stride.S1 ;
490 dst.m_stride.S2 = src.m_stride.S2 ;
491 dst.m_stride.S3 = src.m_stride.S3 ;
492 dst.m_stride.S4 = src.m_stride.S4 ;
493 dst.m_stride.S5 = 0 ;
494 dst.m_stride.S6 = 0 ;
495 dst.m_stride.S7 = src.m_stride.S5 ;
497 dst.m_dim.N0 = src.m_dim.N0 ;
498 dst.m_dim.N1 = src.m_dim.N1 ;
499 dst.m_dim.N2 = src.m_dim.N2 ;
500 dst.m_dim.N3 = src.m_dim.N3 ;
501 dst.m_dim.N4 = src.m_dim.N4 ;
504 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N5 );
507 template <
unsigned StaticDim>
struct AssignFadDimStride<6u,StaticDim> {
508 template <
typename Src,
typename Dst>
509 KOKKOS_INLINE_FUNCTION
510 static void eval(Dst& dst,
const Src& src) {
511 dst.m_stride.S0 = src.m_stride.S0 ;
512 dst.m_stride.S1 = src.m_stride.S1 ;
513 dst.m_stride.S2 = src.m_stride.S2 ;
514 dst.m_stride.S3 = src.m_stride.S3 ;
515 dst.m_stride.S4 = src.m_stride.S4 ;
516 dst.m_stride.S5 = src.m_stride.S5 ;
517 dst.m_stride.S6 = 0 ;
518 dst.m_stride.S7 = src.m_stride.S6 ;
520 dst.m_dim.N0 = src.m_dim.N0 ;
521 dst.m_dim.N1 = src.m_dim.N1 ;
522 dst.m_dim.N2 = src.m_dim.N2 ;
523 dst.m_dim.N3 = src.m_dim.N3 ;
524 dst.m_dim.N4 = src.m_dim.N4 ;
525 dst.m_dim.N5 = src.m_dim.N5 ;
527 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N6 );
530 template <
unsigned StaticDim>
struct AssignFadDimStride<7u,StaticDim> {
531 template <
typename Src,
typename Dst>
532 KOKKOS_INLINE_FUNCTION
533 static void eval(Dst& dst,
const Src& src) {
534 dst.m_stride.S0 = src.m_stride.S0 ;
535 dst.m_stride.S1 = src.m_stride.S1 ;
536 dst.m_stride.S2 = src.m_stride.S2 ;
537 dst.m_stride.S3 = src.m_stride.S3 ;
538 dst.m_stride.S4 = src.m_stride.S4 ;
539 dst.m_stride.S5 = src.m_stride.S5 ;
540 dst.m_stride.S6 = src.m_stride.S6 ;
541 dst.m_stride.S7 = src.m_stride.S7 ;
543 dst.m_dim.N0 = src.m_dim.N0 ;
544 dst.m_dim.N1 = src.m_dim.N1 ;
545 dst.m_dim.N2 = src.m_dim.N2 ;
546 dst.m_dim.N3 = src.m_dim.N3 ;
547 dst.m_dim.N4 = src.m_dim.N4 ;
548 dst.m_dim.N5 = src.m_dim.N5 ;
549 dst.m_dim.N6 = src.m_dim.N6 ;
550 AssignDim7<StaticDim>::eval( dst.m_dim, src.m_dim.N7 );
555 template<
class SrcTraits ,
class ... Args >
557 < typename std::enable_if<(
558 std::is_same< typename SrcTraits::specialize ,
559 Kokkos::Impl::ViewSpecializeSacadoFad >::value
562 std::is_same< typename SrcTraits::array_layout
563 , Kokkos::LayoutLeft >::value ||
564 std::is_same< typename SrcTraits::array_layout
565 , Kokkos::LayoutRight >::value ||
566 std::is_same< typename SrcTraits::array_layout
567 , Kokkos::LayoutStride >::value
569 ), Kokkos::Impl::DynRankSubviewTag >::type
586 enum { rank = unsigned(R0) + unsigned(R1) + unsigned(R2) + unsigned(R3)
587 + unsigned(R4) + unsigned(R5) + unsigned(R6) };
589 typedef Kokkos::LayoutStride array_layout ;
591 typedef typename SrcTraits::value_type value_type ;
593 typedef value_type******* data_type ;
597 typedef Kokkos::ViewTraits
600 ,
typename SrcTraits::device_type
601 ,
typename SrcTraits::memory_traits > traits_type ;
606 ,
typename SrcTraits::device_type
607 ,
typename SrcTraits::memory_traits > type ;
610 template<
class MemoryTraits >
615 typedef Kokkos::ViewTraits
618 ,
typename SrcTraits::device_type
619 , MemoryTraits > traits_type ;
624 ,
typename SrcTraits::device_type
625 , MemoryTraits > type ;
628 template <
class Arg0 =
int,
class Arg1 =
int,
class Arg2 =
int,
class Arg3 =
int,
class Arg4 =
int,
class Arg5 =
int,
class Arg6 =
int >
629 struct ExtentGenerator {
630 template <
typename dimension>
631 KOKKOS_INLINE_FUNCTION
632 static SubviewExtents< 7 , rank > generator (
const dimension & dim , Arg0 arg0 = Arg0(), Arg1 arg1 = Arg1(), Arg2 arg2 = Arg2(), Arg3 arg3 = Arg3(), Arg4 arg4 = Arg4(), Arg5 arg5 = Arg5(), Arg6 arg6 = Arg6() )
634 return SubviewExtents< 7 , rank >( dim , arg0 , arg1 , arg2 , arg3 ,
635 arg4 , arg5 , arg6 );
639 template <
class Arg0 =
int,
class Arg1 =
int,
class Arg2 =
int,
class Arg3 =
int,
class Arg4 =
int,
class Arg5 =
int,
class Arg6 =
int >
640 struct ArrayExtentGenerator {
641 template <
typename dimension>
642 KOKKOS_INLINE_FUNCTION
643 static SubviewExtents< 8 , rank+1 > generator (
const dimension & dim , Arg0 arg0 = Arg0(), Arg1 arg1 = Arg1(), Arg2 arg2 = Arg2(), Arg3 arg3 = Arg3(), Arg4 arg4 = Arg4(), Arg5 arg5 = Arg5(), Arg6 arg6 = Arg6() )
645 return SubviewExtents< 8 , rank+1 >( dim , arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , Kokkos::ALL() );
649 typedef DynRankView< value_type , array_layout , typename SrcTraits::device_type , typename SrcTraits::memory_traits > ret_type;
651 template <
typename T ,
class ... P >
652 KOKKOS_INLINE_FUNCTION
653 static ret_type subview(
const unsigned src_rank , Kokkos::DynRankView< T , P...>
const & src , Args ... args )
656 typedef ViewMapping< traits_type, typename traits_type::specialize> DstType ;
657 typedef ViewMapping< SrcTraits, typename SrcTraits::specialize> SrcType;
658 enum { FadStaticDim = SrcType::FadStaticDimension };
659 typedef typename std::conditional< (rank==0) , ViewDimension<>
660 ,
typename std::conditional< (rank==1) , ViewDimension<0>
661 ,
typename std::conditional< (rank==2) , ViewDimension<0,0>
662 ,
typename std::conditional< (rank==3) , ViewDimension<0,0,0>
663 ,
typename std::conditional< (rank==4) , ViewDimension<0,0,0,0>
664 ,
typename std::conditional< (rank==5) , ViewDimension<0,0,0,0,0>
665 ,
typename std::conditional< (rank==6) , ViewDimension<0,0,0,0,0,0>
666 , ViewDimension<0,0,0,0,0,0,0>
667 >::type >::type >::type >::type >::type >::type >::type DstDimType ;
668 typedef typename std::conditional< (rank==0) , ViewDimension<FadStaticDim>
669 ,
typename std::conditional< (rank==1) , ViewDimension<0,FadStaticDim>
670 ,
typename std::conditional< (rank==2) , ViewDimension<0,0,FadStaticDim>
671 ,
typename std::conditional< (rank==3) , ViewDimension<0,0,0,FadStaticDim>
672 ,
typename std::conditional< (rank==4) , ViewDimension<0,0,0,0,FadStaticDim>
673 ,
typename std::conditional< (rank==5) , ViewDimension<0,0,0,0,0,FadStaticDim>
674 ,
typename std::conditional< (rank==6) , ViewDimension<0,0,0,0,0,0,FadStaticDim>
675 , ViewDimension<0,0,0,0,0,0,0,FadStaticDim>
676 >::type >::type >::type >::type >::type >::type >::type DstArrayDimType ;
678 typedef ViewOffset< DstDimType , Kokkos::LayoutStride > dst_offset_type ;
679 typedef ViewOffset< DstArrayDimType , Kokkos::LayoutStride > dst_array_offset_type ;
680 typedef typename DstType::handle_type dst_handle_type ;
684 const SubviewExtents< 7 , rank > extents =
685 ExtentGenerator< Args ... >::generator(
686 src.m_map.m_impl_offset.m_dim , args... ) ;
687 const SubviewExtents< 8 , rank+1 > array_extents =
688 ArrayExtentGenerator< Args ... >::generator(
689 src.m_map.m_array_offset.m_dim , args... ) ;
691 dst_offset_type tempdst( src.m_map.m_impl_offset , extents ) ;
692 dst_array_offset_type temparraydst(
693 src.m_map.m_array_offset , array_extents ) ;
695 dst.m_track = src.m_track ;
697 dst.m_map.m_impl_offset.m_dim.N0 = tempdst.m_dim.N0 ;
698 dst.m_map.m_impl_offset.m_dim.N1 = tempdst.m_dim.N1 ;
699 dst.m_map.m_impl_offset.m_dim.N2 = tempdst.m_dim.N2 ;
700 dst.m_map.m_impl_offset.m_dim.N3 = tempdst.m_dim.N3 ;
701 dst.m_map.m_impl_offset.m_dim.N4 = tempdst.m_dim.N4 ;
702 dst.m_map.m_impl_offset.m_dim.N5 = tempdst.m_dim.N5 ;
703 dst.m_map.m_impl_offset.m_dim.N6 = tempdst.m_dim.N6 ;
705 dst.m_map.m_impl_offset.m_stride.S0 = tempdst.m_stride.S0;
706 dst.m_map.m_impl_offset.m_stride.S1 = tempdst.m_stride.S1;
707 dst.m_map.m_impl_offset.m_stride.S2 = tempdst.m_stride.S2;
708 dst.m_map.m_impl_offset.m_stride.S3 = tempdst.m_stride.S3;
709 dst.m_map.m_impl_offset.m_stride.S4 = tempdst.m_stride.S4;
710 dst.m_map.m_impl_offset.m_stride.S5 = tempdst.m_stride.S5;
711 dst.m_map.m_impl_offset.m_stride.S6 = tempdst.m_stride.S6;
720 AssignFadDimStride<rank,FadStaticDim>::eval( dst.m_map.m_array_offset, temparraydst );
722 dst.m_track = src.m_track ;
724 dst.m_map.m_impl_handle =
726 src.m_map.m_impl_handle +
727 src.m_map.m_array_offset( array_extents.domain_offset(0)
728 , array_extents.domain_offset(1)
729 , array_extents.domain_offset(2)
730 , array_extents.domain_offset(3)
731 , array_extents.domain_offset(4)
732 , array_extents.domain_offset(5)
733 , array_extents.domain_offset(6)
734 , array_extents.domain_offset(7)
737 dst.m_map.m_fad_size = src.m_map.m_fad_size;
738 dst.m_map.m_fad_stride = src.m_map.m_fad_stride.value;
740 dst.m_rank = ( src_rank > 0 ? unsigned(R0) : 0 )
741 + ( src_rank > 1 ? unsigned(R1) : 0 )
742 + ( src_rank > 2 ? unsigned(R2) : 0 )
743 + ( src_rank > 3 ? unsigned(R3) : 0 )
744 + ( src_rank > 4 ? unsigned(R4) : 0 )
745 + ( src_rank > 5 ? unsigned(R5) : 0 )
746 + ( src_rank > 6 ? unsigned(R6) : 0 ) ;
753 template <
unsigned>
struct AssignFadDim7 {
754 template <
typename Src,
typename Dst>
755 KOKKOS_INLINE_FUNCTION
756 static void eval(Dst& dst,
const Src& src ,
const unsigned dim ) {}
759 template <>
struct AssignFadDim7<0u> {
760 template <
typename Src,
typename Dst>
761 KOKKOS_INLINE_FUNCTION
762 static void eval(Dst& dst,
const Src& src ,
const unsigned dim ) {
763 dst.m_dim.N7 = src.m_dim.extent(dim);
768 template <
typename Layout>
769 KOKKOS_INLINE_FUNCTION
771 permute_fad_layout(
const Layout& src,
const unsigned rank) {
773 dst.dimension[rank] = 1;
774 dst.dimension[7] = src.dimension[rank];
777 KOKKOS_INLINE_FUNCTION
779 permute_fad_layout(
const LayoutStride& src,
const unsigned rank) {
780 LayoutStride dst = src;
781 dst.dimension[rank] = 1;
782 dst.stride[rank] = 1;
783 dst.dimension[7] = src.dimension[rank];
784 dst.stride[7] = src.stride[rank];
792 template<
class DstTraits ,
class SrcTraits >
793 class ViewMapping< DstTraits , SrcTraits ,
794 typename std::enable_if<(
795 Kokkos::Impl::MemorySpaceAccess
796 < typename DstTraits::memory_space
797 , typename SrcTraits::memory_space >::assignable
800 std::is_same< typename DstTraits::specialize
801 , Kokkos::Impl::ViewSpecializeSacadoFad >::value
804 std::is_same< typename SrcTraits::specialize
805 , Kokkos::Impl::ViewSpecializeSacadoFad >::value
806 ), Kokkos::Impl::ViewToDynRankViewTag >::type >
810 enum { is_assignable =
true };
811 enum { is_assignable_data_type =
true };
813 typedef Kokkos::Impl::SharedAllocationTracker TrackType ;
814 typedef ViewMapping< DstTraits , typename DstTraits::specialize > DstType ;
815 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize > SrcFadType ;
817 template <
typename DT ,
typename ... DP ,
typename ST ,
typename ... SP >
818 KOKKOS_INLINE_FUNCTION
static
819 void assign( Kokkos::DynRankView< DT , DP... > & dst
820 ,
const Kokkos::View< ST , SP... >& src )
824 std::is_same<
typename DstTraits::array_layout
825 , Kokkos::LayoutLeft >::
value ||
826 std::is_same<
typename DstTraits::array_layout
827 , Kokkos::LayoutRight >::
value ||
828 std::is_same<
typename DstTraits::array_layout
829 , Kokkos::LayoutStride >::
value
833 std::is_same<
typename SrcTraits::array_layout
834 , Kokkos::LayoutLeft >::
value ||
835 std::is_same<
typename SrcTraits::array_layout
836 , Kokkos::LayoutRight >::
value ||
837 std::is_same<
typename SrcTraits::array_layout
838 , Kokkos::LayoutStride >::
value
840 ,
"View of FAD requires LayoutLeft, LayoutRight, or LayoutStride" );
843 std::is_same<
typename DstTraits::value_type
844 ,
typename SrcTraits::value_type >::
value ||
845 std::is_same<
typename DstTraits::value_type
846 ,
typename SrcTraits::const_value_type >::
value ,
847 "View assignment must have same value type or const = non-const" );
849 typedef typename DstType::offset_type dst_offset_type;
850 typedef typename DstType::array_offset_type dst_array_offset_type;
851 dst.m_map.m_array_offset =
852 dst_array_offset_type(std::integral_constant<unsigned,0>(),
853 permute_fad_layout(src.m_map.m_array_offset.layout(),
855 dst.m_map.m_impl_offset =
856 dst_offset_type(std::integral_constant<unsigned,0>(),
857 src.m_map.m_impl_offset.layout() );
859 dst.m_map.m_impl_handle = src.m_map.m_impl_handle ;
860 dst.m_rank = src.rank ;
862 dst.m_map.m_fad_size = src.m_map.m_fad_size ;
863 dst.m_map.m_fad_stride = src.m_map.m_fad_stride ;
871 template<
class DstTraits ,
class SrcTraits >
872 class ViewMapping< DstTraits , SrcTraits ,
873 typename std::enable_if<(
874 Kokkos::Impl::MemorySpaceAccess
875 < typename DstTraits::memory_space
876 , typename SrcTraits::memory_space >::assignable
879 std::is_same< typename DstTraits::specialize , void >::value
882 std::is_same< typename SrcTraits::specialize
883 , ViewSpecializeSacadoFad >::value
884 ), Kokkos::Impl::ViewToDynRankViewTag >::type >
888 enum { is_assignable =
true };
889 enum { is_assignable_data_type =
true };
891 typedef Kokkos::Impl::SharedAllocationTracker TrackType ;
892 typedef ViewMapping< DstTraits , typename DstTraits::specialize > DstType ;
893 typedef ViewMapping< SrcTraits , typename SrcTraits::specialize > SrcFadType ;
895 template <
typename DT ,
typename ... DP ,
typename ST ,
typename ... SP >
896 KOKKOS_INLINE_FUNCTION
static
897 void assign( Kokkos::DynRankView< DT , DP... > & dst
898 ,
const Kokkos::View< ST , SP... >& src )
902 std::is_same<
typename DstTraits::array_layout
903 , Kokkos::LayoutLeft >::
value ||
904 std::is_same<
typename DstTraits::array_layout
905 , Kokkos::LayoutRight >::
value ||
906 std::is_same<
typename DstTraits::array_layout
907 , Kokkos::LayoutStride >::
value
911 std::is_same<
typename SrcTraits::array_layout
912 , Kokkos::LayoutLeft >::
value ||
913 std::is_same<
typename SrcTraits::array_layout
914 , Kokkos::LayoutRight >::
value ||
915 std::is_same<
typename SrcTraits::array_layout
916 , Kokkos::LayoutStride >::
value
918 ,
"View of FAD requires LayoutLeft, LayoutRight, or LayoutStride" );
921 std::is_same<
typename DstTraits::value_type
922 ,
typename SrcTraits::value_type >::
value ||
923 std::is_same<
typename DstTraits::value_type
924 ,
typename SrcTraits::const_value_type >::
value ,
925 "View assignment must have same value type or const = non-const" );
927 typedef typename DstType::offset_type dst_offset_type;
928 dst.m_map.m_impl_offset =
929 dst_offset_type(std::integral_constant<unsigned,0>(),
930 permute_fad_layout(src.m_map.m_array_offset.layout(),
933 dst.m_map.m_impl_handle = src.m_map.m_impl_handle ;
934 dst.m_rank = src.Rank ;
942 template <
typename T,
typename ... P>
943 struct is_dynrankview_fad< DynRankView<
T,P...> > {
944 typedef DynRankView<
T,P...> view_type;
945 static const bool value =
946 std::is_same<
typename view_type::specialize,
947 Impl::ViewSpecializeSacadoFad >
::value ||
948 std::is_same<
typename view_type::specialize,
949 Impl::ViewSpecializeSacadoFadContiguous >
::value;
952 template <
typename T,
typename ... P>
953 struct is_dynrankview_fad_contiguous< DynRankView<
T,P...> > {
954 typedef DynRankView<
T,P...> view_type;
955 static const bool value =
956 std::is_same<
typename view_type::specialize,
957 Impl::ViewSpecializeSacadoFadContiguous >
::value;
960 template <
typename T,
typename ... P>
961 KOKKOS_INLINE_FUNCTION
963 std::enable_if< is_dynrankview_fad< DynRankView<
T,P...> >
::value,
unsigned >::type
964 dimension_scalar(
const DynRankView<T,P...>& view) {
965 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
966 return view.implementation_map().dimension_scalar();
968 return view.impl_map().dimension_scalar();
975 template<
class DT,
class ... DP >
977 const DynRankView<DT,DP...> & view ,
979 ,
typename std::enable_if<(
980 std::is_same<
typename ViewTraits<DT,DP...>::specialize
981 , Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
982 std::is_same<
typename ViewTraits<DT,DP...>::specialize
983 , Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value
987 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
988 typename ViewTraits<DT,DP...>::non_const_value_type >::value
989 ,
"Can only deep copy into non-const type" );
991 switch(view.rank()) {
992 case 0: deep_copy(Impl::as_view_of_rank_n<0>(view), value);
break;
993 case 1: deep_copy(Impl::as_view_of_rank_n<1>(view), value);
break;
994 case 2: deep_copy(Impl::as_view_of_rank_n<2>(view), value);
break;
995 case 3: deep_copy(Impl::as_view_of_rank_n<3>(view), value);
break;
996 case 4: deep_copy(Impl::as_view_of_rank_n<4>(view), value);
break;
997 case 5: deep_copy(Impl::as_view_of_rank_n<5>(view), value);
break;
998 case 6: deep_copy(Impl::as_view_of_rank_n<6>(view), value);
break;
999 case 7: deep_copy(Impl::as_view_of_rank_n<7>(view), value);
break;
1004 template<
class DT,
class ... DP >
1006 const DynRankView<DT,DP...> & view ,
1007 const typename DynRankView<DT,DP...>::value_type & value
1008 ,
typename std::enable_if<(
1009 std::is_same<
typename ViewTraits<DT,DP...>::specialize
1010 , Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1011 std::is_same<
typename ViewTraits<DT,DP...>::specialize
1012 , Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value
1016 std::is_same<
typename ViewTraits<DT,DP...>::value_type ,
1017 typename ViewTraits<DT,DP...>::non_const_value_type >::value
1018 ,
"Can only deep copy into non-const type" );
1020 switch(view.rank()) {
1021 case 0: deep_copy(Impl::as_view_of_rank_n<0>(view), value);
break;
1022 case 1: deep_copy(Impl::as_view_of_rank_n<1>(view), value);
break;
1023 case 2: deep_copy(Impl::as_view_of_rank_n<2>(view), value);
break;
1024 case 3: deep_copy(Impl::as_view_of_rank_n<3>(view), value);
break;
1025 case 4: deep_copy(Impl::as_view_of_rank_n<4>(view), value);
break;
1026 case 5: deep_copy(Impl::as_view_of_rank_n<5>(view), value);
break;
1027 case 6: deep_copy(Impl::as_view_of_rank_n<6>(view), value);
break;
1028 case 7: deep_copy(Impl::as_view_of_rank_n<7>(view), value);
break;
1032 template<
class DstType ,
class SrcType >
1035 (
const DstType & dst
1036 ,
const SrcType & src
1037 ,
typename std::enable_if<(
1038 ( std::is_same<
typename DstType::traits::specialize
1039 , Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1040 std::is_same<
typename DstType::traits::specialize
1041 , Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1043 ( std::is_same<
typename SrcType::traits::specialize
1044 , Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1045 std::is_same<
typename SrcType::traits::specialize
1046 , Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1053 std::is_same<
typename DstType::traits::value_type ,
1054 typename DstType::traits::non_const_value_type >::value
1055 ,
"deep_copy requires non-const destination type" );
1057 typedef DstType dst_type ;
1058 typedef SrcType src_type ;
1060 typedef typename dst_type::execution_space dst_execution_space ;
1061 typedef typename src_type::execution_space src_execution_space ;
1062 typedef typename dst_type::memory_space dst_memory_space ;
1063 typedef typename src_type::memory_space src_memory_space ;
1065 enum { DstExecCanAccessSrc =
1066 Kokkos::SpaceAccessibility< typename dst_execution_space::memory_space, src_memory_space >::accessible };
1068 enum { SrcExecCanAccessDst =
1069 Kokkos::SpaceAccessibility< typename src_execution_space::memory_space, dst_memory_space >::accessible };
1071 if ( (
void *) dst.data() != (
void*) src.data() ) {
1077 if ( rank(src) == 0 && rank(dst) == 0 )
1079 typedef typename dst_type::value_type::value_type value_type ;
1080 const size_t nbytes =
sizeof(value_type) * dst.span() ;
1082 Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes );
1085 else if ( std::is_same<
typename DstType::traits::value_type ,
1086 typename SrcType::traits::non_const_value_type >::value &&
1088 ( std::is_same<
typename DstType::traits::array_layout ,
1089 typename SrcType::traits::array_layout >::value
1091 ( std::is_same<
typename DstType::traits::array_layout ,
1092 typename Kokkos::LayoutLeft>::value
1094 std::is_same<
typename DstType::traits::array_layout ,
1095 typename Kokkos::LayoutRight>::value
1105 dst.span_is_contiguous() &&
1106 src.span_is_contiguous() &&
1107 dst.span() == src.span() &&
1108 dst.extent(0) == src.extent(0) &&
1109 dst.extent(1) == src.extent(1) &&
1110 dst.extent(2) == src.extent(2) &&
1111 dst.extent(3) == src.extent(3) &&
1112 dst.extent(4) == src.extent(4) &&
1113 dst.extent(5) == src.extent(5) &&
1114 dst.extent(6) == src.extent(6) &&
1115 dst.extent(7) == src.extent(7) ) {
1119 const size_t nbytes =
sizeof(
typename dst_type::value_type::value_type) * dst.span() ;
1122 Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes );
1125 else if ( std::is_same<
typename DstType::traits::value_type ,
1126 typename SrcType::traits::non_const_value_type >::value &&
1128 ( std::is_same<
typename DstType::traits::array_layout ,
1129 typename SrcType::traits::array_layout >::value
1131 std::is_same<
typename DstType::traits::array_layout ,
1132 typename Kokkos::LayoutStride>::value
1141 dst.span_is_contiguous() &&
1142 src.span_is_contiguous() &&
1143 dst.span() == src.span() &&
1144 dst.extent(0) == src.extent(0) &&
1145 dst.extent(1) == src.extent(1) &&
1146 dst.extent(2) == src.extent(2) &&
1147 dst.extent(3) == src.extent(3) &&
1148 dst.extent(4) == src.extent(4) &&
1149 dst.extent(5) == src.extent(5) &&
1150 dst.extent(6) == src.extent(6) &&
1151 dst.extent(7) == src.extent(7) &&
1152 dst.stride_0() == src.stride_0() &&
1153 dst.stride_1() == src.stride_1() &&
1154 dst.stride_2() == src.stride_2() &&
1155 dst.stride_3() == src.stride_3() &&
1156 dst.stride_4() == src.stride_4() &&
1157 dst.stride_5() == src.stride_5() &&
1158 dst.stride_6() == src.stride_6() &&
1159 dst.stride_7() == src.stride_7()
1162 const size_t nbytes =
sizeof(
typename dst_type::value_type::value_type) * dst.span() ;
1164 Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes );
1167 else if ( DstExecCanAccessSrc ) {
1170 Kokkos::Impl::DynRankViewRemap< dst_type , src_type >( dst , src );
1173 else if ( SrcExecCanAccessDst ) {
1176 Kokkos::Impl::DynRankViewRemap< dst_type , src_type , src_execution_space >( dst , src );
1180 Kokkos::Impl::throw_runtime_exception(
"deep_copy given views that would require a temporary allocation");
1188 template<
class T ,
class ... P >
1190 typename Kokkos::DynRankView<
T,P...>::HostMirror
1191 create_mirror(
const Kokkos::DynRankView<T,P...> & src
1192 ,
typename std::enable_if<
1193 ( std::is_same<
typename ViewTraits<T,P...>::specialize ,
1194 Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1195 std::is_same<
typename ViewTraits<T,P...>::specialize ,
1196 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1198 ! std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout
1199 , Kokkos::LayoutStride >::value
1203 typedef DynRankView<
T,P...> src_type ;
1204 typedef typename src_type::HostMirror dst_type ;
1206 typename src_type::array_layout layout = src.layout();
1207 layout.dimension[src.rank()] = Kokkos::dimension_scalar(src);
1209 return dst_type(std::string(src.label()).append(
"_mirror"),
1210 Impl::reconstructLayout(layout, src.rank()+1));
1213 template<
class T ,
class ... P >
1215 typename Kokkos::DynRankView<
T,P...>::HostMirror
1216 create_mirror(
const Kokkos::DynRankView<T,P...> & src
1217 ,
typename std::enable_if<
1218 ( std::is_same<
typename ViewTraits<T,P...>::specialize ,
1219 Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1220 std::is_same<
typename ViewTraits<T,P...>::specialize ,
1221 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1223 std::is_same<
typename Kokkos::ViewTraits<T,P...>::array_layout
1224 , Kokkos::LayoutStride >::value
1228 typedef DynRankView<
T,P...> src_type ;
1229 typedef typename src_type::HostMirror dst_type ;
1231 Kokkos::LayoutStride layout ;
1233 layout.dimension[0] = src.extent(0);
1234 layout.dimension[1] = src.extent(1);
1235 layout.dimension[2] = src.extent(2);
1236 layout.dimension[3] = src.extent(3);
1237 layout.dimension[4] = src.extent(4);
1238 layout.dimension[5] = src.extent(5);
1239 layout.dimension[6] = src.extent(6);
1240 layout.dimension[7] = src.extent(7);
1242 layout.stride[0] = src.stride_0();
1243 layout.stride[1] = src.stride_1();
1244 layout.stride[2] = src.stride_2();
1245 layout.stride[3] = src.stride_3();
1246 layout.stride[4] = src.stride_4();
1247 layout.stride[5] = src.stride_5();
1248 layout.stride[6] = src.stride_6();
1249 layout.stride[7] = src.stride_7();
1251 layout.dimension[src.rank()] = Kokkos::dimension_scalar(src);
1252 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
1253 layout.stride[src.rank()] = src.implementation_map().stride_scalar();
1255 layout.stride[src.rank()] = src.impl_map().stride_scalar();
1258 return dst_type(std::string(src.label()).append(
"_mirror"),
1259 Impl::reconstructLayout(layout, src.rank()+1));
1262 template<
class Space,
class T,
class ... P>
1263 typename Impl::MirrorDRViewType<Space,
T,P ...>::dest_view_type
1264 create_mirror(
const Space& ,
const Kokkos::DynRankView<T,P...> & src
1265 ,
typename std::enable_if<
1266 ( std::is_same<
typename ViewTraits<T,P...>::specialize ,
1267 Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1268 std::is_same<
typename ViewTraits<T,P...>::specialize ,
1269 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1271 typedef DynRankView<
T,P...> src_type ;
1272 typename src_type::array_layout layout = src.layout();
1273 layout.dimension[src.rank()] = Kokkos::dimension_scalar(src);
1274 return typename Impl::MirrorDRViewType<Space,T,P ...>::dest_view_type(
1275 src.label(),Impl::reconstructLayout(layout, src.rank()+1));
1280 template <
unsigned N,
typename T,
typename... Args>
1281 KOKKOS_FUNCTION
auto as_view_of_rank_n(
1282 DynRankView<T, Args...> v,
1283 typename std::enable_if<
1284 ( std::is_same<
typename ViewTraits<T,Args...>::specialize,
1285 Kokkos::Impl::ViewSpecializeSacadoFad >::value ||
1286 std::is_same<
typename ViewTraits<T,Args...>::specialize ,
1287 Kokkos::Impl::ViewSpecializeSacadoFadContiguous >::value )
1290 if (v.rank() !=
N) {
1292 const std::string message =
1293 "Converting DynRankView of rank " + std::to_string(v.rank()) +
1294 " to a View of mis-matched rank " + std::to_string(
N) +
"!";
1295 Kokkos::abort(message.c_str());)
1296 KOKKOS_IF_ON_DEVICE(
1297 Kokkos::abort(
"Converting DynRankView to a View of mis-matched rank!");)
1300 auto layout = v.impl_map().layout();
1301 layout.dimension[v.rank()] = Kokkos::dimension_scalar(v);
1302 return View<typename RankDataType<T, N>::type, Args...>(
1303 v.data(), Impl::reconstructLayout(layout, v.rank()+1));
1310 #endif //defined(HAVE_SACADO_VIEW_SPEC) && !defined(SACADO_DISABLE_FAD_VIEW_SPEC)
1312 #endif // defined(HAVE_SACADO_KOKKOS)
Base template specification for ScalarType.