-
Notifications
You must be signed in to change notification settings - Fork 429
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
Add option to flush queue instead of waiting for completion. #1864
Conversation
/// Submit the current queued tasks to the server. | ||
fn submit(&self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have a submit function here or pass an option to the sync
method? I'm unsure which one is the most intuitive. It's a bit weird to have an exposed submit
function along execute
and sync
.
fn sync(&self, options: SyncOptions);
#[derive(Clone, Copy)]
enum SyncOptions {
/// Sync the execution queue.
Queue,
//// Sync the execution queue and wait for all tasks to be completed.
Full,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah alright! Yeah that might be more consistent.
It does slightly complicate things as for better or worse it kind of forces this to be exposed on the backend trait.
It's also not quite clear where to keep something like SyncOptions as it's used in a bunch of crates that can't really depend on each other.
Lastly, changed the names a bit ("type" instead of options as there might be other options - flush&wait vs queue&full - the former being the more common terminlogy in the graphics world anyway).
Lmk how this looks!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1864 +/- ##
==========================================
- Coverage 86.24% 86.10% -0.14%
==========================================
Files 774 776 +2
Lines 90159 90410 +251
==========================================
+ Hits 77759 77851 +92
- Misses 12400 12559 +159 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 👏
Checklist
run-checks all
script has been executed.Related Issues/PRs
This adds the last bit of infrastructure needed for custom burn<->wgpu interop, after initializing from an existing wgpu server (#1788), and getting WGPU resources (#1861).
Changes
After this PR, the setup for custom interop roughly looks like:
This does require a seperate encoder for your custom wgpu code. I think that's ok - a custom wgpu app might have it's own already anyway - but in the future we could expose some notion of the servers encoder to share resources.