Skip to content

Commit d159b05

Browse files
test wave size
1 parent 1d73130 commit d159b05

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

test/WaveSize/waveSize.tst

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

0 commit comments

Comments
 (0)