Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat: make atomicCompareExchangeWeak tests handle limits #3235

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ struct __atomic_compare_exchange_result<T> {
const numInvocations = t.params.workgroupSize;
const scalarType = t.params.scalarType;

t.skipIf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe filter out the params instead of skipping in test body?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I don't think I can filter these out before without a device since I'm comparing to device.limits.maxComputeWorkgroupSizeX. I could hard code those limits somewhere but it seems better to look them up in the one place that would be correct in the future.

Copy link
Contributor

@shrekshao shrekshao Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem for leaving it as is then

numInvocations > t.device.limits.maxComputeWorkgroupSizeX,
`${numInvocations} > maxComputeWorkgroupSizeX(${t.device.limits.maxComputeWorkgroupSizeX})`
);

// Number of times each workgroup attempts to exchange the same value to the same memory address
const numWrites = 4;

Expand Down Expand Up @@ -556,6 +561,11 @@ struct __atomic_compare_exchange_result<T> {
const numInvocations = t.params.workgroupSize;
const scalarType = t.params.scalarType;

t.skipIf(
numInvocations > t.device.limits.maxComputeWorkgroupSizeX,
`${numInvocations} > maxComputeWorkgroupSizeX(${t.device.limits.maxComputeWorkgroupSizeX})`
);

// Number of times each workgroup attempts to exchange the same value to the same memory address
const numWrites = 4;

Expand Down