-
Notifications
You must be signed in to change notification settings - Fork 327
Naming convention for sync and async APIs #3594
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
Comments
It sounds like this only applies to entry points which have both an async and sync version. Most of our entry points only have one version; only pipeline creation has two versions, and it is already named using the x/xAsync convention. (Aside: we did previously discuss the slight possibility for confusion, because none of our entry points are actually synchronous, regardless of whether they return a Promise. In particular, the existence of xAsync implies that x is sync, but even non-"Async" pipeline creation is still asynchronous relative to the calling thread.) |
It came up in the meeting that, if we added a sync version of map, then we'd have |
Thanks for the discussion, and I'm fine to keep them as they are. Close the issue. |
GPU Web meeting 2022-11-16 non-APAC-timed
|
WebNN WG initiated a discussion with W3C TAG about naming convention for sync and async APIs (w3ctag/design-reviews#771). Some proposal from TAG is "if the main usage is sync, then x() and xAsync() seems preferable. If the main usage is async, then x() and xSync() seems preferable." (w3ctag/design-principles#402).
Most of WebGPU APIs are sync, but we still have some async APIs as below. Some of async APIs are suffixed with "Async", while most of them are not.
GPU.requestAdapter()
GPUAdapter.requestDevice()
GPUAdapter.requestAdapterInfo()
GPUDevice.createComputePipelineAsync()
GPUDevice.createRenderPipelineAsync()
GPUBuffer.mapAsync()
GPUShaderModule.compilationInfo()
GPUQueue.onSubmittedWorkDone()
GPUDevice.lost
GPUDevice.popErrorScope()
o we need to be consistent here, to put a suffix "Async" to all async APIs?
The text was updated successfully, but these errors were encountered: