41 using Kokkos::DynRankView;
46 using Kokkos::Experimental::view_alloc;
47 using Kokkos::Experimental::WithoutInitializing;
48 const unsigned derivative_dim_plus_one = 7;
52 DynRankView<FadType>
a(
"a",10,4,13,derivative_dim_plus_one);
64 using d_type = Kokkos::DynRankView<FadType,Kokkos::LayoutRight>;
65 d_type d = createDynRankViewWithType<d_type>(
a,
"d",5,3,8);
72 View<FadType*>
a(
"a",8,derivative_dim_plus_one);
83 using d_type = Kokkos::DynRankView<FadType,Kokkos::LayoutRight>;
84 d_type d = createDynRankViewWithType<d_type>(
a,
"d",5,3,8);
91 View<FadType*>
a(
"a",8,derivative_dim_plus_one);
94 using b_type = Kokkos::View<FadType***>;
95 b_type b = createViewWithType<b_type>(
a,
"b",5,3,8);
98 b_type
c = createViewWithType<b_type>(
a,view_alloc(
"c",WithoutInitializing),5,3,8);
101 using d_type = Kokkos::View<FadType***,Kokkos::LayoutRight>;
102 d_type d = createViewWithType<d_type>(
a,
"d",5,3,8);
108 DynRankView<FadType>
a(
"a",10,4,13,derivative_dim_plus_one);
112 using b_type = Kokkos::View<FadType***>;
113 b_type b = createViewWithType<b_type>(
a,
"b",5,3,8);
116 b_type
c = createViewWithType<b_type>(
a,view_alloc(
"c",WithoutInitializing),5,3,8);
119 using d_type = Kokkos::View<FadType***,Kokkos::LayoutRight>;
120 d_type d = createViewWithType<d_type>(
a,
"d",5,3,8);
126 DynRankView<double>
a(
"a",10,4,13);
130 using b_type = Kokkos::DynRankView<FadType,Kokkos::LayoutRight>;
131 b_type b = createDynRankViewWithType<b_type>(
a,
"b",5,3,8);
138 DynRankView<double>
a(
"a",10,4,13);
149 DynRankView<double>
a(
"a",10,4,13);
160 DynRankView<FadType>
a(
"a",10,4,13,derivative_dim_plus_one);
171 Kokkos::View<double*>
a(
"a",5*3);
172 using b_type = Kokkos::View<double**,Kokkos::MemoryUnmanaged>;
173 b_type b = createViewWithType<b_type>(
a,
a.data(),5,3);
181 Kokkos::View<FadType*>
a(
"a",5*3,derivative_dim_plus_one);
182 using b_type = Kokkos::View<FadType**,Kokkos::MemoryUnmanaged>;
183 b_type b = createViewWithType<b_type>(
a,
a.data(),5,3);
191 Kokkos::DynRankView<double>
a(
"a",10,13);
192 auto b = Kokkos::subview(
a, std::make_pair(4,8), std::make_pair(5,11));
194 using b_type = decltype(b);
195 using c_type = decltype(
c);
196 using b_layout =
typename b_type::array_layout;
197 using c_layout =
typename c_type::array_layout;
198 using default_layout =
typename b_type::device_type::execution_space::array_layout;
199 const bool is_b_layout_stride =
200 std::is_same<b_layout,Kokkos::LayoutStride>::value;
201 const bool is_c_default_layout =
202 std::is_same<c_layout,default_layout>::value;
213 Kokkos::DynRankView<FadType>
a(
"a",10,13,derivative_dim_plus_one);
214 auto b = Kokkos::subview(
a, std::make_pair(4,8), std::make_pair(5,11));
216 using b_type = decltype(b);
217 using c_type = decltype(
c);
218 using b_layout =
typename b_type::array_layout;
219 using c_layout =
typename c_type::array_layout;
220 using default_layout =
typename b_type::device_type::execution_space::array_layout;
221 const bool is_b_layout_stride =
222 std::is_same<b_layout,Kokkos::LayoutStride>::value;
223 const bool is_c_default_layout =
224 std::is_same<c_layout,default_layout>::value;
235 int main(
int argc,
char* argv[] ) {
238 Kokkos::initialize();
std::enable_if< is_view< InputViewType >::value||is_dyn_rank_view< InputViewType >::value, ResultViewType >::type createDynRankViewWithType(const InputViewType &a, const CtorProp &prop, const Dims... dims)
Wrapper to simplify use of Sacado ViewFactory.
std::enable_if< is_view< InputViewType >::value||is_dyn_rank_view< InputViewType >::value, typename Impl::ResultDynRankView< InputViewType >::type >::type createDynRankView(const InputViewType &a, const CtorProp &prop, const Dims... dims)
Wrapper to simplify use of Sacado ViewFactory.
static int runUnitTestsFromMain(int argc, char *argv[])
expr expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c *expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 c
int main(int argc, char *argv[])
std::enable_if< is_view< InputViewType >::value||is_dyn_rank_view< InputViewType >::value, ResultViewType >::type createViewWithType(const InputViewType &a, const CtorProp &prop, const Dims... dims)
Wrapper to simplify use of Sacado ViewFactory.
TEUCHOS_UNIT_TEST(view_factory, dyn_rank_views)
TEST_EQUALITY(rcp_dynamic_cast< const EnhancedNumberValidator< double > >(castedDep1->getValuesAndValidators().find("val1") ->second, true) ->getMax(), double1Vali->getMax())
unsigned dimension_scalar(const View &v, const ViewPack &... views)