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.
Optional
forceSet 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.
undefined
Create your own GPUAdapter, use it to create a GPUDevice instance and set device property if you want to use a specific fallback option.
Optional
powerSet 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.
undefined
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.
Optional
mode?: "default" | "off"Set or get the profiling mode.
'off'
Optional
ondata?: ((data) => void)Set or get a callback function when a profiling data is received. If not set, the profiling data will be printed to console.
Set or get a callback function when a profiling data is received. If not set, the profiling data will be printed to console.
Optional
profilingSet or get the profiling mode.
Use env.webgpu.profiling.mode
instead. If env.webgpu.profiling.mode
is set, this property will be
ignored.
Optional
validateSet or get whether validate input content.
false
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.Generated using TypeDoc
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
GPUAdapter
defined in "@webgpu/types".