52 const int StaticDim = 64;
53 const int Stride = 32;
54 const int LocalDim = 2;
57 typedef Kokkos::Experimental::HIP Device;
58 typedef Kokkos::View<FadType*,Layout,Device> ViewType;
60 typedef typename ViewType::traits TraitsType;
61 typedef Kokkos::Impl::ViewMapping< TraitsType , typename TraitsType::specialize > MappingType;
62 const int view_static_dim = MappingType::FadStaticDimension;
63 TEUCHOS_TEST_EQUALITY(view_static_dim, StaticDim, out, success);
65 typedef typename Kokkos::ThreadLocalScalarType<ViewType>::type local_fad_type;
68 TEUCHOS_TEST_EQUALITY(issfd,
true, out, success);
69 TEUCHOS_TEST_EQUALITY(static_dim, LocalDim, out, success);
71 const size_t num_rows = 11;
72 const size_t fad_size = StaticDim;
74 ViewType v(
"v", num_rows, fad_size+1);
75 const size_t span = v.span();
76 TEUCHOS_TEST_EQUALITY(span, num_rows*(StaticDim+1), out, success);
81 const int StaticDim = 50;
82 const int Stride = 32;
83 const int LocalDim = 0;
86 typedef Kokkos::Experimental::HIP Device;
87 typedef Kokkos::View<FadType*,Layout,Device> ViewType;
89 typedef typename ViewType::traits TraitsType;
90 typedef Kokkos::Impl::ViewMapping< TraitsType , typename TraitsType::specialize > MappingType;
91 const int view_static_dim = MappingType::FadStaticDimension;
92 TEUCHOS_TEST_EQUALITY(view_static_dim, StaticDim, out, success);
94 typedef typename Kokkos::ThreadLocalScalarType<ViewType>::type local_fad_type;
97 TEUCHOS_TEST_EQUALITY(issfd,
false, out, success);
98 TEUCHOS_TEST_EQUALITY(static_dim, LocalDim, out, success);
100 const size_t num_rows = 11;
101 const size_t fad_size = StaticDim;
103 ViewType v(
"v", num_rows, fad_size+1);
104 const size_t span = v.span();
105 TEUCHOS_TEST_EQUALITY(span, num_rows*(StaticDim+1), out, success);
108int main(
int argc,
char* argv[] ) {
109 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
112 Kokkos::InitializationSettings init_args;
113 init_args.set_device_id(0);
114 Kokkos::initialize( init_args );
115 Kokkos::print_configuration(std::cout);
117 int res = Teuchos::UnitTestRepository::runUnitTestsFromMain(argc, argv);