Skip to content

Commit

Permalink
wip before meeting
Browse files Browse the repository at this point in the history
  • Loading branch information
romintomasetti committed Aug 29, 2024
1 parent e9d776c commit ad9700f
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 107 deletions.
12 changes: 12 additions & 0 deletions docs/source/API/core/Graph.axpby.kokkos.graph.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
auto graph = Kokkos::Experimental::create_graph(exec_A, [&](auto root){
auto node_xpy = root.then_parallel_for(N, MyAxpby{x, y, alpha, beta});
auto node_zpy = root.then_parallel_for(N, MyAxpby{z, y, gamma, beta});

auto node_dotp = Kokkos::Experimental::when_all(node_xpy, node_zpy).then_parallel_reduce(
N, MyDotp{x, z}, dotp
)
});

graph.submit(exec_A);

exec_A.fence();
15 changes: 15 additions & 0 deletions docs/source/API/core/Graph.axpby.kokkos.graph.p2300.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
auto graph = Kokkos::construct_graph();

auto node_xpy = Kokkos::then(graph, Kokkos::parallel_for(N, MyAxpby{x, y, alpha, beta}));
auto node_zpy = Kokkos::then(graph, Kokkos::parallel_for(N, MyAxpby{z, y, gamma, beta}));

auto node_dotp = Kokkos::then(
Kokkos::when_all(node_xpy, node_zpy),
Kokkos::parallel_reduce(N, MyDotp{x, z}, dotp)
);

graph.instantiate();

graph.submit(exec_A);

exec_A.fence();
8 changes: 8 additions & 0 deletions docs/source/API/core/Graph.axpby.kokkos.vanilla.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Kokkos::parallel_for(policy_t(exec_A, 0, N), MyAxpby{x, y, alpha, beta});
Kokkos::parallel_for(policy_t(exec_B, 0, N), MyAxpby{z, y, gamma, beta});

exec_B.fence();

Kokkos::parallel_reduce(policy_t(exec_A, 0, N), MyDotp{x, z}, dotp);

exec_A.fence();
Loading

0 comments on commit ad9700f

Please sign in to comment.