Sitelet https://github.com/gpuweb/gpuweb/issues/3594
Skip to content

Naming convention for sync and async APIs #3594

Description

@gyagp

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions