diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js')
-rw-r--r-- | testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js b/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js index 72fa92f5af..af936622e2 100644 --- a/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js +++ b/testing/web-platform/mozilla/tests/webgpu/webgpu/shader/execution/expression/call/builtin/tan.spec.js @@ -3,54 +3,39 @@ **/export const description = ` Execution tests for the 'tan' builtin function -S is AbstractFloat, f32, f16 +S is abstract-float, f32, f16 T is S or vecN<S> @const fn tan(e: T ) -> T Returns the tangent of e. Component-wise when T is a vector. `;import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; import { GPUTest } from '../../../../../gpu_test.js'; -import { TypeF32, TypeF16 } from '../../../../../util/conversion.js'; -import { FP } from '../../../../../util/floating_point.js'; -import { fullF32Range, fullF16Range, linearRange } from '../../../../../util/math.js'; -import { makeCaseCache } from '../../case_cache.js'; -import { allInputSources, run } from '../../expression.js'; +import { Type } from '../../../../../util/conversion.js'; +import { allInputSources, onlyConstInputSource, run } from '../../expression.js'; -import { builtin } from './builtin.js'; +import { abstractFloatBuiltin, builtin } from './builtin.js'; +import { d } from './tan.cache.js'; export const g = makeTestGroup(GPUTest); -export const d = makeCaseCache('tan', { - f32: () => { - return FP.f32.generateScalarToIntervalCases( - [ - // Defined accuracy range - ...linearRange(-Math.PI, Math.PI, 100), - ...fullF32Range()], - - 'unfiltered', - FP.f32.tanInterval - ); - }, - f16: () => { - return FP.f16.generateScalarToIntervalCases( - [ - // Defined accuracy range - ...linearRange(-Math.PI, Math.PI, 100), - ...fullF16Range()], - - 'unfiltered', - FP.f16.tanInterval - ); - } -}); - g.test('abstract_float'). specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions'). desc(`abstract float tests`). params((u) => -u.combine('inputSource', allInputSources).combine('vectorize', [undefined, 2, 3, 4]) +u. +combine('inputSource', onlyConstInputSource). +combine('vectorize', [undefined, 2, 3, 4]) ). -unimplemented(); +fn(async (t) => { + const cases = await d.get('abstract'); + await run( + t, + abstractFloatBuiltin('tan'), + [Type.abstractFloat], + Type.abstractFloat, + t.params, + cases + ); +}); g.test('f32'). specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions'). @@ -60,7 +45,7 @@ u.combine('inputSource', allInputSources).combine('vectorize', [undefined, 2, 3, ). fn(async (t) => { const cases = await d.get('f32'); - await run(t, builtin('tan'), [TypeF32], TypeF32, t.params, cases); + await run(t, builtin('tan'), [Type.f32], Type.f32, t.params, cases); }); g.test('f16'). @@ -74,5 +59,5 @@ beforeAllSubcases((t) => { }). fn(async (t) => { const cases = await d.get('f16'); - await run(t, builtin('tan'), [TypeF16], TypeF16, t.params, cases); + await run(t, builtin('tan'), [Type.f16], Type.f16, t.params, cases); });
\ No newline at end of file |