Skip to content

Amortize cost of Stream::add_callback? #66

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

Open
thedodd opened this issue Apr 6, 2022 · 0 comments
Open

Amortize cost of Stream::add_callback? #66

thedodd opened this issue Apr 6, 2022 · 0 comments

Comments

@thedodd
Copy link
Contributor

thedodd commented Apr 6, 2022

In order to coordinate multiple streams effectively, while also trying to maximize parallel usage of the device, I have a scheduler which will add a callback to a stream so that other work, which was mutually exclusive with it, could be immediately scheduled.

This is fine, and working as needed; however, I'm wondering if the maintainers here have any ideas around a way to amortize the cost of having to box the callback each time (this happens a lot ... always ... and never stops until the system halts).

We are already in unsafe territory with most usage of the GPU anyway, so perhaps we could just pass along a pointer to an equivalent callable. That way the caller could take on the burden of ensuring the memory is not freed too early. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant