forked from llvm/offload-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaveActiveBallot.Wave32.test
More file actions
56 lines (49 loc) · 1.22 KB
/
WaveActiveBallot.Wave32.test
File metadata and controls
56 lines (49 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#--- source.hlsl
RWStructuredBuffer<uint4> Out : register(u1);
[WaveSize(32)]
[numthreads(32, 1, 1)]
void main(uint3 threadID : SV_DispatchThreadID) {
// We expect the first resulting uint's bitmask to be
// 0xBFFFFFFF
Out[0] = WaveActiveBallot(threadID.x != 30);
// We expect the first resulting uint's bitmask to be
// 0x0000FFFF
Out[1] = WaveActiveBallot(threadID.x < 16);
// We expect the resulting uint4 to be 4 0x00000000's
Out[2] = WaveActiveBallot(false);
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: Out
Format: UInt32
Stride: 16
FillSize: 48
- Name: ExpectedOut
Format: UInt32
Stride: 16
Data: [3221225471, 0, 0, 0, 65535, 0, 0, 0, 0, 0, 0, 0]
Results:
- Result: Test
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
DescriptorSets:
- Resources:
- Name: Out
Kind: RWStructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
...
#--- end
# REQUIRES: WaveSize_32
# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_6 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o