summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/run/unstable_webgpu.js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-12-09 01:19:16 +0100
committerGitHub <noreply@github.com>2023-12-09 01:19:16 +0100
commit393abed3873d83019feb5bcebb10a6929133862a (patch)
treec346e6d628e6b037fb8f881a70ca2ae6f70692b6 /cli/tests/testdata/run/unstable_webgpu.js
parent123d9ea047a2e10803e260ebf00f31fcc98463ee (diff)
feat: bring back WebGPU (#20812)
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com> Co-authored-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/testdata/run/unstable_webgpu.js')
-rw-r--r--cli/tests/testdata/run/unstable_webgpu.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/testdata/run/unstable_webgpu.js b/cli/tests/testdata/run/unstable_webgpu.js
new file mode 100644
index 000000000..a796b1c4d
--- /dev/null
+++ b/cli/tests/testdata/run/unstable_webgpu.js
@@ -0,0 +1,10 @@
+const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main";
+
+console.log(scope, globalThis.GPU);
+
+if (scope === "worker") {
+ postMessage("done");
+} else {
+ const worker = new Worker(`${import.meta.url}#worker`, { type: "module" });
+ worker.onmessage = () => Deno.exit(0);
+}