-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core(graph): adding documentation for
Kokkos::Experimental::Graph
- Loading branch information
1 parent
b30fe1a
commit ff3854e
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Graph and related | ||
================= | ||
|
||
Usage | ||
----- | ||
|
||
:code:`Kokkos::Graph` is an abstraction that can be used to define a group of asynchronous workloads that are organised as a direct acyclic graph. | ||
|
||
:code:`Kokkos::Graph` is a powerful way of describing workload dependencies. | ||
|
||
For small workloads that need to be sumitted several times, it might save you some overhead [reference to some presentation / paper]. | ||
|
||
:code:`Kokkos::Graph` is specialized for some backends: | ||
|
||
* :code:`Cuda`: [ref to vendor doc] | ||
* :code:`HIP`: [ref to vendor doc] | ||
* :code:`SYCL`: [ref to vendor doc] | ||
|
||
For other backends, Kokkos provides a defaulted implementation [ref to file]. | ||
|
||
Basic example | ||
------------- | ||
|
||
This example showcases how three workloads can be organised as a :code:`Kokkos::Graph`. | ||
|
||
Workloads A and B are independent, but workload C needs the completion of A and B. | ||
|
||
.. code-block:: cpp | ||
int main() | ||
{ | ||
auto graph = Kokkos::Experimental::create_graph<Exec>([&](auto root) { | ||
const auto node_A = root.then_parallel_for(...label..., ...policy..., ...body...); | ||
const auto node_B = root.then_parallel_for(...label..., ...policy..., ...body...); | ||
const auto ready = Kokkos::Experimental::when_all(node_A, node_B); | ||
const auto node_C = ready.then_parallel_for(...label..., ...policy..., ...body...); | ||
}); | ||
for(int irep = 0; irep < nrep; ++irep) | ||
graph.submit(); | ||
} | ||
Advanced example | ||
---------------- | ||
|
||
To be done soon. |