forked from llvm/offload-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabs.32.test
More file actions
139 lines (132 loc) · 3.16 KB
/
Copy pathabs.32.test
File metadata and controls
139 lines (132 loc) · 3.16 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#--- source.hlsl
StructuredBuffer<int4> In1 : register(t0);
StructuredBuffer<uint4> In2 : register(t1);
StructuredBuffer<float4> In3 : register(t2);
RWStructuredBuffer<int4> Out1 : register(u3);
RWStructuredBuffer<uint4> Out2 : register(u4);
RWStructuredBuffer<float4> Out3 : register(u5);
[numthreads(1,1,1)]
void main() {
// int
Out1[0] = abs(In1[0]);
int4 Tmp = {abs(In1[0].xyz), abs(In1[0].w)};
Out1[1] = Tmp;
Out1[2].xy = abs(In1[0].xy);
// uint
Out2[0] = abs(In2[0]);
uint4 Tmp2 = {abs(In2[0].xyz), abs(In2[0].w)};
Out2[1] = Tmp2;
Out2[2].xy = abs(In2[0].xy);
// float
Out3[0] = abs(In3[0]);
float4 Tmp3 = {abs(In3[1].xyz), abs(In3[1].w)};
Out3[1] = Tmp3;
float4 Tmp4 = {abs(In3[2].xy), abs(In3[2].zw)};
Out3[2] = Tmp4;
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]
Buffers:
- Name: In1
Format: Int32
Stride: 16
Data: [-1, 0, -2147483648, 2147483647]
- Name: In2
Format: UInt32
Stride: 16
Data: [1, 0xffffffff, 0, 10]
- Name: In3
Format: Float32
Stride: 16
Data: [nan, -nan, 0, -0, -1.3, inf, -inf, 0x1.e7d42cp-127, -0x1.e7d42cp-127, -0.5, -0.05, -19]
- Name: Out1
Format: Int32
Stride: 16
FillSize: 48
- Name: ExpectedOut1 # The result we expect
Format: Int32
Stride: 16
Data: [1, 0, -2147483648, 2147483647, 1, 0, -2147483648, 2147483647, 1, 0, 0, 0] # Last two are filler
- Name: Out2
Format: UInt32
Stride: 16
FillSize: 48
- Name: ExpectedOut2 # The result we expect
Format: UInt32
Stride: 16
Data: [1, 4294967295, 0, 10, 1, 4294967295, 0, 10, 1, 4294967295, 0, 0] # Last two are filler
- Name: Out3
Format: Float32
Stride: 16
FillSize: 48
- Name: ExpectedOut3 # The result we expect
Format: Float32
Stride: 16
Data: [nan, nan, 0, 0, 1.3, inf, inf, 0x1.e7d42cp-127, 0x1.e7d42cp-127, 0.5, 0.05, 19]
Results:
- Result: Test1
Rule: BufferExact
Actual: Out1
Expected: ExpectedOut1
- Result: Test2
Rule: BufferExact
Actual: Out2
Expected: ExpectedOut2
- Result: Test3
Rule: BufferFloatULP
ULPT: 0
Actual: Out3
Expected: ExpectedOut3
DescriptorSets:
- Resources:
- Name: In1
Kind: StructuredBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: In2
Kind: StructuredBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
- Name: In3
Kind: StructuredBuffer
DirectXBinding:
Register: 2
Space: 0
VulkanBinding:
Binding: 2
- Name: Out1
Kind: RWStructuredBuffer
DirectXBinding:
Register: 3
Space: 0
VulkanBinding:
Binding: 3
- Name: Out2
Kind: RWStructuredBuffer
DirectXBinding:
Register: 4
Space: 0
VulkanBinding:
Binding: 4
- Name: Out3
Kind: RWStructuredBuffer
DirectXBinding:
Register: 5
Space: 0
VulkanBinding:
Binding: 5
...
#--- end
# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o