kokkos(ext): support when_all#262
Merged
Merged
Conversation
Collaborator
68708e5 to
80aa4e0
Compare
44501a8 to
e468c4d
Compare
when_all
e468c4d to
d0d8209
Compare
d0d8209 to
c6ba8a7
Compare
Signed-off-by: romintomasetti <romin.tomasetti@gmail.com>
c6ba8a7 to
0b7e2cb
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem is that
Kokkosdispatches asynchronous work.But while e.g.
exec::static_thread_poolwill simply callset_value_t(next_receiver)from the thread that performed the work, such that thenext_receiveronly starts its work once the current receiver has finished, it cannot be done like that withKokkosdispatch.My first approach was to customize
schedule_fromto properly synchronize when needed. But it seems it will not be called e.g. from within awhen_all:So I tried to get some inspiration from https://github.com/NVIDIA/stdexec/blob/485160802ee5ca42ca4915e3a2330579efae4ea3/include/nvexec/stream/common.cuh#L621-L629, that seems to do a continuation under some circumstances. Not sure it is the best way though.