Skip to content

Commit 9bb4ad6

Browse files
tests
1 parent 5b1eb7a commit 9bb4ad6

File tree

26 files changed

+1446
-1673
lines changed

26 files changed

+1446
-1673
lines changed

test/WaveSize32/program_1755382123318221229_13_increment_0_WaveParticipantTracking.test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ void main(uint3 tid : SV_DispatchThreadID) {
154154
bool _isCorrect = (_participantCount == 12);
155155
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
156156
}
157-
}
158-
if ((counter0 == 2)) {
159-
break;
160157
}
161158
}
162159
if (((WaveGetLaneIndex() & 1) == 0)) {
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#--- source.hlsl
2+
RWStructuredBuffer<uint> _participant_check_sum : register(u1);
3+
4+
[numthreads(64, 1, 1)]
5+
void main(uint3 tid : SV_DispatchThreadID) {
6+
_participant_check_sum[tid.x] = 0;
7+
uint result = 0;
8+
for (uint i0 = 0; (i0 < 2); i0 = (i0 + 1)) {
9+
if ((((WaveGetLaneIndex() == 2) || (WaveGetLaneIndex() == 20)) || (WaveGetLaneIndex() == 30))) {
10+
result = (result + WaveActiveMin(result));
11+
uint _participantCount = WaveActiveSum(1);
12+
bool _isCorrect = (_participantCount == 3);
13+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
14+
}
15+
if ((WaveGetLaneIndex() < 3)) {
16+
if ((WaveGetLaneIndex() < 2)) {
17+
result = (result + WaveActiveMax(WaveGetLaneIndex()));
18+
uint _participantCount = WaveActiveSum(1);
19+
bool _isCorrect = (_participantCount == 2);
20+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
21+
}
22+
switch ((WaveGetLaneIndex() % 2)) {
23+
case 0: {
24+
if ((WaveGetLaneIndex() < 8)) {
25+
result = (result + WaveActiveSum(1));
26+
uint _participantCount = WaveActiveSum(1);
27+
bool _isCorrect = (_participantCount == 2);
28+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
29+
}
30+
break;
31+
}
32+
case 1: {
33+
if (((WaveGetLaneIndex() % 2) == 0)) {
34+
result = (result + WaveActiveSum(2));
35+
uint _participantCount = WaveActiveSum(1);
36+
bool _isCorrect = (_participantCount == 0);
37+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
38+
}
39+
break;
40+
}
41+
}
42+
if ((WaveGetLaneIndex() < 7)) {
43+
result = (result + WaveActiveSum(WaveGetLaneIndex()));
44+
uint _participantCount = WaveActiveSum(1);
45+
bool _isCorrect = (_participantCount == 3);
46+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
47+
}
48+
}
49+
}
50+
uint counter1 = 0;
51+
while ((counter1 < 2)) {
52+
counter1 = (counter1 + 1);
53+
if ((((WaveGetLaneIndex() == 14) || (WaveGetLaneIndex() == 29)) || (WaveGetLaneIndex() == 22))) {
54+
result = (result + WaveActiveMin(7));
55+
uint _participantCount = WaveActiveSum(1);
56+
bool _isCorrect = (_participantCount == 3);
57+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
58+
}
59+
uint counter2 = 0;
60+
while ((counter2 < 2)) {
61+
counter2 = (counter2 + 1);
62+
if (((WaveGetLaneIndex() & 1) == 0)) {
63+
result = (result + WaveActiveSum(result));
64+
uint _participantCount = WaveActiveSum(1);
65+
bool _isCorrect = (_participantCount == 16);
66+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
67+
}
68+
if ((WaveGetLaneIndex() == 10)) {
69+
if ((WaveGetLaneIndex() == 21)) {
70+
result = (result + WaveActiveMin(6));
71+
uint _participantCount = WaveActiveSum(1);
72+
bool _isCorrect = (_participantCount == 0);
73+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
74+
}
75+
} else {
76+
if ((WaveGetLaneIndex() == 23)) {
77+
result = (result + WaveActiveMin(WaveGetLaneIndex()));
78+
uint _participantCount = WaveActiveSum(1);
79+
bool _isCorrect = (_participantCount == 1);
80+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
81+
}
82+
}
83+
}
84+
if (((((WaveGetLaneIndex() == 4) || (WaveGetLaneIndex() == 16)) || (WaveGetLaneIndex() == 25)) || (WaveGetLaneIndex() == 9))) {
85+
result = (result + WaveActiveMax(result));
86+
uint _participantCount = WaveActiveSum(1);
87+
bool _isCorrect = (_participantCount == 4);
88+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
89+
}
90+
}
91+
}
92+
93+
#--- pipeline.yaml
94+
---
95+
Shaders:
96+
- Stage: Compute
97+
Entry: main
98+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
99+
Buffers:
100+
- Name: _participant_check_sum
101+
Format: UInt32
102+
Stride: 4
103+
Fill: 0
104+
Size: 64
105+
- Name: expected_participants
106+
Format: UInt32
107+
Stride: 4
108+
Data: [10, 4, 10, 0, 6, 0, 4, 0, 4, 2, 4, 0, 4, 0, 6, 0, 6, 0, 4, 0, 6, 0, 6, 4, 4, 2, 4, 0, 4, 2, 6, 0, 10, 4, 10, 0, 6, 0, 4, 0, 4, 2, 4, 0, 4, 0, 6, 0, 6, 0, 4, 0, 6, 0, 6, 4, 4, 2, 4, 0, 4, 2, 6, 0]
109+
Results:
110+
- Result: WaveOpValidation
111+
Rule: BufferExact
112+
Actual: _participant_check_sum
113+
Expected: expected_participants
114+
DescriptorSets:
115+
- Resources:
116+
- Name: _participant_check_sum
117+
Kind: RWStructuredBuffer
118+
DirectXBinding:
119+
Register: 1
120+
Space: 0
121+
VulkanBinding:
122+
Binding: 1
123+
...
124+
#--- end
125+
126+
# RUN: split-file %s %t
127+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
128+
# RUN: %offloader %t/pipeline.yaml %t.o
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#--- source.hlsl
2+
RWStructuredBuffer<uint> _participant_check_sum : register(u1);
3+
4+
[numthreads(64, 1, 1)]
5+
void main(uint3 tid : SV_DispatchThreadID) {
6+
_participant_check_sum[tid.x] = 0;
7+
uint result = 0;
8+
if ((((WaveGetLaneIndex() == 7) || (WaveGetLaneIndex() == 13)) || (WaveGetLaneIndex() == 27))) {
9+
if ((((WaveGetLaneIndex() == 7) || (WaveGetLaneIndex() == 14)) || (WaveGetLaneIndex() == 29))) {
10+
result = (result + WaveActiveMax(WaveGetLaneIndex()));
11+
uint _participantCount = WaveActiveSum(1);
12+
bool _isCorrect = (_participantCount == 1);
13+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
14+
}
15+
if (((((WaveGetLaneIndex() == 2) || (WaveGetLaneIndex() == 14)) || (WaveGetLaneIndex() == 16)) || (WaveGetLaneIndex() == 27))) {
16+
result = (result + WaveActiveMax(result));
17+
uint _participantCount = WaveActiveSum(1);
18+
bool _isCorrect = (_participantCount == 1);
19+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
20+
}
21+
}
22+
if (((WaveGetLaneIndex() < 8) || (WaveGetLaneIndex() >= 31))) {
23+
if (((WaveGetLaneIndex() < 2) || (WaveGetLaneIndex() >= 22))) {
24+
result = (result + WaveActiveMin((WaveGetLaneIndex() + 3)));
25+
uint _participantCount = WaveActiveSum(1);
26+
bool _isCorrect = (_participantCount == 3);
27+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
28+
}
29+
switch ((WaveGetLaneIndex() % 2)) {
30+
case 0: {
31+
if (((((WaveGetLaneIndex() == 3) || (WaveGetLaneIndex() == 8)) || (WaveGetLaneIndex() == 20)) || (WaveGetLaneIndex() == 29))) {
32+
if (((((WaveGetLaneIndex() == 7) || (WaveGetLaneIndex() == 11)) || (WaveGetLaneIndex() == 18)) || (WaveGetLaneIndex() == 29))) {
33+
result = (result + WaveActiveMin(result));
34+
uint _participantCount = WaveActiveSum(1);
35+
bool _isCorrect = (_participantCount == 0);
36+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
37+
}
38+
for (uint i0 = 0; (i0 < 3); i0 = (i0 + 1)) {
39+
if ((WaveGetLaneIndex() < 2)) {
40+
result = (result + WaveActiveMax(result));
41+
uint _participantCount = WaveActiveSum(1);
42+
bool _isCorrect = (_participantCount == 0);
43+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
44+
}
45+
}
46+
if (((WaveGetLaneIndex() == 9) || (WaveGetLaneIndex() == 28))) {
47+
result = (result + WaveActiveMax(result));
48+
uint _participantCount = WaveActiveSum(1);
49+
bool _isCorrect = (_participantCount == 0);
50+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
51+
}
52+
} else {
53+
if ((((WaveGetLaneIndex() == 4) || (WaveGetLaneIndex() == 11)) || (WaveGetLaneIndex() == 27))) {
54+
result = (result + WaveActiveSum(WaveGetLaneIndex()));
55+
uint _participantCount = WaveActiveSum(1);
56+
bool _isCorrect = (_participantCount == 1);
57+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
58+
}
59+
uint counter1 = 0;
60+
while ((counter1 < 2)) {
61+
counter1 = (counter1 + 1);
62+
if ((WaveGetLaneIndex() == 17)) {
63+
result = (result + WaveActiveMax((WaveGetLaneIndex() + 1)));
64+
uint _participantCount = WaveActiveSum(1);
65+
bool _isCorrect = (_participantCount == 0);
66+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
67+
}
68+
}
69+
}
70+
break;
71+
}
72+
case 1: {
73+
if (((WaveGetLaneIndex() % 2) == 0)) {
74+
result = (result + WaveActiveSum(2));
75+
uint _participantCount = WaveActiveSum(1);
76+
bool _isCorrect = (_participantCount == 0);
77+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
78+
}
79+
break;
80+
}
81+
}
82+
}
83+
}
84+
85+
#--- pipeline.yaml
86+
---
87+
Shaders:
88+
- Stage: Compute
89+
Entry: main
90+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
91+
Buffers:
92+
- Name: _participant_check_sum
93+
Format: UInt32
94+
Stride: 4
95+
Fill: 0
96+
Size: 64
97+
- Name: expected_participants
98+
Format: UInt32
99+
Stride: 4
100+
Data: [1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1]
101+
Results:
102+
- Result: WaveOpValidation
103+
Rule: BufferExact
104+
Actual: _participant_check_sum
105+
Expected: expected_participants
106+
DescriptorSets:
107+
- Resources:
108+
- Name: _participant_check_sum
109+
Kind: RWStructuredBuffer
110+
DirectXBinding:
111+
Register: 1
112+
Space: 0
113+
VulkanBinding:
114+
Binding: 1
115+
...
116+
#--- end
117+
118+
# RUN: split-file %s %t
119+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
120+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)