Skip to content

Commit

Permalink
Use device subgroup limits in subgroup_size tests (gpuweb#3885)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-baker authored Aug 1, 2024
1 parent 8199588 commit 921a510
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/webgpu/shader/execution/shader_io/compute_builtins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,11 @@ g.test('subgroup_size')
t.selectDeviceOrSkipTestCase('subgroups' as GPUFeatureName);
})
.fn(async t => {
// Replace these with the limits when they are wired up.
const minSize = 4;
const maxSize = 128;
interface SubgroupLimits extends GPUSupportedLimits {
minSubgroupSize: number;
maxSubgroupSize: number;
}
const { minSubgroupSize, maxSubgroupSize } = t.device.limits as SubgroupLimits;

const wgx = t.params.sizes[0];
const wgy = t.params.sizes[1];
Expand Down Expand Up @@ -512,7 +514,15 @@ fn main(@builtin(subgroup_size) size : u32,
});
const compareData: Uint32Array = compareReadback.data;

t.expectOK(checkSubgroupSizeConsistency(sizesData, compareData, minSize, maxSize, wgThreads));
t.expectOK(
checkSubgroupSizeConsistency(
sizesData,
compareData,
minSubgroupSize,
maxSubgroupSize,
wgThreads
)
);
});

/**
Expand Down

0 comments on commit 921a510

Please sign in to comment.