Skip to content

make subgroup ops match glsl more closely #32

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

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
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
1,713 changes: 486 additions & 1,227 deletions crates/spirv-std/src/arch/subgroup.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/ui/arch/subgroup/subgroup_ballot.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 381 8
OpLine %6 380 8
%7 = OpGroupNonUniformBallot %8 %9 %4
OpLine %6 417 8
OpLine %6 416 8
%10 = OpGroupNonUniformInverseBallot %2 %9 %7
OpNoLine
OpReturnValue %10
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_ballot_bit_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;

unsafe fn subgroup_ballot_bit_count(ballot: SubgroupMask) -> u32 {
spirv_std::arch::subgroup_ballot_bit_count::<{ GroupOperation::Reduce as u32 }>(ballot)
spirv_std::arch::subgroup_ballot_bit_count(ballot)
}

#[spirv(compute(threads(1, 1, 1)))]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %5
%6 = OpLabel
OpLine %7 493 8
OpLine %7 512 0
%8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4
OpNoLine
OpReturnValue %8
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_broadcast_first.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 348 8
OpLine %6 347 8
%7 = OpGroupNonUniformBroadcastFirst %2 %8 %4
OpNoLine
OpReturnValue %7
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_elect.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%1 = OpFunction %2 None %3
%4 = OpLabel
OpLine %5 183 8
OpLine %5 182 8
%6 = OpGroupNonUniformElect %2 %7
OpNoLine
OpReturnValue %6
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_clustered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;

unsafe fn subgroup_i_add_clustered(value: u32) -> u32 {
spirv_std::arch::subgroup_i_add_clustered::<8, _>(value)
spirv_std::arch::subgroup_clustered_i_add::<8, _>(value)
}

#[spirv(compute(threads(32, 1, 1)))]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_clustered.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 784 8
OpLine %6 810 0
%7 = OpGroupNonUniformIAdd %2 %8 ClusteredReduce %4 %9
OpNoLine
OpReturnValue %7
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;

unsafe fn subgroup_i_add_exclusive_scan(value: u32) -> u32 {
spirv_std::arch::subgroup_i_add::<{ GroupOperation::ExclusiveScan as u32 }, _>(value)
spirv_std::arch::subgroup_exclusive_i_add(value)
}

#[spirv(compute(threads(32, 1, 1)))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 743 8
OpLine %6 797 0
%7 = OpGroupNonUniformIAdd %2 %8 ExclusiveScan %4
OpNoLine
OpReturnValue %7
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;

unsafe fn subgroup_i_add_inclusive_scan(value: u32) -> u32 {
spirv_std::arch::subgroup_i_add::<{ GroupOperation::InclusiveScan as u32 }, _>(value)
spirv_std::arch::subgroup_inclusive_i_add(value)
}

#[spirv(compute(threads(32, 1, 1)))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 743 8
OpLine %6 797 0
%7 = OpGroupNonUniformIAdd %2 %8 InclusiveScan %4
OpNoLine
OpReturnValue %7
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;

unsafe fn subgroup_i_add_reduce(value: u32) -> u32 {
spirv_std::arch::subgroup_i_add::<{ GroupOperation::Reduce as u32 }, _>(value)
spirv_std::arch::subgroup_i_add(value)
}

#[spirv(compute(threads(32, 1, 1)))]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/arch/subgroup/subgroup_i_add_reduce.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 743 8
OpLine %6 797 0
%7 = OpGroupNonUniformIAdd %2 %8 Reduce %4
OpNoLine
OpReturnValue %7
Expand Down