Skip to content

Commit 5b1eb7a

Browse files
more tests
1 parent 6575531 commit 5b1eb7a

File tree

21 files changed

+1939
-19
lines changed

21 files changed

+1939
-19
lines changed

test/WaveSize32/reduced_program_1755380594508364200_5_increment_0_WaveParticipantTracking___LanePermutation.test

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ RWStructuredBuffer<uint> _index : register(u3);
77
void main(uint3 tid : SV_DispatchThreadID) {
88
uint result = 0;
99
if ((WaveGetLaneIndex() == 5) || (WaveGetLaneIndex() == 7) || (WaveGetLaneIndex() == 3)) {
10-
uint _participantCount = WaveActiveSum(1);
11-
bool _isCorrect = (_participantCount == 3);
12-
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
13-
uint temp;
14-
InterlockedAdd(_index[0], 2, temp);
15-
_participant_bit[temp] = 1;
16-
_participant_bit[temp + 1] = WaveActiveBallot(true).x;
17-
}
18-
else {
10+
uint _participantCount = WaveActiveSum(1);
11+
bool _isCorrect = (_participantCount == 3);
12+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
13+
uint temp;
14+
InterlockedAdd(_index[0], 2, temp);
15+
_participant_bit[temp] = 1;
16+
_participant_bit[temp + 1] = WaveActiveBallot(true).x;
17+
} else {
1918
if ((WaveGetLaneIndex() == 4) || (WaveGetLaneIndex() == 2)) {
20-
uint _participantCount = WaveActiveSum(1);
21-
bool _isCorrect = (_participantCount == 2);
22-
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
23-
uint temp;
24-
InterlockedAdd(_index[0], 2, temp);
25-
_participant_bit[temp] = 2;
26-
_participant_bit[temp + 1] = WaveActiveBallot(true).x;
27-
}
28-
}
19+
uint _participantCount = WaveActiveSum(1);
20+
bool _isCorrect = (_participantCount == 2);
21+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
22+
uint temp;
23+
InterlockedAdd(_index[0], 2, temp);
24+
_participant_bit[temp] = 2;
25+
_participant_bit[temp + 1] = WaveActiveBallot(true).x;
26+
}
27+
}
2928
}
3029

3130
#--- pipeline.yaml
@@ -43,7 +42,7 @@ Buffers:
4342
- Name: expected_participants
4443
Format: UInt32
4544
Stride: 4
46-
Data: [3, 0, 1, 3, 1, 1, 3, 0, 1, 1, 1, 1, 0, 0, 3, 1, 1, 2, 1, 0, 2, 0, 3, 1, 0, 2, 1, 0, 3, 2, 0, 2, 3, 0, 1, 3, 2, 1, 3, 0, 1, 1, 1, 1, 0, 0, 3, 1, 1, 2, 1, 0, 2, 0, 3, 1, 0, 2, 1, 0, 3, 2, 0, 2]
45+
Data: [0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
4746
- Name: _participant_bit
4847
Format: UInt32
4948
Stride: 4
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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() < 21)) {
9+
for (uint i0 = 0; (i0 < 3); i0 = (i0 + 1)) {
10+
uint counter1 = 0;
11+
while ((counter1 < 2)) {
12+
counter1 = (counter1 + 1);
13+
if (((((WaveGetLaneIndex() == 14) || (WaveGetLaneIndex() == 24)) || (WaveGetLaneIndex() == 61)) || (WaveGetLaneIndex() == 28))) {
14+
result = (result + WaveActiveMax(8));
15+
uint _participantCount = WaveActiveSum(1);
16+
bool _isCorrect = (_participantCount == 1);
17+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
18+
}
19+
if (((((WaveGetLaneIndex() == 3) || (WaveGetLaneIndex() == 28)) || (WaveGetLaneIndex() == 51)) || (WaveGetLaneIndex() == 41))) {
20+
result = (result + WaveActiveSum(7));
21+
uint _participantCount = WaveActiveSum(1);
22+
bool _isCorrect = (_participantCount == 1);
23+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
24+
}
25+
if ((counter1 == 1)) {
26+
break;
27+
}
28+
}
29+
if (((((WaveGetLaneIndex() == 4) || (WaveGetLaneIndex() == 16)) || (WaveGetLaneIndex() == 34)) || (WaveGetLaneIndex() == 52))) {
30+
result = (result + WaveActiveMax((WaveGetLaneIndex() + 5)));
31+
uint _participantCount = WaveActiveSum(1);
32+
bool _isCorrect = (_participantCount == 2);
33+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
34+
}
35+
}
36+
if ((WaveGetLaneIndex() >= 38)) {
37+
result = (result + WaveActiveSum(4));
38+
uint _participantCount = WaveActiveSum(1);
39+
bool _isCorrect = (_participantCount == 0);
40+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
41+
}
42+
}
43+
}
44+
45+
#--- pipeline.yaml
46+
---
47+
Shaders:
48+
- Stage: Compute
49+
Entry: main
50+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
51+
Buffers:
52+
- Name: _participant_check_sum
53+
Format: UInt32
54+
Stride: 4
55+
Fill: 0
56+
Size: 64
57+
- Name: expected_participants
58+
Format: UInt32
59+
Stride: 4
60+
Data: [0, 0, 0, 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
61+
Results:
62+
- Result: WaveOpValidation
63+
Rule: BufferExact
64+
Actual: _participant_check_sum
65+
Expected: expected_participants
66+
DescriptorSets:
67+
- Resources:
68+
- Name: _participant_check_sum
69+
Kind: RWStructuredBuffer
70+
DirectXBinding:
71+
Register: 1
72+
Space: 0
73+
VulkanBinding:
74+
Binding: 1
75+
...
76+
#--- end
77+
78+
# RUN: split-file %s %t
79+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
80+
# RUN: %offloader %t/pipeline.yaml %t.o
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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+
uint counter0 = 0;
9+
while ((counter0 < 3)) {
10+
counter0 = (counter0 + 1);
11+
if (((((WaveGetLaneIndex() == 1) || (WaveGetLaneIndex() == 21)) || (WaveGetLaneIndex() == 38)) || (WaveGetLaneIndex() == 63))) {
12+
result = (result + WaveActiveSum(result));
13+
uint _participantCount = WaveActiveSum(1);
14+
bool _isCorrect = (_participantCount == 4);
15+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
16+
}
17+
uint counter1 = 0;
18+
while ((counter1 < 2)) {
19+
counter1 = (counter1 + 1);
20+
if (((WaveGetLaneIndex() < 1) || (WaveGetLaneIndex() >= 56))) {
21+
result = (result + WaveActiveSum(result));
22+
uint _participantCount = WaveActiveSum(1);
23+
bool _isCorrect = (_participantCount == 9);
24+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
25+
}
26+
if (((WaveGetLaneIndex() < 7) || (WaveGetLaneIndex() >= 47))) {
27+
result = (result + WaveActiveSum(WaveGetLaneIndex()));
28+
uint _participantCount = WaveActiveSum(1);
29+
bool _isCorrect = (_participantCount == 24);
30+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
31+
}
32+
}
33+
if (((((WaveGetLaneIndex() == 5) || (WaveGetLaneIndex() == 29)) || (WaveGetLaneIndex() == 32)) || (WaveGetLaneIndex() == 63))) {
34+
result = (result + WaveActiveSum((WaveGetLaneIndex() + 4)));
35+
uint _participantCount = WaveActiveSum(1);
36+
bool _isCorrect = (_participantCount == 4);
37+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
38+
}
39+
}
40+
}
41+
42+
#--- pipeline.yaml
43+
---
44+
Shaders:
45+
- Stage: Compute
46+
Entry: main
47+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
48+
Buffers:
49+
- Name: _participant_check_sum
50+
Format: UInt32
51+
Stride: 4
52+
Fill: 0
53+
Size: 64
54+
- Name: expected_participants
55+
Format: UInt32
56+
Stride: 4
57+
Data: [12, 9, 6, 6, 6, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 18]
58+
Results:
59+
- Result: WaveOpValidation
60+
Rule: BufferExact
61+
Actual: _participant_check_sum
62+
Expected: expected_participants
63+
DescriptorSets:
64+
- Resources:
65+
- Name: _participant_check_sum
66+
Kind: RWStructuredBuffer
67+
DirectXBinding:
68+
Register: 1
69+
Space: 0
70+
VulkanBinding:
71+
Binding: 1
72+
...
73+
#--- end
74+
75+
# RUN: split-file %s %t
76+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
77+
# RUN: %offloader %t/pipeline.yaml %t.o
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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() == 30) || (WaveGetLaneIndex() == 38))) {
9+
uint counter0 = 0;
10+
while ((counter0 < 2)) {
11+
counter0 = (counter0 + 1);
12+
if ((WaveGetLaneIndex() == 35)) {
13+
for (uint i1 = 0; (i1 < 3); i1 = (i1 + 1)) {
14+
if (((WaveGetLaneIndex() & 1) == 0)) {
15+
result = (result + WaveActiveMax(result));
16+
uint _participantCount = WaveActiveSum(1);
17+
bool _isCorrect = (_participantCount == 0);
18+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
19+
}
20+
}
21+
if ((WaveGetLaneIndex() == 5)) {
22+
result = (result + WaveActiveMin(result));
23+
uint _participantCount = WaveActiveSum(1);
24+
bool _isCorrect = (_participantCount == 0);
25+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
26+
}
27+
}
28+
if ((WaveGetLaneIndex() >= 50)) {
29+
result = (result + WaveActiveSum((WaveGetLaneIndex() + 4)));
30+
uint _participantCount = WaveActiveSum(1);
31+
bool _isCorrect = (_participantCount == 0);
32+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
33+
}
34+
}
35+
if (((WaveGetLaneIndex() == 12) || (WaveGetLaneIndex() == 49))) {
36+
result = (result + WaveActiveMin((WaveGetLaneIndex() + 2)));
37+
uint _participantCount = WaveActiveSum(1);
38+
bool _isCorrect = (_participantCount == 0);
39+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
40+
}
41+
}
42+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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() & 1) == 1)) {
9+
if (((WaveGetLaneIndex() & 1) == 0)) {
10+
result = (result + WaveActiveMin(result));
11+
uint _participantCount = WaveActiveSum(1);
12+
bool _isCorrect = (_participantCount == 0);
13+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
14+
}
15+
uint counter0 = 0;
16+
while ((counter0 < 2)) {
17+
counter0 = (counter0 + 1);
18+
if (((WaveGetLaneIndex() & 1) == 1)) {
19+
result = (result + WaveActiveMin(WaveGetLaneIndex()));
20+
uint _participantCount = WaveActiveSum(1);
21+
bool _isCorrect = (_participantCount == 32);
22+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
23+
}
24+
uint counter1 = 0;
25+
while ((counter1 < 3)) {
26+
counter1 = (counter1 + 1);
27+
if ((WaveGetLaneIndex() == 15)) {
28+
result = (result + WaveActiveSum(WaveGetLaneIndex()));
29+
uint _participantCount = WaveActiveSum(1);
30+
bool _isCorrect = (_participantCount == 1);
31+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
32+
}
33+
}
34+
if (((WaveGetLaneIndex() & 1) == 0)) {
35+
result = (result + WaveActiveMax(result));
36+
uint _participantCount = WaveActiveSum(1);
37+
bool _isCorrect = (_participantCount == 0);
38+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
39+
}
40+
if ((counter0 == 1)) {
41+
break;
42+
}
43+
}
44+
if (((WaveGetLaneIndex() & 1) == 0)) {
45+
result = (result + WaveActiveSum(result));
46+
uint _participantCount = WaveActiveSum(1);
47+
bool _isCorrect = (_participantCount == 0);
48+
_participant_check_sum[tid.x] = (_participant_check_sum[tid.x] + (_isCorrect ? 1 : 0));
49+
}
50+
}
51+
}
52+
53+
#--- pipeline.yaml
54+
---
55+
Shaders:
56+
- Stage: Compute
57+
Entry: main
58+
DispatchSize: [1, 1, 1] # Single dispatch for 64 threads
59+
Buffers:
60+
- Name: _participant_check_sum
61+
Format: UInt32
62+
Stride: 4
63+
Fill: 0
64+
Size: 64
65+
- Name: expected_participants
66+
Format: UInt32
67+
Stride: 4
68+
Data: [0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 8, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2]
69+
Results:
70+
- Result: WaveOpValidation
71+
Rule: BufferExact
72+
Actual: _participant_check_sum
73+
Expected: expected_participants
74+
DescriptorSets:
75+
- Resources:
76+
- Name: _participant_check_sum
77+
Kind: RWStructuredBuffer
78+
DirectXBinding:
79+
Register: 1
80+
Space: 0
81+
VulkanBinding:
82+
Binding: 1
83+
...
84+
#--- end
85+
86+
# RUN: split-file %s %t
87+
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
88+
# RUN: %offloader %t/pipeline.yaml %t.o

0 commit comments

Comments
 (0)