Skip to content

Commit 15f7235

Browse files
add more test
1 parent d71fb7b commit 15f7235

File tree

660 files changed

+107759
-404
lines changed

Some content is hidden

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

660 files changed

+107759
-404
lines changed

test/WaveSize32/program_1755380594508364200_5_increment_0_WaveParticipantTracking___LanePermutation.test

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

0 commit comments

Comments
 (0)