summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/conformance_tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/webnn/conformance_tests
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webnn/conformance_tests')
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/buffer.https.any.js17
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js61
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/constant.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/elementwise_binary.https.any.js6
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/elementwise_logical.https.any.js27
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/elementwise_unary.https.any.js12
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js6
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/arg_min_max.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/batch_normalization.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/buffer.https.any.js16
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/cast.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/clamp.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/concat.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/constant.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/conv2d.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/conv_transpose2d.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_binary.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_logical.https.any.js20
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_unary.https.any.js13
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/elu.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/expand.https.any.js11
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/gather.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/gemm.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/hard_sigmoid.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/hard_swish.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/instance_normalization.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/layer_normalization.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/leaky_relu.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/linear.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/matmul.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/pad.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/pooling.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/prelu.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/reduction.https.any.js24
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/relu.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/resample2d.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/reshape.https.any.js11
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/sigmoid.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/slice.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/softmax.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/softplus.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/softsign.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/split.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/tanh.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/transpose.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/triangular.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/gpu/where.https.any.js10
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js19
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js5
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/reduction.https.any.js31
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js5
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/split.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js4
-rw-r--r--testing/web-platform/tests/webnn/conformance_tests/where.https.any.js4
82 files changed, 242 insertions, 510 deletions
diff --git a/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js
index 123c8b1048..0f9e590fc8 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API argMin/Max operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-argminmax
-testWebNNOperation(['argMin', 'argMax'], buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests(['argMin', 'argMax'], buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js
index 9a1c85db19..d3107820db 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API batchNormalization operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-batchnorm
-testWebNNOperation('batchNormalization', buildBatchNorm); \ No newline at end of file
+runWebNNConformanceTests('batchNormalization', buildBatchNorm);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/buffer.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/buffer.https.any.js
index 9391be8dbf..5a09b05c7d 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/buffer.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/buffer.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API buffer operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,10 +9,11 @@
// https://webmachinelearning.github.io/webnn/#api-mlbuffer
-testCreateWebNNBuffer("create", 4);
-
-testDestroyWebNNBuffer('destroyTwice');
-
-testReadWebNNBuffer('read');
-
-testWriteWebNNBuffer('write');
+if (navigator.ml) {
+ testCreateWebNNBuffer('create', 4);
+ testDestroyWebNNBuffer('destroyTwice');
+ testReadWebNNBuffer('read');
+ testWriteWebNNBuffer('write');
+} else {
+ test(() => assert_implements(navigator.ml, 'missing navigator.ml'));
+}
diff --git a/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js
index bde2b9a4ce..086428dd96 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API cast operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-cast
-testWebNNOperation('cast', buildCast); \ No newline at end of file
+runWebNNConformanceTests('cast', buildCast);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js
index 7b60c41f2c..ab47ac9c5c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API clamp operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-clamp
-testWebNNOperation('clamp', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('clamp', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js
new file mode 100644
index 0000000000..62ce16c93e
--- /dev/null
+++ b/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js
@@ -0,0 +1,61 @@
+// META: title=test WebNN MLContext.compute() for ArrayBufferView created from bigger ArrayBuffer
+// META: global=window,dedicatedworker
+// META: variant=?gpu
+// META: script=../resources/utils.js
+
+'use strict';
+
+// These tests are used to reproduce the Chromium issue:
+// https://issues.chromium.org/issues/332151809
+
+if (navigator.ml) {
+ const variant = location.search.substring(1);
+ const contextOptions = kContextOptionsForVariant[variant];
+
+ let context;
+ let builder;
+
+ promise_setup(async () => {
+ let supported = false;
+ try {
+ context = await navigator.ml.createContext(contextOptions);
+ supported = true;
+ } catch (e) {
+ }
+ assert_implements(
+ supported, `Unable to create context for ${variant} variant`);
+ builder = new MLGraphBuilder(context);
+ });
+
+ promise_test(async t => {
+ const a = builder.input('a', {dataType: 'float32', dimensions: [2]});
+ const b = builder.relu(a);
+ const graph = await builder.build({b});
+ const arraybuffer = new ArrayBuffer(100);
+ const aBuffer =
+ new Float32Array(arraybuffer, /*byteOffset*/ 4, /*length*/ 2)
+ aBuffer.set([1, -1]);
+ const bBuffer = new Float32Array(2);
+ const results =
+ await context.compute(graph, {'a': aBuffer}, {'b': bBuffer});
+ assert_array_approx_equals_ulp(
+ results.outputs.b, [1, 0], /*nulp*/ 0, 'float32');
+ }, 'Test compute() working for input ArrayBufferView created from bigger ArrayBuffer');
+
+ promise_test(async t => {
+ const a = builder.input('a', {dataType: 'float32', dimensions: [2]});
+ const b = builder.relu(a);
+ const graph = await builder.build({b});
+ const aBuffer = new Float32Array(2);
+ aBuffer.set([1, -1]);
+ const arraybuffer = new ArrayBuffer(100);
+ const bBuffer =
+ new Float32Array(arraybuffer, /*byteOffset*/ 8, /*length*/ 2);
+ const results =
+ await context.compute(graph, {'a': aBuffer}, {'b': bBuffer});
+ assert_array_approx_equals_ulp(
+ results.outputs.b, [1, 0], /*nulp*/ 0, 'float32');
+ }, 'Test compute() working for output ArrayBufferView created from bigger ArrayBuffer');
+} else {
+ test(() => assert_implements(navigator.ml, 'missing navigator.ml'));
+}
diff --git a/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js
index 254e0b657b..619f20fe1c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API concat operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-concat
-testWebNNOperation('concat', buildConcat); \ No newline at end of file
+runWebNNConformanceTests('concat', buildConcat);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/constant.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/constant.https.any.js
index 4814734886..79362947f1 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/constant.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/constant.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API constant
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-constant-range
-testWebNNOperation('constant', buildConstantRange); \ No newline at end of file
+runWebNNConformanceTests('constant', buildConstantRange);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js
index 0d9a621356..34af583162 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API conv2d operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-conv2d
-testWebNNOperation('conv2d', buildConv2d); \ No newline at end of file
+runWebNNConformanceTests('conv2d', buildConv2d);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js
index ee5d28c72a..2943e67851 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API convTranspose2d operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-convtranspose2d
-testWebNNOperation('convTranspose2d', buildConvTranspose2d); \ No newline at end of file
+runWebNNConformanceTests('convTranspose2d', buildConvTranspose2d);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/elementwise_binary.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/elementwise_binary.https.any.js
index 5db14a43a1..a85a06e1d2 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/elementwise_binary.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/elementwise_binary.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API element-wise binary operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,6 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-binary
-testWebNNOperation(['add', 'sub', 'mul', 'div', 'max', 'min', 'pow'], buildOperationWithTwoInputs); \ No newline at end of file
+runWebNNConformanceTests(
+ ['add', 'sub', 'mul', 'div', 'max', 'min', 'pow'],
+ buildOperationWithTwoInputs);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/elementwise_logical.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/elementwise_logical.https.any.js
index a60c199447..3d3a825f9c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/elementwise_logical.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/elementwise_logical.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API element-wise logical operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,14 +9,17 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-logical
-testWebNNOperation(
- [
- 'equal',
- 'greater',
- 'greaterOrEqual',
- 'lesser',
- 'lesserOrEqual',
- ],
- buildOperationWithTwoInputs
-);
-testWebNNOperation('logicalNot', buildOperationWithSingleInput); \ No newline at end of file
+if (navigator.ml) {
+ testWebNNOperation(
+ [
+ 'equal',
+ 'greater',
+ 'greaterOrEqual',
+ 'lesser',
+ 'lesserOrEqual',
+ ],
+ buildOperationWithTwoInputs);
+ testWebNNOperation('logicalNot', buildOperationWithSingleInput);
+} else {
+ test(() => assert_implements(navigator.ml, 'missing navigator.ml'));
+}
diff --git a/testing/web-platform/tests/webnn/conformance_tests/elementwise_unary.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/elementwise_unary.https.any.js
index 8029539eda..f202af01e5 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/elementwise_unary.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/elementwise_unary.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API element-wise unary operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,7 +9,9 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-unary
-testWebNNOperation(
- ['abs', 'ceil', 'cos', 'erf', 'exp', 'floor', 'identity', 'log', 'neg', 'reciprocal', 'sin', 'sqrt', 'tan'],
- buildOperationWithSingleInput
-); \ No newline at end of file
+runWebNNConformanceTests(
+ [
+ 'abs', 'ceil', 'cos', 'erf', 'exp', 'floor', 'identity', 'log', 'neg',
+ 'reciprocal', 'sin', 'sqrt', 'tan'
+ ],
+ buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js
index 382faa97fd..ac1c19a80b 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API elu operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-elu
-testWebNNOperation('elu', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('elu', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js
index b1be129eac..e7bf106f96 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API expand operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,5 +9,5 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-expand
-// reuse buildReshape method
-testWebNNOperation('expand', buildReshape); \ No newline at end of file
+// Reuse buildReshape method
+runWebNNConformanceTests('expand', buildReshape);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js
index 39b1970563..504f2dd792 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API gather operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gather
-testWebNNOperation('gather', buildOperationWithTwoInputs); \ No newline at end of file
+runWebNNConformanceTests('gather', buildOperationWithTwoInputs);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js
index 61fd7c9b39..03a836a44a 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API gemm operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gemm
-testWebNNOperation('gemm', buildGemm); \ No newline at end of file
+runWebNNConformanceTests('gemm', buildGemm);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/arg_min_max.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/arg_min_max.https.any.js
deleted file mode 100644
index c700ee5cad..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/arg_min_max.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API argMin/Max operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-argminmax
-
-testWebNNOperation(['argMin', 'argMax'], buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/batch_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/batch_normalization.https.any.js
deleted file mode 100644
index 534cdf6365..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/batch_normalization.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API batchNormalization operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-batchnorm
-
-testWebNNOperation('batchNormalization', buildBatchNorm, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/buffer.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/buffer.https.any.js
deleted file mode 100644
index 225bc40185..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/buffer.https.any.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// META: title=test WebNN API buffer operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlbuffer
-
-testCreateWebNNBuffer("create", 4, 'gpu');
-
-testDestroyWebNNBuffer('destroyTwice', 'gpu');
-
-testReadWebNNBuffer('read', 'gpu');
-
-testWriteWebNNBuffer('write', 'gpu');
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/cast.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/cast.https.any.js
deleted file mode 100644
index e4309ffd8e..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/cast.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API cast operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-cast
-
-testWebNNOperation('cast', buildCast, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/clamp.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/clamp.https.any.js
deleted file mode 100644
index 9b3f93ecc7..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/clamp.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API clamp operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-clamp
-
-testWebNNOperation('clamp', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/concat.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/concat.https.any.js
deleted file mode 100644
index c0cfb8626b..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/concat.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API concat operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-concat
-
-testWebNNOperation('concat', buildConcat, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/constant.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/constant.https.any.js
deleted file mode 100644
index 77b4d889a2..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/constant.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API constant
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-constant-range
-
-testWebNNOperation('constant', buildConstantRange, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/conv2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/conv2d.https.any.js
deleted file mode 100644
index 770540abd8..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/conv2d.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API conv2d operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-conv2d
-
-testWebNNOperation('conv2d', buildConv2d, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/conv_transpose2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/conv_transpose2d.https.any.js
deleted file mode 100644
index 08c441b5b4..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/conv_transpose2d.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API convTranspose2d operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-convtranspose2d
-
-testWebNNOperation('convTranspose2d', buildConvTranspose2d, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_binary.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_binary.https.any.js
deleted file mode 100644
index 8b9fa486f8..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_binary.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API element-wise binary operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-binary
-
-testWebNNOperation(['add', 'sub', 'mul', 'div', 'max', 'min', 'pow'], buildOperationWithTwoInputs, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_logical.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_logical.https.any.js
deleted file mode 100644
index 70a887a147..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_logical.https.any.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// META: title=test WebNN API element-wise logical operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-logical
-
-testWebNNOperation(
- [
- 'equal',
- 'greater',
- 'greaterOrEqual',
- 'lesser',
- 'lesserOrEqual',
- ],
- buildOperationWithTwoInputs, 'gpu'
-);
-testWebNNOperation('logicalNot', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_unary.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_unary.https.any.js
deleted file mode 100644
index 8871129311..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/elementwise_unary.https.any.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// META: title=test WebNN API element-wise unary operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-unary
-
-testWebNNOperation(
- ['abs', 'ceil', 'cos', 'erf', 'exp', 'floor', 'identity', 'log', 'neg', 'reciprocal', 'sin', 'sqrt', 'tan'],
- buildOperationWithSingleInput, 'gpu'
-); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/elu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/elu.https.any.js
deleted file mode 100644
index db14442641..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/elu.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API elu operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-elu
-
-testWebNNOperation('elu', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/expand.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/expand.https.any.js
deleted file mode 100644
index f46f463781..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/expand.https.any.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// META: title=test WebNN API expand operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-expand
-
-// reuse buildReshape method
-testWebNNOperation('expand', buildReshape, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/gather.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/gather.https.any.js
deleted file mode 100644
index 8e457192d8..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/gather.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API gather operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gather
-
-testWebNNOperation('gather', buildOperationWithTwoInputs, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/gemm.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/gemm.https.any.js
deleted file mode 100644
index f288c31bed..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/gemm.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API gemm operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gemm
-
-testWebNNOperation('gemm', buildGemm, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_sigmoid.https.any.js
deleted file mode 100644
index d40e42a211..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_sigmoid.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API hardSigmoid operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-hard-sigmoid
-
-testWebNNOperation('hardSigmoid', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_swish.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_swish.https.any.js
deleted file mode 100644
index 031e65ee16..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/hard_swish.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API tanh operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-hard-swish
-
-testWebNNOperation('hardSwish', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/instance_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/instance_normalization.https.any.js
deleted file mode 100644
index ecfaac71ee..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/instance_normalization.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API instanceNormalization operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-instancenorm
-
-testWebNNOperation('instanceNormalization', buildLayerNorm, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/layer_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/layer_normalization.https.any.js
deleted file mode 100644
index 0e4f6caebf..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/layer_normalization.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API layerNormalization operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-layernorm
-
-testWebNNOperation('layerNormalization', buildLayerNorm, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/leaky_relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/leaky_relu.https.any.js
deleted file mode 100644
index 9fab2353b9..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/leaky_relu.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API leakyRelu operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-leakyrelu
-
-testWebNNOperation('leakyRelu', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/linear.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/linear.https.any.js
deleted file mode 100644
index ccec2c3eac..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/linear.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API linear operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-linear
-
-testWebNNOperation('linear', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/matmul.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/matmul.https.any.js
deleted file mode 100644
index 635ce84ac6..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/matmul.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API matmul operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-matmul
-
-testWebNNOperation('matmul', buildOperationWithTwoInputs, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/pad.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/pad.https.any.js
deleted file mode 100644
index f313e2c9f9..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/pad.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API pad operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-pad
-
-testWebNNOperation('pad', buildPad, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/pooling.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/pooling.https.any.js
deleted file mode 100644
index 837bca2c71..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/pooling.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API pooling operations
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-pool2d
-
-testWebNNOperation(['averagePool2d', 'l2Pool2d', 'maxPool2d'], buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/prelu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/prelu.https.any.js
deleted file mode 100644
index 475cd9e5ce..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/prelu.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API prelu operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-prelu
-
-testWebNNOperation('prelu', buildOperationWithTwoInputs, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/reduction.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/reduction.https.any.js
deleted file mode 100644
index 0f3cefa02e..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/reduction.https.any.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// META: title=test WebNN API reduction operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reduce
-
-testWebNNOperation(
- [
- 'reduceL1',
- 'reduceL2',
- 'reduceLogSum',
- 'reduceLogSumExp',
- 'reduceMax',
- 'reduceMean',
- 'reduceMin',
- 'reduceProduct',
- 'reduceSum',
- 'reduceSumSquare',
- ],
- buildOperationWithSingleInput, 'gpu'
-); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/relu.https.any.js
deleted file mode 100644
index d1a35367df..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/relu.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API relu operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-relu
-
-testWebNNOperation('relu', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/resample2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/resample2d.https.any.js
deleted file mode 100644
index dd8e441946..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/resample2d.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API resample2d operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-resample2d-method
-
-testWebNNOperation('resample2d', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/reshape.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/reshape.https.any.js
deleted file mode 100644
index b0217d2e67..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/reshape.https.any.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// META: title=test WebNN API reshape operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reshape
-
-testWebNNOperation('reshape', buildReshape, 'gpu');
-
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/sigmoid.https.any.js
deleted file mode 100644
index 26116c0ff9..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/sigmoid.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API sigmoid operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-sigmoid
-
-testWebNNOperation('sigmoid', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/slice.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/slice.https.any.js
deleted file mode 100644
index 1710c79a9c..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/slice.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API slice operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-slice
-
-testWebNNOperation('slice', buildSlice, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/softmax.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/softmax.https.any.js
deleted file mode 100644
index 9eaffe2beb..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/softmax.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API softmax operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softmax
-
-testWebNNOperation('softmax', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/softplus.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/softplus.https.any.js
deleted file mode 100644
index 5f06846113..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/softplus.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API softplus operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softplus
-
-testWebNNOperation('softplus', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/softsign.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/softsign.https.any.js
deleted file mode 100644
index eac0b7ec40..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/softsign.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API softsign operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softsign
-
-testWebNNOperation('softsign', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/split.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/split.https.any.js
deleted file mode 100644
index 3b0aafd787..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/split.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API split operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-split
-
-testWebNNOperation('split', buildSplit, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/tanh.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/tanh.https.any.js
deleted file mode 100644
index 3029f4865a..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/tanh.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API tanh operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-tanh
-
-testWebNNOperation('tanh', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/transpose.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/transpose.https.any.js
deleted file mode 100644
index 295ef43ec1..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/transpose.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API transpose operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-transpose
-
-testWebNNOperation('transpose', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/triangular.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/triangular.https.any.js
deleted file mode 100644
index 3e1b0d5ab1..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/triangular.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API triangular operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-triangular
-
-testWebNNOperation('triangular', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/gpu/where.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gpu/where.https.any.js
deleted file mode 100644
index 49c6cbd4e3..0000000000
--- a/testing/web-platform/tests/webnn/conformance_tests/gpu/where.https.any.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// META: title=test WebNN API where operation
-// META: global=window,dedicatedworker
-// META: script=../../resources/utils.js
-// META: timeout=long
-
-'use strict';
-
-// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-where
-
-testWebNNOperation('where', buildWhere, 'gpu'); \ No newline at end of file
diff --git a/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js
index 8161a24538..55391e7f1c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API hardSigmoid operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-hard-sigmoid
-testWebNNOperation('hardSigmoid', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('hardSigmoid', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js
index b4a7c53d8d..24b8c413bb 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API tanh operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-hard-swish
-testWebNNOperation('hardSwish', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('hardSwish', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js
index fce879172e..fc339e5bab 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API instanceNormalization operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-instancenorm
-testWebNNOperation('instanceNormalization', buildLayerNorm); \ No newline at end of file
+runWebNNConformanceTests('instanceNormalization', buildLayerNorm);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js
index ab8a50cc03..ea3cd04240 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API layerNormalization operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-layernorm
-testWebNNOperation('layerNormalization', buildLayerNorm); \ No newline at end of file
+runWebNNConformanceTests('layerNormalization', buildLayerNorm);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js
index 2b6f17e95d..b2a4055bde 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API leakyRelu operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-leakyrelu
-testWebNNOperation('leakyRelu', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('leakyRelu', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js
index 465b697f29..0e22f7a036 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API linear operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-linear
-testWebNNOperation('linear', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('linear', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js
index 64eeb37f08..da78230579 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API matmul operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-matmul
-testWebNNOperation('matmul', buildOperationWithTwoInputs); \ No newline at end of file
+runWebNNConformanceTests('matmul', buildOperationWithTwoInputs);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js
index f1a2400d1c..d733cbb6ed 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API pad operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-pad
-testWebNNOperation('pad', buildPad); \ No newline at end of file
+runWebNNConformanceTests('pad', buildPad);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js
new file mode 100644
index 0000000000..642fec9f73
--- /dev/null
+++ b/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js
@@ -0,0 +1,19 @@
+// META: title=test parallel WebNN API compute operations
+// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
+// META: script=../resources/utils.js
+// META: timeout=long
+
+'use strict';
+
+// https://webmachinelearning.github.io/webnn/#api-mlcontext-compute
+
+if (navigator.ml) {
+ testParallelCompute();
+} else {
+ // Show indication to users why the test failed
+ test(
+ () => assert_not_equals(
+ navigator.ml, undefined, 'ml property is defined on navigator'));
+}
diff --git a/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js
index 400d5ed37d..de2ae35a9c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API pooling operations
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,5 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-pool2d
-testWebNNOperation(['averagePool2d', 'l2Pool2d', 'maxPool2d'], buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests(
+ ['averagePool2d', 'l2Pool2d', 'maxPool2d'], buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js
index 83cc9db4b4..9337211e54 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API prelu operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-prelu
-testWebNNOperation('prelu', buildOperationWithTwoInputs); \ No newline at end of file
+runWebNNConformanceTests('prelu', buildOperationWithTwoInputs);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduction.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduction.https.any.js
index 30bfb4ba7a..c291906ba1 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/reduction.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/reduction.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API reduction operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,18 +9,17 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reduce
-testWebNNOperation(
- [
- 'reduceL1',
- 'reduceL2',
- 'reduceLogSum',
- 'reduceLogSumExp',
- 'reduceMax',
- 'reduceMean',
- 'reduceMin',
- 'reduceProduct',
- 'reduceSum',
- 'reduceSumSquare',
- ],
- buildOperationWithSingleInput
-); \ No newline at end of file
+runWebNNConformanceTests(
+ [
+ 'reduceL1',
+ 'reduceL2',
+ 'reduceLogSum',
+ 'reduceLogSumExp',
+ 'reduceMax',
+ 'reduceMean',
+ 'reduceMin',
+ 'reduceProduct',
+ 'reduceSum',
+ 'reduceSumSquare',
+ ],
+ buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js
index 51e427898f..7cb23eea1b 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API relu operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-relu
-testWebNNOperation('relu', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('relu', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js
index 0b5b3e0032..b5bdda7197 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API resample2d operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-resample2d-method
-testWebNNOperation('resample2d', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('resample2d', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js
index c0dafb176c..a7d03b2a0c 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API reshape operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,5 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reshape
-testWebNNOperation('reshape', buildReshape);
-
+runWebNNConformanceTests('reshape', buildReshape);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js
index 186f468918..9730b548b5 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API sigmoid operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-sigmoid
-testWebNNOperation('sigmoid', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('sigmoid', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js
index 6441204517..b316ea58c4 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API slice operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-slice
-testWebNNOperation('slice', buildSlice); \ No newline at end of file
+runWebNNConformanceTests('slice', buildSlice);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js
index 143b7d969f..a68a32c45f 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API softmax operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softmax
-testWebNNOperation('softmax', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('softmax', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js
index fcd6410bdb..7d89b117eb 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API softplus operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softplus
-testWebNNOperation('softplus', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('softplus', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js
index 6e26afdade..e175e0de56 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API softsign operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-softsign
-testWebNNOperation('softsign', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('softsign', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js
index 0de6cb4d8d..78d707687f 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API split operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-split
-testWebNNOperation('split', buildSplit); \ No newline at end of file
+runWebNNConformanceTests('split', buildSplit);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js
index c5d1f86ab1..e3ab5e9192 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API tanh operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-tanh
-testWebNNOperation('tanh', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('tanh', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js
index 746e53d512..83bd7a45c1 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API transpose operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-transpose
-testWebNNOperation('transpose', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('transpose', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js
index 503f310620..499f60ed36 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API triangular operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-triangular
-testWebNNOperation('triangular', buildOperationWithSingleInput); \ No newline at end of file
+runWebNNConformanceTests('triangular', buildOperationWithSingleInput);
diff --git a/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js
index 7926221d3a..4ab453ab24 100644
--- a/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js
+++ b/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js
@@ -1,5 +1,7 @@
// META: title=test WebNN API where operation
// META: global=window,dedicatedworker
+// META: variant=?cpu
+// META: variant=?gpu
// META: script=../resources/utils.js
// META: timeout=long
@@ -7,4 +9,4 @@
// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-where
-testWebNNOperation('where', buildWhere); \ No newline at end of file
+runWebNNConformanceTests('where', buildWhere);