summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts34
1 files changed, 6 insertions, 28 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts
index 9f11c3cac1..06a4ac47cc 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts
@@ -4,36 +4,14 @@ Execution Tests for matrix f32 addition expression
import { makeTestGroup } from '../../../../../common/framework/test_group.js';
import { GPUTest } from '../../../../gpu_test.js';
-import { TypeF32, TypeMat } from '../../../../util/conversion.js';
-import { FP } from '../../../../util/floating_point.js';
-import { sparseMatrixF32Range } from '../../../../util/math.js';
-import { makeCaseCache } from '../case_cache.js';
+import { Type } from '../../../../util/conversion.js';
import { allInputSources, run } from '../expression.js';
import { binary, compoundBinary } from './binary.js';
+import { d } from './f32_matrix_addition.cache.js';
export const g = makeTestGroup(GPUTest);
-// Cases: matCxR_[non_]const
-const mat_cases = ([2, 3, 4] as const)
- .flatMap(cols =>
- ([2, 3, 4] as const).flatMap(rows =>
- ([true, false] as const).map(nonConst => ({
- [`mat${cols}x${rows}_${nonConst ? 'non_const' : 'const'}`]: () => {
- return FP.f32.generateMatrixPairToMatrixCases(
- sparseMatrixF32Range(cols, rows),
- sparseMatrixF32Range(cols, rows),
- nonConst ? 'unfiltered' : 'finite',
- FP.f32.additionMatrixMatrixInterval
- );
- },
- }))
- )
- )
- .reduce((a, b) => ({ ...a, ...b }), {});
-
-export const d = makeCaseCache('binary/f32_matrix_addition', mat_cases);
-
g.test('matrix')
.specURL('https://www.w3.org/TR/WGSL/#floating-point-evaluation')
.desc(
@@ -57,8 +35,8 @@ Accuracy: Correctly rounded
await run(
t,
binary('+'),
- [TypeMat(cols, rows, TypeF32), TypeMat(cols, rows, TypeF32)],
- TypeMat(cols, rows, TypeF32),
+ [Type.mat(cols, rows, Type.f32), Type.mat(cols, rows, Type.f32)],
+ Type.mat(cols, rows, Type.f32),
t.params,
cases
);
@@ -87,8 +65,8 @@ Accuracy: Correctly rounded
await run(
t,
compoundBinary('+='),
- [TypeMat(cols, rows, TypeF32), TypeMat(cols, rows, TypeF32)],
- TypeMat(cols, rows, TypeF32),
+ [Type.mat(cols, rows, Type.f32), Type.mat(cols, rows, Type.f32)],
+ Type.mat(cols, rows, Type.f32),
t.params,
cases
);