11int main(
int argc,
char** argv) {
12 Kokkos::initialize(argc, argv);
14 const int N = (argc > 1) ? std::atoi(argv[1]) : 128;
15 const int K = (argc > 2) ? std::atoi(argv[2]) : 200;
18 const std::size_t n = (std::size_t)e.x * e.y * e.z;
20 Kokkos::deep_copy(phi, 1.0);
21 Kokkos::deep_copy(d, 0.5);
24 for (
int i = 0; i < 10; ++i)
29 for (
int rep = 0; rep < 5; ++rep) {
31 for (
int i = 0; i < K; ++i)
34 double ms = t.seconds() * 1e3;
38 const double ns_per_sweep = best * 1e6 / K;
39 const double cells = (double)
N *
N *
N;
40 const double ns_per_cell = ns_per_sweep / cells;
42 cells * 64.0 / (ns_per_sweep);
43 std::printf(
"KOKKOS N=%d sweeps=%d : %.3f ns/sweep, %.4f ns/cell, %.1f GB/s (exec %s)\n",
N, K,
44 ns_per_sweep, ns_per_cell, gbps, Kokkos::DefaultExecutionSpace::name());