The idea is that this then node mimics the then in P2300.
In essence, you pass a functor to the then and it's guaranteed to be executed at each graph submission, in the graph topology ordering.
[implementation suggestion omitted]
Things to be noted from the above code snippet:
The functor passed to the then must be callable without any argument, marked with KOKKOS_FUNCTION.
The then is nothing else then a kernel launch, done through one of Kokkos drivers.
It adds exactly one node in the Kokkos graph and one node in the backend graph.
:warning: For now, I've implemented it as a parallel-for from 0 to 1, but I think we can do better than that (in the future).
Related
extracted from #7552
The repository is checked out at /workspace/repo. Work only on production
source code. Do not modify tests, CMake registration, CI configuration, or the
grading environment. Network access is unavailable and git history contains
only the base revision, so do not spend time looking for upstream commits or
pull requests. Diagnose from the local source, make a production-code change,
and use the smallest relevant target in the existing build tree for local
verification.