summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js')
-rw-r--r--testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js85
1 files changed, 16 insertions, 69 deletions
diff --git a/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js b/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js
index 6f8cc65f4e..9a5f7bdb0d 100644
--- a/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js
+++ b/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/binary/af_multiplication.spec.js
@@ -1,70 +1,17 @@
/**
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
**/export const description = `
-Execution Tests for non-matrix AbstractFloat multiplication expression
+Execution Tests for non-matrix abstract-float multiplication expression
`;import { makeTestGroup } from '../../../../../common/framework/test_group.js';
import { GPUTest } from '../../../../gpu_test.js';
-import { TypeAbstractFloat, TypeVec } from '../../../../util/conversion.js';
-import { FP } from '../../../../util/floating_point.js';
-import { sparseF64Range, sparseVectorF64Range } from '../../../../util/math.js';
-import { makeCaseCache } from '../case_cache.js';
+import { Type } from '../../../../util/conversion.js';
import { onlyConstInputSource, run } from '../expression.js';
-import { abstractBinary } from './binary.js';
-
-const multiplicationVectorScalarInterval = (v, s) => {
- return FP.abstract.toVector(v.map((e) => FP.abstract.multiplicationInterval(e, s)));
-};
-
-const multiplicationScalarVectorInterval = (s, v) => {
- return FP.abstract.toVector(v.map((e) => FP.abstract.multiplicationInterval(s, e)));
-};
+import { d } from './af_multiplication.cache.js';
+import { abstractFloatBinary } from './binary.js';
export const g = makeTestGroup(GPUTest);
-const scalar_cases = {
- ['scalar']: () => {
- return FP.abstract.generateScalarPairToIntervalCases(
- sparseF64Range(),
- sparseF64Range(),
- 'finite',
- FP.abstract.multiplicationInterval
- );
- }
-};
-
-const vector_scalar_cases = [2, 3, 4].
-map((dim) => ({
- [`vec${dim}_scalar`]: () => {
- return FP.abstract.generateVectorScalarToVectorCases(
- sparseVectorF64Range(dim),
- sparseF64Range(),
- 'finite',
- multiplicationVectorScalarInterval
- );
- }
-})).
-reduce((a, b) => ({ ...a, ...b }), {});
-
-const scalar_vector_cases = [2, 3, 4].
-map((dim) => ({
- [`scalar_vec${dim}`]: () => {
- return FP.abstract.generateScalarVectorToVectorCases(
- sparseF64Range(),
- sparseVectorF64Range(dim),
- 'finite',
- multiplicationScalarVectorInterval
- );
- }
-})).
-reduce((a, b) => ({ ...a, ...b }), {});
-
-export const d = makeCaseCache('binary/af_multiplication', {
- ...scalar_cases,
- ...vector_scalar_cases,
- ...scalar_vector_cases
-});
-
g.test('scalar').
specURL('https://www.w3.org/TR/WGSL/#floating-point-evaluation').
desc(
@@ -78,9 +25,9 @@ fn(async (t) => {
const cases = await d.get('scalar');
await run(
t,
- abstractBinary('*'),
- [TypeAbstractFloat, TypeAbstractFloat],
- TypeAbstractFloat,
+ abstractFloatBinary('*'),
+ [Type.abstractFloat, Type.abstractFloat],
+ Type.abstractFloat,
t.params,
cases
);
@@ -101,9 +48,9 @@ fn(async (t) => {
const cases = await d.get('scalar'); // Using vectorize to generate vector cases based on scalar cases
await run(
t,
- abstractBinary('*'),
- [TypeAbstractFloat, TypeAbstractFloat],
- TypeAbstractFloat,
+ abstractFloatBinary('*'),
+ [Type.abstractFloat, Type.abstractFloat],
+ Type.abstractFloat,
t.params,
cases
);
@@ -123,9 +70,9 @@ fn(async (t) => {
const cases = await d.get(`vec${dim}_scalar`);
await run(
t,
- abstractBinary('*'),
- [TypeVec(dim, TypeAbstractFloat), TypeAbstractFloat],
- TypeVec(dim, TypeAbstractFloat),
+ abstractFloatBinary('*'),
+ [Type.vec(dim, Type.abstractFloat), Type.abstractFloat],
+ Type.vec(dim, Type.abstractFloat),
t.params,
cases
);
@@ -145,9 +92,9 @@ fn(async (t) => {
const cases = await d.get(`scalar_vec${dim}`);
await run(
t,
- abstractBinary('*'),
- [TypeAbstractFloat, TypeVec(dim, TypeAbstractFloat)],
- TypeVec(dim, TypeAbstractFloat),
+ abstractFloatBinary('*'),
+ [Type.abstractFloat, Type.vec(dim, Type.abstractFloat)],
+ Type.vec(dim, Type.abstractFloat),
t.params,
cases
);