StridedMemoryView
should expose access to the producer stream if possible
#259
Labels
cuda.core
Everything related to the cuda.core module
enhancement
Any code-related improvements
triage
Needs the team's attention
In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream after the consumer one, when the work is done. (Ex: a ping pong exchange between producer/consumer in a tight loop.)
Right now,
StridedMemoryView
follows both DLPack and CAI and does the hand-shake (stream ordering) only once. But a second ordering can be done if the producer stream is exposed. In general, this is not considered safe (because the producer may not guarantee the stream pointer is always valid during the lifetime of aStridedMemoryView
instance). However, we do have one situation that guarantees the pointer lifetime, which is whenStridedMemoryView
instances are created inside a@args_viewable_as_strided_memory
context (WIP in #247). In this case, before the decorated function returns the producer stream is considered always valid, and by exposing it we allow users to perform such ordering before this function returns, e.g.The text was updated successfully, but these errors were encountered: