Skip to content

Commit 8959296

Browse files
more tests
1 parent 54265ab commit 8959296

File tree

47 files changed

+6732
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

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

0 commit comments

Comments
 (0)