45 #ifndef KOKKOS_VIEW_HPP
46 #define KOKKOS_VIEW_HPP
48 #include <type_traits>
51 #include <initializer_list>
53 #include <Kokkos_Core_fwd.hpp>
54 #include <Kokkos_HostSpace.hpp>
55 #include <Kokkos_MemoryTraits.hpp>
56 #include <Kokkos_ExecPolicy.hpp>
58 #if defined(KOKKOS_ENABLE_PROFILING)
59 #include <impl/Kokkos_Profiling_Interface.hpp>
68 template <
class DataType>
69 struct ViewArrayAnalysis;
71 template <
class DataType,
class ArrayLayout,
73 typename ViewArrayAnalysis<DataType>::non_const_value_type>
74 struct ViewDataAnalysis;
76 template <
class,
class...>
79 enum { is_assignable_data_type =
false };
80 enum { is_assignable =
false };
83 template <
typename IntType>
84 KOKKOS_INLINE_FUNCTION std::size_t count_valid_integers(
85 const IntType i0,
const IntType i1,
const IntType i2,
const IntType i3,
86 const IntType i4,
const IntType i5,
const IntType i6,
const IntType i7) {
87 static_assert(std::is_integral<IntType>::value,
88 "count_valid_integers() must have integer arguments.");
90 return (i0 != KOKKOS_INVALID_INDEX) + (i1 != KOKKOS_INVALID_INDEX) +
91 (i2 != KOKKOS_INVALID_INDEX) + (i3 != KOKKOS_INVALID_INDEX) +
92 (i4 != KOKKOS_INVALID_INDEX) + (i5 != KOKKOS_INVALID_INDEX) +
93 (i6 != KOKKOS_INVALID_INDEX) + (i7 != KOKKOS_INVALID_INDEX);
96 #ifndef KOKKOS_ENABLE_DEPRECATED_CODE
97 KOKKOS_INLINE_FUNCTION
98 void runtime_check_rank_device(
const size_t dyn_rank,
const bool is_void_spec,
99 const size_t i0,
const size_t i1,
100 const size_t i2,
const size_t i3,
101 const size_t i4,
const size_t i5,
102 const size_t i6,
const size_t i7) {
104 const size_t num_passed_args =
105 count_valid_integers(i0, i1, i2, i3, i4, i5, i6, i7);
107 if (num_passed_args != dyn_rank && is_void_spec) {
109 "Number of arguments passed to Kokkos::View() constructor must match "
110 "the dynamic rank of the view.");
115 KOKKOS_INLINE_FUNCTION
116 void runtime_check_rank_device(
const size_t,
const bool,
const size_t,
117 const size_t,
const size_t,
const size_t,
118 const size_t,
const size_t,
const size_t,
122 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
123 #ifndef KOKKOS_ENABLE_DEPRECATED_CODE
124 KOKKOS_INLINE_FUNCTION
125 void runtime_check_rank_host(
const size_t dyn_rank,
const bool is_void_spec,
126 const size_t i0,
const size_t i1,
const size_t i2,
127 const size_t i3,
const size_t i4,
const size_t i5,
128 const size_t i6,
const size_t i7,
129 const std::string& label) {
131 const size_t num_passed_args =
132 count_valid_integers(i0, i1, i2, i3, i4, i5, i6, i7);
134 if (num_passed_args != dyn_rank) {
135 const std::string message =
136 "Constructor for Kokkos View '" + label +
137 "' has mismatched number of arguments. Number of arguments = " +
138 std::to_string(num_passed_args) +
139 " but dynamic rank = " + std::to_string(dyn_rank) +
" \n";
140 Kokkos::abort(message.c_str());
145 KOKKOS_INLINE_FUNCTION
146 void runtime_check_rank_host(
const size_t,
const bool,
const size_t,
147 const size_t,
const size_t,
const size_t,
148 const size_t,
const size_t,
const size_t,
149 const size_t,
const std::string&) {}
159 template <
class ViewType,
int Traits = 0>
160 struct ViewUniformType;
186 template <
class DataType,
class... Properties>
191 typedef void execution_space;
192 typedef void memory_space;
193 typedef void HostMirrorSpace;
194 typedef void array_layout;
195 typedef void memory_traits;
196 typedef void specialize;
199 template <
class... Prop>
202 typedef typename ViewTraits<void, Prop...>::execution_space execution_space;
203 typedef typename ViewTraits<void, Prop...>::memory_space memory_space;
204 typedef typename ViewTraits<void, Prop...>::HostMirrorSpace HostMirrorSpace;
205 typedef typename ViewTraits<void, Prop...>::array_layout array_layout;
206 typedef typename ViewTraits<void, Prop...>::memory_traits memory_traits;
207 typedef typename ViewTraits<void, Prop...>::specialize specialize;
210 template <
class ArrayLayout,
class... Prop>
211 struct ViewTraits<typename std::enable_if<
212 Kokkos::Impl::is_array_layout<ArrayLayout>::value>::type,
213 ArrayLayout, Prop...> {
216 typedef typename ViewTraits<void, Prop...>::execution_space execution_space;
217 typedef typename ViewTraits<void, Prop...>::memory_space memory_space;
218 typedef typename ViewTraits<void, Prop...>::HostMirrorSpace HostMirrorSpace;
219 typedef ArrayLayout array_layout;
220 typedef typename ViewTraits<void, Prop...>::memory_traits memory_traits;
221 typedef typename ViewTraits<void, Prop...>::specialize specialize;
224 template <
class Space,
class... Prop>
226 typename std::enable_if<Kokkos::Impl::is_space<Space>::value>::type, Space,
231 std::is_same<
typename ViewTraits<void, Prop...>::execution_space,
233 std::is_same<
typename ViewTraits<void, Prop...>::memory_space,
235 std::is_same<
typename ViewTraits<void, Prop...>::HostMirrorSpace,
237 std::is_same<
typename ViewTraits<void, Prop...>::array_layout,
239 "Only one View Execution or Memory Space template argument");
241 typedef typename Space::execution_space execution_space;
242 typedef typename Space::memory_space memory_space;
243 typedef typename Kokkos::Impl::HostMirror<Space>::Space::memory_space
245 typedef typename execution_space::array_layout array_layout;
246 typedef typename ViewTraits<void, Prop...>::memory_traits memory_traits;
247 typedef typename ViewTraits<void, Prop...>::specialize specialize;
250 template <
class MemoryTraits,
class... Prop>
251 struct ViewTraits<typename std::enable_if<Kokkos::Impl::is_memory_traits<
252 MemoryTraits>::value>::type,
253 MemoryTraits, Prop...> {
257 std::is_same<
typename ViewTraits<void, Prop...>::execution_space,
259 std::is_same<
typename ViewTraits<void, Prop...>::memory_space,
261 std::is_same<
typename ViewTraits<void, Prop...>::array_layout,
263 std::is_same<
typename ViewTraits<void, Prop...>::memory_traits,
265 "MemoryTrait is the final optional template argument for a View");
267 typedef void execution_space;
268 typedef void memory_space;
269 typedef void HostMirrorSpace;
270 typedef void array_layout;
271 typedef MemoryTraits memory_traits;
272 typedef void specialize;
275 template <
class DataType,
class... Properties>
279 typedef ViewTraits<void, Properties...> prop;
281 typedef typename std::conditional<
282 !std::is_same<typename prop::execution_space, void>::value,
283 typename prop::execution_space, Kokkos::DefaultExecutionSpace>::type
286 typedef typename std::conditional<
287 !std::is_same<typename prop::memory_space, void>::value,
288 typename prop::memory_space,
typename ExecutionSpace::memory_space>::type
291 typedef typename std::conditional<
292 !std::is_same<typename prop::array_layout, void>::value,
293 typename prop::array_layout,
typename ExecutionSpace::array_layout>::type
296 typedef typename std::conditional<
297 !std::is_same<typename prop::HostMirrorSpace, void>::value,
298 typename prop::HostMirrorSpace,
299 typename Kokkos::Impl::HostMirror<ExecutionSpace>::Space>::type
302 typedef typename std::conditional<
303 !std::is_same<typename prop::memory_traits, void>::value,
304 typename prop::memory_traits,
typename Kokkos::MemoryManaged>::type
309 typedef Kokkos::Impl::ViewDataAnalysis<DataType, ArrayLayout> data_analysis;
315 typedef typename data_analysis::type data_type;
316 typedef typename data_analysis::const_type const_data_type;
317 typedef typename data_analysis::non_const_type non_const_data_type;
322 typedef typename data_analysis::scalar_array_type scalar_array_type;
324 typename data_analysis::const_scalar_array_type const_scalar_array_type;
325 typedef typename data_analysis::non_const_scalar_array_type
326 non_const_scalar_array_type;
331 typedef typename data_analysis::value_type value_type;
332 typedef typename data_analysis::const_value_type const_value_type;
333 typedef typename data_analysis::non_const_value_type non_const_value_type;
338 typedef ArrayLayout array_layout;
339 typedef typename data_analysis::dimension dimension;
341 typedef typename std::conditional<
342 std::is_same<typename data_analysis::specialize, void>::value,
343 typename prop::specialize,
typename data_analysis::specialize>::type
346 enum {
rank = dimension::rank };
347 enum { rank_dynamic = dimension::rank_dynamic };
352 typedef ExecutionSpace execution_space;
353 typedef MemorySpace memory_space;
354 typedef Kokkos::Device<ExecutionSpace, MemorySpace> device_type;
355 typedef MemoryTraits memory_traits;
356 typedef HostMirrorSpace host_mirror_space;
358 typedef typename MemorySpace::size_type size_type;
360 enum { is_hostspace = std::is_same<MemorySpace, HostSpace>::value };
361 enum { is_managed = MemoryTraits::is_unmanaged == 0 };
362 enum { is_random_access = MemoryTraits::is_random_access == 1 };
450 template <
class DataType,
class... Properties>
453 template <
class T1,
class T2>
454 struct is_always_assignable_impl;
456 template <
class... ViewTDst,
class... ViewTSrc>
457 struct is_always_assignable_impl<Kokkos::
View<ViewTDst...>,
459 using mapping_type = Kokkos::Impl::ViewMapping<
462 typename Kokkos::View<ViewTDst...>::traits::specialize>;
464 constexpr
static bool value =
465 mapping_type::is_assignable &&
466 static_cast<int>(
Kokkos::View<ViewTDst...>::rank_dynamic) >=
470 template <
class View1,
class View2>
471 using is_always_assignable = is_always_assignable_impl<
472 typename std::remove_reference<View1>::type,
473 typename std::remove_const<
474 typename std::remove_reference<View2>::type>::type>;
476 #ifdef KOKKOS_ENABLE_CXX17
477 template <
class T1,
class T2>
478 inline constexpr
bool is_always_assignable_v =
479 is_always_assignable<T1, T2>::value;
482 template <
class... ViewTDst,
class... ViewTSrc>
485 using DstTraits =
typename Kokkos::View<ViewTDst...>::traits;
486 using SrcTraits =
typename Kokkos::View<ViewTSrc...>::traits;
488 Kokkos::Impl::ViewMapping<DstTraits, SrcTraits,
489 typename DstTraits::specialize>;
491 #ifdef KOKKOS_ENABLE_CXX17
492 return is_always_assignable_v<
Kokkos::View<ViewTDst...>,
498 (mapping_type::is_assignable &&
499 ((DstTraits::dimension::rank_dynamic >= 1) ||
500 (dst.static_extent(0) == src.
extent(0))) &&
501 ((DstTraits::dimension::rank_dynamic >= 2) ||
502 (dst.static_extent(1) == src.
extent(1))) &&
503 ((DstTraits::dimension::rank_dynamic >= 3) ||
504 (dst.static_extent(2) == src.
extent(2))) &&
505 ((DstTraits::dimension::rank_dynamic >= 4) ||
506 (dst.static_extent(3) == src.
extent(3))) &&
507 ((DstTraits::dimension::rank_dynamic >= 5) ||
508 (dst.static_extent(4) == src.
extent(4))) &&
509 ((DstTraits::dimension::rank_dynamic >= 6) ||
510 (dst.static_extent(5) == src.
extent(5))) &&
511 ((DstTraits::dimension::rank_dynamic >= 7) ||
512 (dst.static_extent(6) == src.
extent(6))) &&
513 ((DstTraits::dimension::rank_dynamic >= 8) ||
514 (dst.static_extent(7) == src.
extent(7))));
522 #include <impl/Kokkos_ViewMapping.hpp>
523 #include <impl/Kokkos_ViewArray.hpp>
532 constexpr Kokkos::Impl::ALL_t ALL = Kokkos::Impl::ALL_t();
534 constexpr Kokkos::Impl::WithoutInitializing_t WithoutInitializing =
535 Kokkos::Impl::WithoutInitializing_t();
537 constexpr Kokkos::Impl::AllowPadding_t AllowPadding =
538 Kokkos::Impl::AllowPadding_t();
552 template <
class... Args>
553 inline Impl::ViewCtorProp<typename Impl::ViewCtorProp<void, Args>::type...>
555 typedef Impl::ViewCtorProp<typename Impl::ViewCtorProp<void, Args>::type...>
558 static_assert(!return_type::has_pointer,
559 "Cannot give pointer-to-memory for view allocation");
561 return return_type(args...);
564 template <
class... Args>
565 KOKKOS_INLINE_FUNCTION
566 Impl::ViewCtorProp<typename Impl::ViewCtorProp<void, Args>::type...>
567 view_wrap(Args
const&... args) {
568 typedef Impl::ViewCtorProp<typename Impl::ViewCtorProp<void, Args>::type...>
571 static_assert(!return_type::has_memory_space &&
572 !return_type::has_execution_space &&
573 !return_type::has_label && return_type::has_pointer,
574 "Must only give pointer-to-memory for view wrapping");
576 return return_type(args...);
586 template <
class DataType,
class... Properties>
590 struct is_view :
public std::false_type {};
592 template <
class D,
class... P>
593 struct is_view<
View<D, P...>> :
public std::true_type {};
595 template <
class D,
class... P>
596 struct is_view<const
View<D, P...>> :
public std::true_type {};
598 template <
class DataType,
class... Properties>
599 class View :
public ViewTraits<DataType, Properties...> {
601 template <
class,
class...>
603 template <
class,
class...>
604 friend class Kokkos::Impl::ViewMapping;
607 typedef ViewTraits<DataType, Properties...> traits;
610 typedef Kokkos::Impl::ViewMapping<traits, typename traits::specialize>
612 typedef Kokkos::Impl::SharedAllocationTracker track_type;
620 typedef View<
typename traits::scalar_array_type,
621 typename traits::array_layout,
typename traits::device_type,
622 typename traits::memory_traits>
626 typedef View<
typename traits::const_data_type,
typename traits::array_layout,
627 typename traits::device_type,
typename traits::memory_traits>
631 typedef View<
typename traits::non_const_data_type,
632 typename traits::array_layout,
typename traits::device_type,
633 typename traits::memory_traits>
637 typedef View<
typename traits::non_const_data_type,
638 typename traits::array_layout,
639 Device<DefaultHostExecutionSpace,
640 typename traits::host_mirror_space::memory_space>>
644 typedef View<
typename traits::non_const_data_type,
645 typename traits::array_layout,
646 typename traits::host_mirror_space>
652 typename Impl::ViewUniformType<View, 0>::const_type uniform_const_type;
653 typedef typename Impl::ViewUniformType<View, 0>::runtime_type
654 uniform_runtime_type;
655 typedef typename Impl::ViewUniformType<View, 0>::runtime_const_type
656 uniform_runtime_const_type;
657 typedef typename Impl::ViewUniformType<View, 0>::nomemspace_type
658 uniform_nomemspace_type;
659 typedef typename Impl::ViewUniformType<View, 0>::const_nomemspace_type
660 uniform_const_nomemspace_type;
661 typedef typename Impl::ViewUniformType<View, 0>::runtime_nomemspace_type
662 uniform_runtime_nomemspace_type;
663 typedef typename Impl::ViewUniformType<View, 0>::runtime_const_nomemspace_type
664 uniform_runtime_const_nomemspace_type;
669 enum { Rank = map_type::Rank };
677 template <
typename iType>
678 KOKKOS_INLINE_FUNCTION constexpr
679 typename std::enable_if<std::is_integral<iType>::value,
size_t>::type
681 return m_map.extent(r);
684 static KOKKOS_INLINE_FUNCTION constexpr
size_t static_extent(
685 const unsigned r) noexcept {
686 return map_type::static_extent(r);
689 template <
typename iType>
690 KOKKOS_INLINE_FUNCTION constexpr
691 typename std::enable_if<std::is_integral<iType>::value,
int>::type
692 extent_int(
const iType& r)
const noexcept {
693 return static_cast<int>(m_map.extent(r));
696 KOKKOS_INLINE_FUNCTION constexpr
typename traits::array_layout layout()
698 return m_map.layout();
706 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
708 template <
typename iType>
709 KOKKOS_INLINE_FUNCTION constexpr
710 typename std::enable_if<std::is_integral<iType>::value,
size_t>::type
711 dimension(
const iType& r)
const {
715 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_0()
const {
716 return m_map.dimension_0();
718 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_1()
const {
719 return m_map.dimension_1();
721 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_2()
const {
722 return m_map.dimension_2();
724 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_3()
const {
725 return m_map.dimension_3();
727 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_4()
const {
728 return m_map.dimension_4();
730 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_5()
const {
731 return m_map.dimension_5();
733 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_6()
const {
734 return m_map.dimension_6();
736 KOKKOS_INLINE_FUNCTION constexpr
size_t dimension_7()
const {
737 return m_map.dimension_7();
744 KOKKOS_INLINE_FUNCTION constexpr
size_t size()
const {
745 return m_map.dimension_0() * m_map.dimension_1() * m_map.dimension_2() *
746 m_map.dimension_3() * m_map.dimension_4() * m_map.dimension_5() *
747 m_map.dimension_6() * m_map.dimension_7();
750 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_0()
const {
751 return m_map.stride_0();
753 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_1()
const {
754 return m_map.stride_1();
756 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_2()
const {
757 return m_map.stride_2();
759 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_3()
const {
760 return m_map.stride_3();
762 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_4()
const {
763 return m_map.stride_4();
765 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_5()
const {
766 return m_map.stride_5();
768 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_6()
const {
769 return m_map.stride_6();
771 KOKKOS_INLINE_FUNCTION constexpr
size_t stride_7()
const {
772 return m_map.stride_7();
775 template <
typename iType>
776 KOKKOS_INLINE_FUNCTION constexpr
777 typename std::enable_if<std::is_integral<iType>::value,
size_t>::type
778 stride(iType r)
const {
794 : m_map.stride_7())))))));
797 template <
typename iType>
798 KOKKOS_INLINE_FUNCTION
void stride(iType*
const s)
const {
805 typedef typename map_type::reference_type reference_type;
806 typedef typename map_type::pointer_type pointer_type;
809 reference_type_is_lvalue_reference =
810 std::is_lvalue_reference<reference_type>::value
813 KOKKOS_INLINE_FUNCTION constexpr
size_t span()
const {
return m_map.span(); }
814 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
816 KOKKOS_INLINE_FUNCTION constexpr
size_t capacity()
const {
820 KOKKOS_INLINE_FUNCTION
bool span_is_contiguous()
const {
821 return m_map.span_is_contiguous();
823 KOKKOS_INLINE_FUNCTION constexpr pointer_type data()
const {
827 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
829 KOKKOS_INLINE_FUNCTION constexpr
bool is_contiguous()
const {
830 return m_map.span_is_contiguous();
833 KOKKOS_INLINE_FUNCTION constexpr pointer_type ptr_on_device()
const {
841 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
842 KOKKOS_INLINE_FUNCTION
843 const Kokkos::Impl::ViewMapping<traits, typename traits::specialize>&
844 implementation_map()
const {
848 KOKKOS_INLINE_FUNCTION
849 const Kokkos::Impl::ViewMapping<traits, typename traits::specialize>&
853 KOKKOS_INLINE_FUNCTION
854 const Kokkos::Impl::SharedAllocationTracker& impl_track()
const {
860 static constexpr
bool is_layout_left =
861 std::is_same<typename traits::array_layout, Kokkos::LayoutLeft>::value;
863 static constexpr
bool is_layout_right =
864 std::is_same<typename traits::array_layout, Kokkos::LayoutRight>::value;
866 static constexpr
bool is_layout_stride =
867 std::is_same<typename traits::array_layout, Kokkos::LayoutStride>::value;
869 static constexpr
bool is_default_map =
870 std::is_same<typename traits::specialize, void>::value &&
871 (is_layout_left || is_layout_right || is_layout_stride);
874 Space,
typename traits::memory_space>::accessible>
875 struct verify_space {
876 KOKKOS_FORCEINLINE_FUNCTION
static void check() {}
879 template <
class Space>
880 struct verify_space<Space, false> {
881 KOKKOS_FORCEINLINE_FUNCTION
static void check() {
883 "Kokkos::View ERROR: attempt to access inaccessible memory space");
887 #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK)
889 #define KOKKOS_IMPL_SINK(ARG) ARG
891 #define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(ARG) \
892 View::template verify_space< \
893 Kokkos::Impl::ActiveExecutionMemorySpace>::check(); \
894 Kokkos::Impl::view_verify_operator_bounds<typename traits::memory_space> ARG;
898 #define KOKKOS_IMPL_SINK(ARG)
900 #define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(ARG) \
901 View::template verify_space< \
902 Kokkos::Impl::ActiveExecutionMemorySpace>::check();
907 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
908 template <
class... Args>
909 KOKKOS_FORCEINLINE_FUNCTION
910 typename std::enable_if<(Kokkos::Impl::are_integral<Args...>::value &&
912 reference_type>::type
913 operator()(Args... args)
const {
914 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, args...))
915 return m_map.reference();
918 template <typename I0, class... Args>
919 KOKKOS_FORCEINLINE_FUNCTION
920 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
921 (1 == Rank) && !is_default_map),
922 reference_type>::type
923 operator()(const I0& i0, Args... args)
const {
924 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...))
925 return m_map.reference(i0);
928 template <typename I0, class... Args>
929 KOKKOS_FORCEINLINE_FUNCTION
930 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
931 (1 == Rank) && is_default_map &&
933 reference_type>::type
934 operator()(const I0& i0, Args... args)
const {
935 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...))
936 return m_map.m_impl_handle[i0];
939 template <typename I0, class... Args>
940 KOKKOS_FORCEINLINE_FUNCTION
941 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
942 (1 == Rank) && is_default_map &&
944 reference_type>::type
945 operator()(const I0& i0, Args... args)
const {
946 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...))
947 return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0];
953 template <typename I0>
954 KOKKOS_FORCEINLINE_FUNCTION
955 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
956 (1 == Rank) && !is_default_map),
957 reference_type>::type
958 operator[](const I0& i0)
const {
959 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
960 return m_map.reference(i0);
963 template <typename I0>
964 KOKKOS_FORCEINLINE_FUNCTION
965 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
966 (1 == Rank) && is_default_map &&
968 reference_type>::type
969 operator[](const I0& i0)
const {
970 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
971 return m_map.m_impl_handle[i0];
974 template <typename I0>
975 KOKKOS_FORCEINLINE_FUNCTION
976 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
977 (1 == Rank) && is_default_map &&
979 reference_type>::type
980 operator[](const I0& i0)
const {
981 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
982 return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0];
985 template <typename I0, typename I1, class... Args>
986 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
987 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
989 reference_type>::type
990 operator()(const I0& i0, const I1& i1, Args... args)
const {
991 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
992 return m_map.reference(i0, i1);
995 template <typename I0, typename I1, class... Args>
996 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
997 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
998 is_default_map && is_layout_left && (traits::rank_dynamic == 0)),
999 reference_type>::type
1000 operator()(const I0& i0, const I1& i1, Args... args)
const {
1001 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
1002 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_dim.N0 * i1];
1005 template <typename I0, typename I1, class... Args>
1006 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1007 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1008 is_default_map && is_layout_left && (traits::rank_dynamic != 0)),
1009 reference_type>::type
1010 operator()(const I0& i0, const I1& i1, Args... args)
const {
1011 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
1012 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_stride * i1];
1015 template <typename I0, typename I1, class... Args>
1016 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1017 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1018 is_default_map && is_layout_right && (traits::rank_dynamic == 0)),
1019 reference_type>::type
1020 operator()(const I0& i0, const I1& i1, Args... args)
const {
1021 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
1022 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_dim.N1 * i0];
1025 template <typename I0, typename I1, class... Args>
1026 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1027 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1028 is_default_map && is_layout_right && (traits::rank_dynamic != 0)),
1029 reference_type>::type
1030 operator()(const I0& i0, const I1& i1, Args... args)
const {
1031 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
1032 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_stride * i0];
1035 template <typename I0, typename I1, class... Args>
1036 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1037 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1038 is_default_map && is_layout_stride),
1039 reference_type>::type
1040 operator()(const I0& i0, const I1& i1, Args... args)
const {
1041 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...))
1042 return m_map.m_impl_handle[i0 * m_map.m_impl_offset.m_stride.S0 +
1043 i1 * m_map.m_impl_offset.m_stride.S1];
1049 template <typename I0, typename I1, typename I2, class... Args>
1050 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1051 (Kokkos::Impl::are_integral<I0, I1, I2, Args...>::value && (3 == Rank) &&
1053 reference_type>::type
1054 operator()(const I0& i0, const I1& i1, const I2& i2, Args... args)
const {
1055 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, args...))
1056 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2)];
1059 template <typename I0, typename I1, typename I2, class... Args>
1060 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1061 (Kokkos::Impl::are_integral<I0, I1, I2, Args...>::value && (3 == Rank) &&
1063 reference_type>::type
1064 operator()(const I0& i0, const I1& i1, const I2& i2, Args... args)
const {
1065 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, args...))
1066 return m_map.reference(i0, i1, i2);
1072 template <typename I0, typename I1, typename I2, typename I3, class... Args>
1073 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1074 (Kokkos::Impl::are_integral<I0, I1, I2, I3, Args...>::value &&
1075 (4 == Rank) && is_default_map),
1076 reference_type>::type
1077 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1078 Args... args)
const {
1079 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, args...))
1080 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3)];
1083 template <typename I0, typename I1, typename I2, typename I3, class... Args>
1084 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1085 (Kokkos::Impl::are_integral<I0, I1, I2, I3, Args...>::value &&
1086 (4 == Rank) && !is_default_map),
1087 reference_type>::type
1088 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1089 Args... args)
const {
1090 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, args...))
1091 return m_map.reference(i0, i1, i2, i3);
1097 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1099 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1100 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, Args...>::value &&
1101 (5 == Rank) && is_default_map),
1102 reference_type>::type
1103 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1104 const I4& i4, Args... args)
const {
1105 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1106 (m_track, m_map, i0, i1, i2, i3, i4, args...))
1107 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4)];
1110 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1112 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1113 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, Args...>::value &&
1114 (5 == Rank) && !is_default_map),
1115 reference_type>::type
1116 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1117 const I4& i4, Args... args)
const {
1118 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1119 (m_track, m_map, i0, i1, i2, i3, i4, args...))
1120 return m_map.reference(i0, i1, i2, i3, i4);
1126 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1127 typename I5, class... Args>
1128 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1129 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, Args...>::value &&
1130 (6 == Rank) && is_default_map),
1131 reference_type>::type
1132 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1133 const I4& i4, const I5& i5, Args... args)
const {
1134 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1135 (m_track, m_map, i0, i1, i2, i3, i4, i5, args...))
1136 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5)];
1139 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1140 typename I5, class... Args>
1141 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1142 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, Args...>::value &&
1143 (6 == Rank) && !is_default_map),
1144 reference_type>::type
1145 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1146 const I4& i4, const I5& i5, Args... args)
const {
1147 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1148 (m_track, m_map, i0, i1, i2, i3, i4, i5, args...))
1149 return m_map.reference(i0, i1, i2, i3, i4, i5);
1155 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1156 typename I5, typename I6, class... Args>
1157 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1158 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, Args...>::value &&
1159 (7 == Rank) && is_default_map),
1160 reference_type>::type
1161 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1162 const I4& i4, const I5& i5, const I6& i6, Args... args)
const {
1163 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1164 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...))
1165 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6)];
1168 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1169 typename I5, typename I6, class... Args>
1170 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1171 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, Args...>::value &&
1172 (7 == Rank) && !is_default_map),
1173 reference_type>::type
1174 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1175 const I4& i4, const I5& i5, const I6& i6, Args... args)
const {
1176 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1177 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...))
1178 return m_map.reference(i0, i1, i2, i3, i4, i5, i6);
1184 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1185 typename I5, typename I6, typename I7, class... Args>
1186 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1187 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7,
1189 (8 == Rank) && is_default_map),
1190 reference_type>::type
1191 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1192 const I4& i4, const I5& i5, const I6& i6, const I7& i7,
1193 Args... args)
const {
1194 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1195 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...))
1197 .m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6, i7)];
1200 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1201 typename I5, typename I6, typename I7, class... Args>
1202 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1203 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7,
1205 (8 == Rank) && !is_default_map),
1206 reference_type>::type
1207 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1208 const I4& i4, const I5& i5, const I6& i6, const I7& i7,
1209 Args... args)
const {
1210 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1211 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...))
1212 return m_map.reference(i0, i1, i2, i3, i4, i5, i6, i7);
1219 KOKKOS_FORCEINLINE_FUNCTION
1220 reference_type operator()()
const {
return m_map.reference(); }
1224 template <
typename I0>
1225 KOKKOS_FORCEINLINE_FUNCTION
1226 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1227 (1 == Rank) && !is_default_map),
1228 reference_type>::type
1229 operator()(
const I0& i0)
const {
1230 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1231 return m_map.reference(i0);
1234 template <typename I0>
1235 KOKKOS_FORCEINLINE_FUNCTION
1236 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1237 (1 == Rank) && is_default_map &&
1239 reference_type>::type
1240 operator()(const I0& i0)
const {
1241 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1242 return m_map.m_impl_handle[i0];
1245 template <typename I0>
1246 KOKKOS_FORCEINLINE_FUNCTION
1247 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1248 (1 == Rank) && is_default_map &&
1250 reference_type>::type
1251 operator()(const I0& i0)
const {
1252 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1253 return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0];
1258 template <typename I0>
1259 KOKKOS_FORCEINLINE_FUNCTION
1260 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1261 (1 == Rank) && !is_default_map),
1262 reference_type>::type
1263 operator[](const I0& i0)
const {
1264 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1265 return m_map.reference(i0);
1268 template <typename I0>
1269 KOKKOS_FORCEINLINE_FUNCTION
1270 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1271 (1 == Rank) && is_default_map &&
1273 reference_type>::type
1274 operator[](const I0& i0)
const {
1275 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1276 return m_map.m_impl_handle[i0];
1279 template <typename I0>
1280 KOKKOS_FORCEINLINE_FUNCTION
1281 typename std::enable_if<(Kokkos::Impl::are_integral<I0>::value &&
1282 (1 == Rank) && is_default_map &&
1284 reference_type>::type
1285 operator[](const I0& i0)
const {
1286 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0))
1287 return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0];
1293 template <typename I0, typename I1>
1294 KOKKOS_FORCEINLINE_FUNCTION
1295 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1296 (2 == Rank) && !is_default_map),
1297 reference_type>::type
1298 operator()(const I0& i0, const I1& i1)
const {
1299 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1300 return m_map.reference(i0, i1);
1303 template <typename I0, typename I1>
1304 KOKKOS_FORCEINLINE_FUNCTION
1305 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1306 (2 == Rank) && is_default_map &&
1307 is_layout_left && (traits::rank_dynamic == 0)),
1308 reference_type>::type
1309 operator()(const I0& i0, const I1& i1)
const {
1310 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1311 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_dim.N0 * i1];
1314 template <typename I0, typename I1>
1315 KOKKOS_FORCEINLINE_FUNCTION
1316 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1317 (2 == Rank) && is_default_map &&
1318 is_layout_left && (traits::rank_dynamic != 0)),
1319 reference_type>::type
1320 operator()(const I0& i0, const I1& i1)
const {
1321 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1322 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_stride * i1];
1325 template <typename I0, typename I1>
1326 KOKKOS_FORCEINLINE_FUNCTION
1327 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1328 (2 == Rank) && is_default_map &&
1329 is_layout_right && (traits::rank_dynamic == 0)),
1330 reference_type>::type
1331 operator()(const I0& i0, const I1& i1)
const {
1332 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1333 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_dim.N1 * i0];
1336 template <typename I0, typename I1>
1337 KOKKOS_FORCEINLINE_FUNCTION
1338 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1339 (2 == Rank) && is_default_map &&
1340 is_layout_right && (traits::rank_dynamic != 0)),
1341 reference_type>::type
1342 operator()(const I0& i0, const I1& i1)
const {
1343 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1344 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_stride * i0];
1347 template <typename I0, typename I1>
1348 KOKKOS_FORCEINLINE_FUNCTION
1349 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1>::value &&
1350 (2 == Rank) && is_default_map &&
1352 reference_type>::type
1353 operator()(const I0& i0, const I1& i1)
const {
1354 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1))
1355 return m_map.m_impl_handle[i0 * m_map.m_impl_offset.m_stride.S0 +
1356 i1 * m_map.m_impl_offset.m_stride.S1];
1362 template <typename I0, typename I1, typename I2>
1363 KOKKOS_FORCEINLINE_FUNCTION
1364 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1, I2>::value &&
1365 (3 == Rank) && is_default_map),
1366 reference_type>::type
1367 operator()(const I0& i0, const I1& i1, const I2& i2)
const {
1368 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2))
1369 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2)];
1372 template <typename I0, typename I1, typename I2>
1373 KOKKOS_FORCEINLINE_FUNCTION
1374 typename std::enable_if<(Kokkos::Impl::are_integral<I0, I1, I2>::value &&
1375 (3 == Rank) && !is_default_map),
1376 reference_type>::type
1377 operator()(const I0& i0, const I1& i1, const I2& i2)
const {
1378 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2))
1379 return m_map.reference(i0, i1, i2);
1385 template <typename I0, typename I1, typename I2, typename I3>
1386 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1387 (Kokkos::Impl::are_integral<I0, I1, I2, I3>::value && (4 == Rank) &&
1389 reference_type>::type
1390 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3)
const {
1391 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3))
1392 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3)];
1395 template <typename I0, typename I1, typename I2, typename I3>
1396 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1397 (Kokkos::Impl::are_integral<I0, I1, I2, I3>::value && (4 == Rank) &&
1399 reference_type>::type
1400 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3)
const {
1401 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3))
1402 return m_map.reference(i0, i1, i2, i3);
1408 template <typename I0, typename I1, typename I2, typename I3, typename I4>
1409 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1410 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4>::value && (5 == Rank) &&
1412 reference_type>::type
1413 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1414 const I4& i4)
const {
1415 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, i4))
1416 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4)];
1419 template <typename I0, typename I1, typename I2, typename I3, typename I4>
1420 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1421 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4>::value && (5 == Rank) &&
1423 reference_type>::type
1424 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1425 const I4& i4)
const {
1426 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, i4))
1427 return m_map.reference(i0, i1, i2, i3, i4);
1433 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1435 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1436 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5>::value &&
1437 (6 == Rank) && is_default_map),
1438 reference_type>::type
1439 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1440 const I4& i4, const I5& i5)
const {
1441 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, i4, i5))
1442 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5)];
1445 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1447 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1448 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5>::value &&
1449 (6 == Rank) && !is_default_map),
1450 reference_type>::type
1451 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1452 const I4& i4, const I5& i5)
const {
1453 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, i4, i5))
1454 return m_map.reference(i0, i1, i2, i3, i4, i5);
1460 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1461 typename I5, typename I6>
1462 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1463 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6>::value &&
1464 (7 == Rank) && is_default_map),
1465 reference_type>::type
1466 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1467 const I4& i4, const I5& i5, const I6& i6)
const {
1468 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1469 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6))
1470 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6)];
1473 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1474 typename I5, typename I6>
1475 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1476 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6>::value &&
1477 (7 == Rank) && !is_default_map),
1478 reference_type>::type
1479 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1480 const I4& i4, const I5& i5, const I6& i6)
const {
1481 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1482 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6))
1483 return m_map.reference(i0, i1, i2, i3, i4, i5, i6);
1489 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1490 typename I5, typename I6, typename I7>
1491 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1492 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7>::value &&
1493 (8 == Rank) && is_default_map),
1494 reference_type>::type
1495 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1496 const I4& i4, const I5& i5, const I6& i6, const I7& i7)
const {
1497 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1498 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7))
1500 .m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6, i7)];
1503 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1504 typename I5, typename I6, typename I7>
1505 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1506 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7>::value &&
1507 (8 == Rank) && !is_default_map),
1508 reference_type>::type
1509 operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1510 const I4& i4, const I5& i5, const I6& i6, const I7& i7)
const {
1511 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1512 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7))
1513 return m_map.reference(i0, i1, i2, i3, i4, i5, i6, i7);
1517 template <
class... Args>
1518 KOKKOS_FORCEINLINE_FUNCTION
1519 typename std::enable_if<(Kokkos::Impl::are_integral<Args...>::value &&
1521 reference_type>::type
1522 access(Args... KOKKOS_IMPL_SINK(args))
const {
1523 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1524 KOKKOS_IMPL_SINK((m_track, m_map, args...)))
1525 return m_map.reference();
1528 template <typename I0, class... Args>
1529 KOKKOS_FORCEINLINE_FUNCTION
1530 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
1531 (1 == Rank) && !is_default_map),
1532 reference_type>::type
1533 access(const I0& i0, Args... KOKKOS_IMPL_SINK(args))
const {
1534 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1535 KOKKOS_IMPL_SINK((m_track, m_map, i0, args...)))
1536 return m_map.reference(i0);
1539 template <typename I0, class... Args>
1540 KOKKOS_FORCEINLINE_FUNCTION
1541 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
1542 (1 == Rank) && is_default_map &&
1544 reference_type>::type
1545 access(const I0& i0, Args... KOKKOS_IMPL_SINK(args))
const {
1546 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1547 KOKKOS_IMPL_SINK((m_track, m_map, i0, args...)))
1548 return m_map.m_impl_handle[i0];
1551 template <typename I0, class... Args>
1552 KOKKOS_FORCEINLINE_FUNCTION
1553 typename std::enable_if<(Kokkos::Impl::are_integral<I0, Args...>::value &&
1554 (1 == Rank) && is_default_map &&
1556 reference_type>::type
1557 access(const I0& i0, Args... KOKKOS_IMPL_SINK(args))
const {
1558 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1559 KOKKOS_IMPL_SINK((m_track, m_map, i0, args...)))
1560 return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0];
1563 template <typename I0, typename I1, class... Args>
1564 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1565 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1567 reference_type>::type
1568 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1569 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1570 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1571 return m_map.reference(i0, i1);
1574 template <typename I0, typename I1, class... Args>
1575 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1576 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1577 is_default_map && is_layout_left && (traits::rank_dynamic == 0)),
1578 reference_type>::type
1579 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1580 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1581 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1582 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_dim.N0 * i1];
1585 template <typename I0, typename I1, class... Args>
1586 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1587 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1588 is_default_map && is_layout_left && (traits::rank_dynamic != 0)),
1589 reference_type>::type
1590 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1591 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1592 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1593 return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_stride * i1];
1596 template <typename I0, typename I1, class... Args>
1597 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1598 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1599 is_default_map && is_layout_right && (traits::rank_dynamic == 0)),
1600 reference_type>::type
1601 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1602 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1603 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1604 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_dim.N1 * i0];
1607 template <typename I0, typename I1, class... Args>
1608 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1609 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1610 is_default_map && is_layout_right && (traits::rank_dynamic != 0)),
1611 reference_type>::type
1612 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1613 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1614 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1615 return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_stride * i0];
1618 template <typename I0, typename I1, class... Args>
1619 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1620 (Kokkos::Impl::are_integral<I0, I1, Args...>::value && (2 == Rank) &&
1621 is_default_map && is_layout_stride),
1622 reference_type>::type
1623 access(const I0& i0, const I1& i1, Args... KOKKOS_IMPL_SINK(args))
const {
1624 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1625 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, args...)))
1626 return m_map.m_impl_handle[i0 * m_map.m_impl_offset.m_stride.S0 +
1627 i1 * m_map.m_impl_offset.m_stride.S1];
1633 template <typename I0, typename I1, typename I2, class... Args>
1634 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1635 (Kokkos::Impl::are_integral<I0, I1, I2, Args...>::value && (3 == Rank) &&
1637 reference_type>::type
1638 access(const I0& i0, const I1& i1, const I2& i2,
1639 Args... KOKKOS_IMPL_SINK(args))
const {
1640 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1641 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, args...)))
1642 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2)];
1645 template <typename I0, typename I1, typename I2, class... Args>
1646 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1647 (Kokkos::Impl::are_integral<I0, I1, I2, Args...>::value && (3 == Rank) &&
1649 reference_type>::type
1650 access(const I0& i0, const I1& i1, const I2& i2,
1651 Args... KOKKOS_IMPL_SINK(args))
const {
1652 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1653 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, args...)))
1654 return m_map.reference(i0, i1, i2);
1660 template <typename I0, typename I1, typename I2, typename I3, class... Args>
1661 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1662 (Kokkos::Impl::are_integral<I0, I1, I2, I3, Args...>::value &&
1663 (4 == Rank) && is_default_map),
1664 reference_type>::type
1665 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1666 Args... KOKKOS_IMPL_SINK(args))
const {
1667 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1668 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, args...)))
1669 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3)];
1672 template <typename I0, typename I1, typename I2, typename I3, class... Args>
1673 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1674 (Kokkos::Impl::are_integral<I0, I1, I2, I3, Args...>::value &&
1675 (4 == Rank) && !is_default_map),
1676 reference_type>::type
1677 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3,
1678 Args... KOKKOS_IMPL_SINK(args))
const {
1679 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1680 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, args...)))
1681 return m_map.reference(i0, i1, i2, i3);
1687 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1689 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1690 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, Args...>::value &&
1691 (5 == Rank) && is_default_map),
1692 reference_type>::type
1693 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1694 Args... KOKKOS_IMPL_SINK(args))
const {
1695 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1696 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, args...)))
1697 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4)];
1700 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1702 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1703 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, Args...>::value &&
1704 (5 == Rank) && !is_default_map),
1705 reference_type>::type
1706 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1707 Args... KOKKOS_IMPL_SINK(args))
const {
1708 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1709 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, args...)))
1710 return m_map.reference(i0, i1, i2, i3, i4);
1716 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1717 typename I5, class... Args>
1718 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1719 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, Args...>::value &&
1720 (6 == Rank) && is_default_map),
1721 reference_type>::type
1722 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1723 const I5& i5, Args... KOKKOS_IMPL_SINK(args))
const {
1724 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1725 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, i5, args...)))
1726 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5)];
1729 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1730 typename I5, class... Args>
1731 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1732 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, Args...>::value &&
1733 (6 == Rank) && !is_default_map),
1734 reference_type>::type
1735 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1736 const I5& i5, Args... KOKKOS_IMPL_SINK(args))
const {
1737 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1738 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, i5, args...)))
1739 return m_map.reference(i0, i1, i2, i3, i4, i5);
1745 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1746 typename I5, typename I6, class... Args>
1747 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1748 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, Args...>::value &&
1749 (7 == Rank) && is_default_map),
1750 reference_type>::type
1751 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1752 const I5& i5, const I6& i6, Args... KOKKOS_IMPL_SINK(args))
const {
1753 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1754 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...)))
1755 return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6)];
1758 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1759 typename I5, typename I6, class... Args>
1760 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1761 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, Args...>::value &&
1762 (7 == Rank) && !is_default_map),
1763 reference_type>::type
1764 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1765 const I5& i5, const I6& i6, Args... KOKKOS_IMPL_SINK(args))
const {
1766 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(
1767 KOKKOS_IMPL_SINK((m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...)))
1768 return m_map.reference(i0, i1, i2, i3, i4, i5, i6);
1774 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1775 typename I5, typename I6, typename I7, class... Args>
1776 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1777 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7,
1779 (8 == Rank) && is_default_map),
1780 reference_type>::type
1781 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1782 const I5& i5, const I6& i6, const I7& i7,
1783 Args... KOKKOS_IMPL_SINK(args))
const {
1784 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(KOKKOS_IMPL_SINK(
1785 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...)))
1787 .m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6, i7)];
1790 template <typename I0, typename I1, typename I2, typename I3, typename I4,
1791 typename I5, typename I6, typename I7, class... Args>
1792 KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<
1793 (Kokkos::Impl::are_integral<I0, I1, I2, I3, I4, I5, I6, I7,
1795 (8 == Rank) && !is_default_map),
1796 reference_type>::type
1797 access(const I0& i0, const I1& i1, const I2& i2, const I3& i3, const I4& i4,
1798 const I5& i5, const I6& i6, const I7& i7,
1799 Args... KOKKOS_IMPL_SINK(args))
const {
1800 KOKKOS_IMPL_VIEW_OPERATOR_VERIFY(KOKKOS_IMPL_SINK(
1801 (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...)))
1802 return m_map.reference(i0, i1, i2, i3, i4, i5, i6, i7);
1805 #undef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY
1810 KOKKOS_DEFAULTED_FUNCTION
1813 KOKKOS_INLINE_FUNCTION
1814 View() : m_track(), m_map() {}
1816 KOKKOS_INLINE_FUNCTION
1817 View(
const View& rhs)
1818 : m_track(rhs.m_track, traits::is_managed), m_map(rhs.m_map) {}
1820 KOKKOS_INLINE_FUNCTION
1822 : m_track(std::move(rhs.m_track)), m_map(std::move(rhs.m_map)) {}
1824 KOKKOS_INLINE_FUNCTION
1825 View& operator=(
const View& rhs) {
1826 m_track = rhs.m_track;
1831 KOKKOS_INLINE_FUNCTION
1832 View& operator=(View&& rhs) {
1833 m_track = std::move(rhs.m_track);
1834 m_map = std::move(rhs.m_map);
1842 template <
class RT,
class... RP>
1843 KOKKOS_INLINE_FUNCTION View(
1844 const View<RT, RP...>& rhs,
1845 typename std::enable_if<Kokkos::Impl::ViewMapping<
1846 traits,
typename View<RT, RP...>::traits,
1847 typename traits::specialize>::is_assignable_data_type>::type* =
1849 : m_track(rhs.m_track, traits::is_managed), m_map() {
1850 typedef typename View<RT, RP...>::traits SrcTraits;
1851 typedef Kokkos::Impl::ViewMapping<traits, SrcTraits,
1852 typename traits::specialize>
1854 static_assert(Mapping::is_assignable,
1855 "Incompatible View copy construction");
1856 Mapping::assign(m_map, rhs.m_map, rhs.m_track);
1859 template <
class RT,
class... RP>
1860 KOKKOS_INLINE_FUNCTION
typename std::enable_if<
1861 Kokkos::Impl::ViewMapping<
1862 traits,
typename View<RT, RP...>::traits,
1863 typename traits::specialize>::is_assignable_data_type,
1865 operator=(
const View<RT, RP...>& rhs) {
1866 typedef typename View<RT, RP...>::traits SrcTraits;
1867 typedef Kokkos::Impl::ViewMapping<traits, SrcTraits,
1868 typename traits::specialize>
1870 static_assert(Mapping::is_assignable,
"Incompatible View copy assignment");
1871 Mapping::assign(m_map, rhs.m_map, rhs.m_track);
1872 m_track.assign(rhs.m_track, traits::is_managed);
1880 template <
class RT,
class... RP,
class Arg0,
class... Args>
1881 KOKKOS_INLINE_FUNCTION View(
const View<RT, RP...>& src_view,
const Arg0 arg0,
1883 : m_track(src_view.m_track, traits::is_managed), m_map() {
1884 typedef View<RT, RP...> SrcType;
1886 typedef Kokkos::Impl::ViewMapping<
void
1889 typename SrcType::traits, Arg0, Args...>
1892 typedef typename Mapping::type DstType;
1895 Kokkos::Impl::ViewMapping<traits,
typename DstType::traits,
1896 typename traits::specialize>::is_assignable,
1897 "Subview construction requires compatible view and subview arguments");
1899 Mapping::assign(m_map, src_view.m_map, arg0, args...);
1905 KOKKOS_INLINE_FUNCTION
1906 int use_count()
const {
return m_track.use_count(); }
1908 inline const std::string label()
const {
1909 return m_track.template get_label<typename traits::memory_space>();
1915 template <
class... P>
1916 explicit inline View(
1917 const Impl::ViewCtorProp<P...>& arg_prop,
1918 typename std::enable_if<!Impl::ViewCtorProp<P...>::has_pointer,
1919 typename traits::array_layout>::type
const&
1921 : m_track(), m_map() {
1923 typedef Impl::ViewCtorProp<P...> alloc_prop_input;
1927 typedef Impl::ViewCtorProp<
1929 typename std::conditional<alloc_prop_input::has_label,
1930 std::integral_constant<unsigned, 0>,
1931 typename std::string>::type,
1932 typename std::conditional<
1933 alloc_prop_input::has_memory_space,
1934 std::integral_constant<unsigned, 1>,
1935 typename traits::device_type::memory_space>::type,
1936 typename std::conditional<
1937 alloc_prop_input::has_execution_space,
1938 std::integral_constant<unsigned, 2>,
1939 typename traits::device_type::execution_space>::type>
1942 static_assert(traits::is_managed,
1943 "View allocation constructor requires managed memory");
1945 if (alloc_prop::initialize &&
1946 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
1947 !alloc_prop::execution_space::is_initialized()
1949 !alloc_prop::execution_space::impl_is_initialized()
1954 Kokkos::Impl::throw_runtime_exception(
1955 "Constructing View and initializing data with uninitialized "
1960 alloc_prop prop_copy(arg_prop);
1963 #if defined(KOKKOS_ENABLE_CUDA)
1969 if (std::is_same<Kokkos::CudaUVMSpace,
1970 typename traits::device_type::memory_space>::value) {
1971 typename traits::device_type::memory_space::execution_space().fence();
1976 Kokkos::Impl::SharedAllocationRecord<>* record =
1977 m_map.allocate_shared(prop_copy, arg_layout);
1980 #if defined(KOKKOS_ENABLE_CUDA)
1981 if (std::is_same<Kokkos::CudaUVMSpace,
1982 typename traits::device_type::memory_space>::value) {
1983 typename traits::device_type::memory_space::execution_space().fence();
1989 m_track.assign_allocated_record_to_uninitialized(record);
1992 KOKKOS_INLINE_FUNCTION
1993 void assign_data(pointer_type arg_data) {
1995 m_map.assign_data(arg_data);
1999 template <
class... P>
2000 explicit KOKKOS_INLINE_FUNCTION View(
2001 const Impl::ViewCtorProp<P...>& arg_prop,
2002 typename std::enable_if<Impl::ViewCtorProp<P...>::has_pointer,
2003 typename traits::array_layout>::type
const&
2007 m_map(arg_prop, arg_layout) {
2009 std::is_same<pointer_type,
2010 typename Impl::ViewCtorProp<P...>::pointer_type>::value,
2011 "Constructing View to wrap user memory must supply matching pointer "
2016 template <
class... P>
2017 explicit inline View(
2018 const Impl::ViewCtorProp<P...>& arg_prop,
2019 typename std::enable_if<!Impl::ViewCtorProp<P...>::has_pointer,
2020 size_t>::type
const arg_N0 =
2021 KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2022 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2023 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2024 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2025 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2026 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2027 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2028 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2030 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2031 arg_N4, arg_N5, arg_N6, arg_N7)) {
2032 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2033 Impl::runtime_check_rank_host(
2034 traits::rank_dynamic,
2035 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2036 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2038 Impl::runtime_check_rank_device(
2039 traits::rank_dynamic,
2040 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2041 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2046 template <
class... P>
2047 explicit KOKKOS_INLINE_FUNCTION View(
2048 const Impl::ViewCtorProp<P...>& arg_prop,
2049 typename std::enable_if<Impl::ViewCtorProp<P...>::has_pointer,
2050 size_t>::type
const arg_N0 =
2051 KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2052 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2053 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2054 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2055 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2056 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2057 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2058 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2060 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2061 arg_N4, arg_N5, arg_N6, arg_N7)) {
2062 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2063 Impl::runtime_check_rank_host(
2064 traits::rank_dynamic,
2065 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2066 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2068 Impl::runtime_check_rank_device(
2069 traits::rank_dynamic,
2070 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2071 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2077 template <
typename Label>
2078 explicit inline View(
2079 const Label& arg_label,
2080 typename std::enable_if<Kokkos::Impl::is_view_label<Label>::value,
2081 typename traits::array_layout>::type
const&
2083 : View(Impl::ViewCtorProp<std::string>(arg_label), arg_layout) {}
2086 template <
typename Label>
2087 explicit inline View(
2088 const Label& arg_label,
2089 typename std::enable_if<Kokkos::Impl::is_view_label<Label>::value,
2090 const size_t>::type arg_N0 =
2091 KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2092 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2093 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2094 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2095 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2096 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2097 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2098 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2099 : View(Impl::ViewCtorProp<std::string>(arg_label),
2100 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2101 arg_N4, arg_N5, arg_N6, arg_N7)) {
2102 static_assert(traits::array_layout::is_extent_constructible,
2103 "Layout is not extent constructible. A layout object should "
2104 "be passed too.\n");
2106 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2107 Impl::runtime_check_rank_host(
2108 traits::rank_dynamic,
2109 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2110 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2112 Impl::runtime_check_rank_device(
2113 traits::rank_dynamic,
2114 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2115 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2121 explicit inline View(
const ViewAllocateWithoutInitializing& arg_prop,
2122 const typename traits::array_layout& arg_layout)
2123 : View(Impl::ViewCtorProp<std::string,
2124 Kokkos::Impl::WithoutInitializing_t>(
2125 arg_prop.label, Kokkos::WithoutInitializing),
2128 explicit inline View(
const ViewAllocateWithoutInitializing& arg_prop,
2129 const size_t arg_N0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2130 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2131 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2132 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2133 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2134 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2135 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2136 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2137 : View(Impl::ViewCtorProp<std::string,
2138 Kokkos::Impl::WithoutInitializing_t>(
2139 arg_prop.label, Kokkos::WithoutInitializing),
2140 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2141 arg_N4, arg_N5, arg_N6, arg_N7)) {
2142 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2143 Impl::runtime_check_rank_host(
2144 traits::rank_dynamic,
2145 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2146 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2148 Impl::runtime_check_rank_device(
2149 traits::rank_dynamic,
2150 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2151 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2155 template <
class Traits>
2156 KOKKOS_INLINE_FUNCTION View(
2157 const track_type& track,
2158 const Kokkos::Impl::ViewMapping<Traits, typename Traits::specialize>& map)
2159 : m_track(track), m_map() {
2160 typedef Kokkos::Impl::ViewMapping<traits, Traits,
2161 typename traits::specialize>
2163 static_assert(Mapping::is_assignable,
2164 "Incompatible View copy construction");
2165 Mapping::assign(m_map, map, track);
2170 static constexpr
size_t required_allocation_size(
2171 const size_t arg_N0 = 0,
const size_t arg_N1 = 0,
const size_t arg_N2 = 0,
2172 const size_t arg_N3 = 0,
const size_t arg_N4 = 0,
const size_t arg_N5 = 0,
2173 const size_t arg_N6 = 0,
const size_t arg_N7 = 0) {
2174 return map_type::memory_span(
typename traits::array_layout(
2175 arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7));
2178 explicit KOKKOS_INLINE_FUNCTION View(
2179 pointer_type arg_ptr,
const size_t arg_N0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2180 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2181 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2182 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2183 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2184 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2185 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2186 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2187 : View(Impl::ViewCtorProp<pointer_type>(arg_ptr),
2188 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2189 arg_N4, arg_N5, arg_N6, arg_N7)) {
2190 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2191 Impl::runtime_check_rank_host(
2192 traits::rank_dynamic,
2193 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2194 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2196 Impl::runtime_check_rank_device(
2197 traits::rank_dynamic,
2198 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2199 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2204 explicit KOKKOS_INLINE_FUNCTION View(
2205 pointer_type arg_ptr,
const typename traits::array_layout& arg_layout)
2206 : View(Impl::ViewCtorProp<pointer_type>(arg_ptr), arg_layout) {}
2211 static inline size_t shmem_size(
const size_t arg_N0 = KOKKOS_INVALID_INDEX,
2212 const size_t arg_N1 = KOKKOS_INVALID_INDEX,
2213 const size_t arg_N2 = KOKKOS_INVALID_INDEX,
2214 const size_t arg_N3 = KOKKOS_INVALID_INDEX,
2215 const size_t arg_N4 = KOKKOS_INVALID_INDEX,
2216 const size_t arg_N5 = KOKKOS_INVALID_INDEX,
2217 const size_t arg_N6 = KOKKOS_INVALID_INDEX,
2218 const size_t arg_N7 = KOKKOS_INVALID_INDEX) {
2219 if (is_layout_stride) {
2221 "Kokkos::View::shmem_size(extents...) doesn't work with "
2222 "LayoutStride. Pass a LayoutStride object instead");
2224 const size_t num_passed_args = Impl::count_valid_integers(
2225 arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2227 if (std::is_same<typename traits::specialize, void>::value &&
2228 num_passed_args != traits::rank_dynamic) {
2230 "Kokkos::View::shmem_size() rank_dynamic != number of arguments.\n");
2233 return View::shmem_size(
typename traits::array_layout(
2234 arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7));
2237 static inline size_t shmem_size(
2238 typename traits::array_layout
const& arg_layout) {
2239 return map_type::memory_span(arg_layout) +
2240 sizeof(
typename traits::value_type);
2243 explicit KOKKOS_INLINE_FUNCTION View(
2244 const typename traits::execution_space::scratch_memory_space& arg_space,
2245 const typename traits::array_layout& arg_layout)
2246 : View(Impl::ViewCtorProp<pointer_type>(
2247 reinterpret_cast<pointer_type>(arg_space.get_shmem_aligned(
2248 map_type::memory_span(arg_layout),
2249 sizeof(typename traits::value_type)))),
2252 explicit KOKKOS_INLINE_FUNCTION View(
2253 const typename traits::execution_space::scratch_memory_space& arg_space,
2254 const size_t arg_N0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2255 const size_t arg_N1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2256 const size_t arg_N2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2257 const size_t arg_N3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2258 const size_t arg_N4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2259 const size_t arg_N5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2260 const size_t arg_N6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
2261 const size_t arg_N7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
2262 : View(Impl::ViewCtorProp<pointer_type>(
2263 reinterpret_cast<pointer_type>(arg_space.get_shmem_aligned(
2264 map_type::memory_span(typename traits::array_layout(
2265 arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6,
2267 sizeof(typename traits::value_type)))),
2268 typename traits::array_layout(arg_N0, arg_N1, arg_N2, arg_N3,
2269 arg_N4, arg_N5, arg_N6, arg_N7)) {
2270 #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
2271 Impl::runtime_check_rank_host(
2272 traits::rank_dynamic,
2273 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2274 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7, label());
2276 Impl::runtime_check_rank_device(
2277 traits::rank_dynamic,
2278 std::is_same<typename traits::specialize, void>::value, arg_N0, arg_N1,
2279 arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7);
2289 template <
typename D,
class... P>
2297 template <
class V,
class... Args>
2299 typename Kokkos::Impl::ViewMapping<
void
2302 typename V::traits, Args...>::type;
2304 template <
class D,
class... P,
class... Args>
2305 KOKKOS_INLINE_FUNCTION
2306 typename Kokkos::Impl::ViewMapping<
void
2309 ViewTraits<D, P...>, Args...>::type
2310 subview(
const View<D, P...>& src, Args... args) {
2311 static_assert(View<D, P...>::Rank ==
sizeof...(Args),
2312 "subview requires one argument for each source View rank");
2314 return typename Kokkos::Impl::ViewMapping<
2317 ViewTraits<D, P...>, Args...>::type(src, args...);
2320 template <
class MemoryTraits,
class D,
class... P,
class... Args>
2321 KOKKOS_INLINE_FUNCTION
typename Kokkos::Impl::ViewMapping<
2324 ViewTraits<D, P...>, Args...>::template apply<MemoryTraits>::type
2325 subview(
const View<D, P...>& src, Args... args) {
2326 static_assert(View<D, P...>::Rank ==
sizeof...(Args),
2327 "subview requires one argument for each source View rank");
2329 return typename Kokkos::Impl::ViewMapping<
2332 ViewTraits<D, P...>,
2333 Args...>::template apply<MemoryTraits>::type(src, args...);
2343 template <
class LT,
class... LP,
class RT,
class... RP>
2344 KOKKOS_INLINE_FUNCTION
bool operator==(
const View<LT, LP...>& lhs,
2345 const View<RT, RP...>& rhs) {
2347 typedef ViewTraits<LT, LP...> lhs_traits;
2348 typedef ViewTraits<RT, RP...> rhs_traits;
2350 return std::is_same<
typename lhs_traits::const_value_type,
2351 typename rhs_traits::const_value_type>::value &&
2352 std::is_same<
typename lhs_traits::array_layout,
2353 typename rhs_traits::array_layout>::value &&
2354 std::is_same<
typename lhs_traits::memory_space,
2355 typename rhs_traits::memory_space>::value &&
2356 unsigned(lhs_traits::rank) == unsigned(rhs_traits::rank) &&
2357 lhs.data() == rhs.data() && lhs.span() == rhs.span() &&
2358 lhs.extent(0) == rhs.extent(0) && lhs.extent(1) == rhs.extent(1) &&
2359 lhs.extent(2) == rhs.extent(2) && lhs.extent(3) == rhs.extent(3) &&
2360 lhs.extent(4) == rhs.extent(4) && lhs.extent(5) == rhs.extent(5) &&
2361 lhs.extent(6) == rhs.extent(6) && lhs.extent(7) == rhs.extent(7);
2364 template <
class LT,
class... LP,
class RT,
class... RP>
2365 KOKKOS_INLINE_FUNCTION
bool operator!=(
const View<LT, LP...>& lhs,
2366 const View<RT, RP...>& rhs) {
2378 inline void shared_allocation_tracking_disable() {
2379 Kokkos::Impl::SharedAllocationRecord<void, void>::tracking_disable();
2382 inline void shared_allocation_tracking_enable() {
2383 Kokkos::Impl::SharedAllocationRecord<void, void>::tracking_enable();
2395 template <
class Specialize,
typename A,
typename B>
2396 struct CommonViewValueType;
2398 template <
typename A,
typename B>
2399 struct CommonViewValueType<void, A, B> {
2400 using value_type =
typename std::common_type<A, B>::type;
2403 template <
class Specialize,
class ValueType>
2404 struct CommonViewAllocProp;
2406 template <
class ValueType>
2407 struct CommonViewAllocProp<void, ValueType> {
2408 using value_type = ValueType;
2409 using scalar_array_type = ValueType;
2411 template <
class... Views>
2412 KOKKOS_INLINE_FUNCTION CommonViewAllocProp(
const Views&...) {}
2415 template <
class... Views>
2416 struct DeduceCommonViewAllocProp;
2420 template <
class FirstView>
2421 struct DeduceCommonViewAllocProp<FirstView> {
2422 using specialize =
typename FirstView::traits::specialize;
2424 using value_type =
typename FirstView::traits::value_type;
2426 enum :
bool { is_view = is_view<FirstView>::value };
2428 using prop_type = CommonViewAllocProp<specialize, value_type>;
2431 template <
class FirstView,
class... NextViews>
2432 struct DeduceCommonViewAllocProp<FirstView, NextViews...> {
2433 using NextTraits = DeduceCommonViewAllocProp<NextViews...>;
2435 using first_specialize =
typename FirstView::traits::specialize;
2436 using first_value_type =
typename FirstView::traits::value_type;
2438 enum :
bool { first_is_view = is_view<FirstView>::value };
2440 using next_specialize =
typename NextTraits::specialize;
2441 using next_value_type =
typename NextTraits::value_type;
2443 enum :
bool { next_is_view = NextTraits::is_view };
2450 static_assert(!(!std::is_same<first_specialize, next_specialize>::value &&
2451 !std::is_same<first_specialize, void>::value &&
2452 !std::is_same<void, next_specialize>::value),
2453 "Kokkos DeduceCommonViewAllocProp ERROR: Only one non-void "
2454 "specialize trait allowed");
2457 using specialize =
typename std::conditional<
2458 std::is_same<first_specialize, next_specialize>::value, first_specialize,
2459 typename std::conditional<(std::is_same<first_specialize, void>::value &&
2460 !std::is_same<next_specialize, void>::value),
2461 next_specialize, first_specialize>::type>::type;
2463 using value_type =
typename CommonViewValueType<specialize, first_value_type,
2464 next_value_type>::value_type;
2466 enum :
bool { is_view = (first_is_view && next_is_view) };
2468 using prop_type = CommonViewAllocProp<specialize, value_type>;
2473 template <
class... Views>
2474 using DeducedCommonPropsType =
2475 typename Impl::DeduceCommonViewAllocProp<Views...>::prop_type;
2478 template <
class... Views>
2479 KOKKOS_INLINE_FUNCTION DeducedCommonPropsType<Views...> common_view_alloc_prop(
2480 Views
const&... views) {
2481 return DeducedCommonPropsType<Views...>(views...);
2489 using Kokkos::is_view;
2494 #include <impl/Kokkos_ViewUniformType.hpp>
2495 #include <impl/Kokkos_Atomic_View.hpp>
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< std::is_integral< iType >::value, size_t >::type extent(const iType &r) const noexcept
rank() to be implemented
KOKKOS_INLINE_FUNCTION bool operator==(complex< RealType1 > const &x, complex< RealType2 > const &y) noexcept
Binary == operator for complex complex.
View< typename traits::non_const_data_type, typename traits::array_layout, Device< DefaultHostExecutionSpace, typename traits::host_mirror_space::memory_space > > HostMirror
Compatible HostMirror view.
View< typename traits::const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > const_type
Compatible view of const data type.
View to an array of data.
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void, Args >::type...> view_alloc(Args const &...args)
Create View allocation parameter bundle from argument list.
Impl::ViewUniformType< View, 0 >::type uniform_type
Unified types.
View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::host_mirror_space > host_mirror_type
Compatible HostMirror view.
View< typename traits::scalar_array_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > array_type
Compatible view of array of scalar types.
KOKKOS_INLINE_FUNCTION constexpr unsigned rank(const View< D, P...> &V)
Temporary free function rank() until rank() is implemented in the View.
KOKKOS_INLINE_FUNCTION bool operator!=(complex< RealType1 > const &x, complex< RealType2 > const &y) noexcept
Binary != operator for complex complex.
View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > non_const_type
Compatible view of non-const data type.
Traits class for accessing attributes of a View.
Access relationship between DstMemorySpace and SrcMemorySpace.