1#include <Kokkos_Core.hpp>
6int main(
int argc,
char* argv[]) {
7 Kokkos::initialize(argc, argv);
9 printf(
"LayoutRight\n");
17 using Kokkos::TeamPolicy;
18 using Kokkos::parallel_for;
20 typedef TeamPolicy<Kokkos::OpenMP>::member_type member_type;
24 TeamPolicy<Kokkos::OpenMP> policy (sz*sz, team_sz);
30 parallel_for (policy, KOKKOS_LAMBDA (member_type team_member) {
32 int k = team_member.league_rank () * team_member.team_size () +
33 team_member.team_rank ();
35 team_member.team_barrier();
36 team_member.team_barrier();
37 team_member.team_barrier();
38 team_member.team_barrier();
39 team_member.team_barrier();
40 team_member.team_barrier();
42 team_member.team_barrier();
43 team_member.team_barrier();
44 team_member.team_barrier();
45 team_member.team_barrier();
46 team_member.team_barrier();
47 team_member.team_barrier();
49 team_member.team_barrier();
50 team_member.team_barrier();
51 team_member.team_barrier();
52 team_member.team_barrier();
53 team_member.team_barrier();
54 team_member.team_barrier();
56 team_member.team_barrier();
57 team_member.team_barrier();
58 team_member.team_barrier();
59 team_member.team_barrier();
60 team_member.team_barrier();
61 team_member.team_barrier();
67 double time =
timer.seconds();
68 std::cout <<
"TIME: " << time / (sz*sz*team_sz*24) * 1e9 <<
" ns" << std::endl;
73 printf(
"LayoutLeft\n");
Class for cpu time benchmarking.