38 const Kokkos::View<double[dim_1], execution_space> view_1_static(
"rank-1 view with static extent");
39 const Kokkos::View<double* , execution_space> view_1_dynami(
"rank-1 view with dynamic extent",
dim_1);
51 const Kokkos::View<double[dim_1][dim_2], execution_space> view_2_static(
"rank-2 view with static extents");
52 const Kokkos::View<double** , execution_space> view_2_dynami(
"rank-2 view with dynamic extents",
dim_1,
dim_2);
53 const Kokkos::View<double*[dim_2] , execution_space> view_2_mixed (
"rank-2 view with mixed extents" ,
dim_1);
63 const Kokkos::View<double[dim_1][dim_2][dim_3], execution_space> view_3_static(
"rank-3 view of static extents");
64 const Kokkos::View<double*** , execution_space> view_3_dynami(
"rank-3 view of dynamic extents",
dim_1,
dim_2,
dim_3);
65 const Kokkos::View<double*[dim_2][dim_3] , execution_space> view_3_mixed (
"rank-3 view of mixed extents" ,
dim_1);
77 const Kokkos::View<double[dim_1][dim_2][dim_3][dim_4], execution_space> view_4_static(
"rank-4 view of static extents");
91 Kokkos::parallel_reduce(
92 Kokkos::RangePolicy<execution_space>(0, 1),
93 KOKKOS_LAMBDA(
const int,
bool& result)
95 const auto subview = Kokkos::subview (
view, 0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL);
98 subview.size() == expected_size && subview.rank() == 3 &&
99 slice .size() == expected_size && slice .rank() == 3 &&
100 slice.extent(0) ==
dim_2 &&
101 slice.extent(1) ==
dim_3 &&
102 slice.extent(2) ==
dim_4
105 Kokkos::LAnd<bool>(result)
KOKKOS_FUNCTION constexpr auto slice(ViewType &&view, Indices &&... indices)
Get a subview, given the first indices. The rest is filled with Kokkos::ALL.