-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider a variant of make_async_future which also receives a state #297
Comments
make_async_future
which also provides state
Following from the above, there would be two different non- Owning version:
Viewing version(s):
Some foundational work needs to happen in
|
For the owning version, it might be a better idea for |
On second thought, that last idea is wrong -- the pointer coming in should be typed because after the event is complete, a |
Even though the state has already been allocated, it might be more straightforward for
It's possible to adapt an |
CUDA tasks created via external sources often have state that come along with them. It would be nice to turn such tasks into
cuda::async_future<T>
s instead ofcuda::async_future<void>
.There are at least two use cases:
async_future<T>
with state, and hand over ownership of theT
to theasync_future<T>
. TheT
gets destroyed and its memory deallocated with the future.async_future<T>
with state, and retain ownership of theT
. TheT
is not destroyed with the future.Perhaps the right way to model use case 2. is with
async_future<T&>
? The asynchronous state carried around by the future would be a pointer toT
, rather than aT
itself. There might even be a way to avoid dynamic allocations entirely in this case.The text was updated successfully, but these errors were encountered: