You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [WebGPU] Update to latest native headers
* Update mini_webgpu.h with latest version from Dawn
* Document this process
* Remove an argument from wgpuQueueOnSubmittedWorkDone
Fixes #7581
* [WebGPU] Note that wgpu is not yet supported
* [WebGPU] Add https:// to external links in README
* update to commit b5d38fc7dc2a20081312c95e379c4a918df8b7d4
* Update mini_webgpu.h
---------
Co-authored-by: Steven Johnson <[email protected]>
Copy file name to clipboardExpand all lines: README_webgpu.md
+22-4
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ When invoking `emcc` to link Halide-generated objects, include these flags:
36
36
`-s USE_WEBGPU=1 -s ASYNCIFY`.
37
37
38
38
Tests that use AOT compilation can be run using a native WebGPU implementation
39
-
that has Node.js bindings, such as [Dawn](dawn.googlesource.com/dawn/).
39
+
that has Node.js bindings, such as [Dawn](https://dawn.googlesource.com/dawn/).
40
40
You must set an environment variable named `HL_WEBGPU_NODE_BINDINGS` that
41
41
has an absolute path to the bindings to run these tests, e.g. `HL_WEBGPU_NODE_BINDINGS=/path/to/dawn.node`.
42
42
@@ -47,13 +47,18 @@ JIT compilation is not supported when using WebGPU with WASM.
47
47
48
48
## Running natively: `HL_TARGET=host-webgpu`
49
49
50
-
> _Tested with top-of-tree Dawn as of 2023-03-14._
50
+
> _Tested with top-of-tree Dawn as of 2023-11-27 [commit b5d38fc7dc2a20081312c95e379c4a918df8b7d4]._
51
51
52
52
For testing purposes, Halide can also target native WebGPU libraries, such as
53
-
[Dawn](dawn.googlesource.com/dawn/) or [wgpu](github.com/gfx-rs/wgpu).
53
+
[Dawn](https://dawn.googlesource.com/dawn/) or
54
+
[wgpu](https://github.com/gfx-rs/wgpu).
54
55
This is currently the only path that can run the JIT correctness tests.
55
56
See [below](#setting-up-dawn) for instructions on building Dawn.
56
57
58
+
> Note that as of 2023-11-27, wgpu is not supported due to
59
+
> [lacking `override` support for WGSL](https://github.com/gfx-rs/wgpu/issues/1762)
60
+
> which we require > in order to set GPU block sizes.
61
+
57
62
When targeting WebGPU with a native target, Halide defaults to looking for a
58
63
build of Dawn (with several common names and suffixes); you can override this
59
64
by setting the `HL_WEBGPU_NATIVE_LIB` environment variable to the absolute path
@@ -71,7 +76,7 @@ will be selected based on the Halide target specified.
71
76
72
77
Building Dawn's Node.js bindings currently requires using CMake.
73
78
74
-
First, [install `depot_tools`](commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up) and add it to the
79
+
First, [install `depot_tools`](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up) and add it to the
75
80
`PATH` environment variable.
76
81
77
82
Next, get Dawn and its dependencies:
@@ -108,3 +113,16 @@ This will produce the following artifacts:
108
113
109
114
These paths can then be used for the `HL_WEBGPU_NODE_BINDINGS` and
110
115
`HL_WEBGPU_NATIVE_LIB` environment variables when using Halide.
116
+
117
+
## Updating mini_webgpu.h
118
+
119
+
The recommended method for updating `mini_webgpu.h` is to copy the
120
+
`gen/include/dawn/webgpu.h` file from the Dawn build directory, then:
121
+
- Restore the `// clang-format {off,on}` lines.
122
+
- Comment out the `#include <std*>` lines.
123
+
- Remove the `void` parameter from the `WGPUProc` declaration.
124
+
125
+
This guarantees a version of the WebGPU header that is compatible with Dawn.
126
+
When the native API eventually stabilizes, it should be possible to obtain a
127
+
header from the `webgpu-native` GitHub organization that will be compatible
0 commit comments