It is no longer recommended to use this property. The latest WebGPU spec adds GPUDevice.adapterInfo
(https://www.w3.org/TR/webgpu/#dom-gpudevice-adapterinfo), which allows to get the adapter information from the
device. When it's available, there is no need to set/get the adapter property.
OptionalforceSet or get the force fallback adapter flag.
Setting this property only has effect before the first WebGPU inference session is created. The value will be
used as options for navigator.gpu.requestAdapter().
See https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions for more details.
Create your own GPUAdapter, use it to create a GPUDevice instance and set device property if you want to use a specific fallback option.
OptionalpowerSet or get the power preference.
Setting this property only has effect before the first WebGPU inference session is created. The value will be
used as options for navigator.gpu.requestAdapter().
See https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions for more details.
Create your own GPUAdapter, use it to create a GPUDevice instance and set device property if you want to use a specific power preference.
Set or get the profiling configuration.
Optionalmode?: "default" | "off"Set or get the profiling mode.
Optionalondata?: (data: WebGpuProfilingDataV1) => voidSet or get a callback function when a profiling data is received. If not set, the profiling data will be printed to console.
OptionalprofilingSet or get the profiling mode.
OptionalvalidateSet or get whether validate input content.
Set or get the GPU device for WebGPU.
There are 3 valid scenarios of accessing this property:
GPUDevice object, an error will be thrown.Promise that resolves to a GPUDevice object.Promise to the
GPUDevice object used by the WebGPU backend.
Set or get the adapter for WebGPU.
Setting this property only has effect before the first WebGPU inference session is created. The value will be used as the GPU adapter for the underlying WebGPU backend to create GPU device.
If this property is not set, it will be available to get after the first WebGPU inference session is created. The value will be the GPU adapter that created by the underlying WebGPU backend.
When use with TypeScript, the type of this property is
GPUAdapterdefined in "@webgpu/types".