forked from llvm/offload-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrow_major_matrix_subscript.f32.test
More file actions
194 lines (182 loc) · 4.43 KB
/
Copy pathrow_major_matrix_subscript.f32.test
File metadata and controls
194 lines (182 loc) · 4.43 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#--- source.hlsl
RWStructuredBuffer<float> Out_f4x1 : register(u4);
RWStructuredBuffer<float> Out_f4x2 : register(u5);
RWStructuredBuffer<float> Out_f2x3 : register(u6);
RWStructuredBuffer<float> Out_f2x4 : register(u7);
cbuffer example_f4x1 : register(b0) {
row_major float4x1 M_f4x1;
};
cbuffer example_f4x2 : register(b1) {
row_major float4x2 M_f4x2;
};
cbuffer example_f3x2 : register(b2) {
row_major float2x3 M_f2x3;
};
cbuffer example_f2x4 : register(b3) {
row_major float2x4 M_f2x4;
};
[numthreads(1,1,1)]
void main() {
// float4x1
Out_f4x1[0] = M_f4x1[0][0];
Out_f4x1[1] = M_f4x1[1][0];
Out_f4x1[2] = M_f4x1[2][0];
Out_f4x1[3] = M_f4x1[3][0];
// float4x2
Out_f4x2[0] = M_f4x2[0][0];
Out_f4x2[1] = M_f4x2[1][0];
Out_f4x2[2] = M_f4x2[2][0];
Out_f4x2[3] = M_f4x2[3][0];
Out_f4x2[4] = M_f4x2[0][1];
Out_f4x2[5] = M_f4x2[1][1];
Out_f4x2[6] = M_f4x2[2][1];
Out_f4x2[7] = M_f4x2[3][1];
// float2x3
Out_f2x3[0] = M_f2x3[0][0];
Out_f2x3[1] = M_f2x3[1][0];
Out_f2x3[2] = M_f2x3[0][1];
Out_f2x3[3] = M_f2x3[1][1];
Out_f2x3[4] = M_f2x3[0][2];
Out_f2x3[5] = M_f2x3[1][2];
// float2x4
Out_f2x4[0] = M_f2x4[0][0];
Out_f2x4[1] = M_f2x4[1][0];
Out_f2x4[2] = M_f2x4[0][1];
Out_f2x4[3] = M_f2x4[1][1];
Out_f2x4[4] = M_f2x4[0][2];
Out_f2x4[5] = M_f2x4[1][2];
Out_f2x4[6] = M_f2x4[0][3];
Out_f2x4[7] = M_f2x4[1][3];
}
#--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
Buffers:
- Name: cbuffer_f4x1
Format: Float32
Data: [ 1.1, 0x5a5a5a5a, 0x5a5a5a5a, 0x5a5a5a5a,
2.2, 0x5a5a5a5a, 0x5a5a5a5a, 0x5a5a5a5a,
3.3, 0x5a5a5a5a, 0x5a5a5a5a, 0x5a5a5a5a,
4.4 ]
- Name: cbuffer_f2x4
Format: Float32
Data: [ 1.1, 5.5, 0x5a5a5a5a, 0x5a5a5a5a,
2.2, 6.6, 0x5a5a5a5a, 0x5a5a5a5a,
3.3, 7.7, 0x5a5a5a5a, 0x5a5a5a5a,
4.4, 8.8 ]
- Name: cbuffer_f3x2
Format: Float32
Data: [ 1.1, 3.3, 5.5, 0x5a5a5a5a,
2.2, 4.4, 6.6, 0x5a5a5a5a ]
- Name: cbuffer_f4x2
Format: Float32
Data: [ 1.1, 2.2, 3.3, 4.4,
5.5, 6.6, 7.7, 8.8 ]
- Name: Out_f4x1
Format: Float32
Stride: 4
FillSize: 16
- Name: Out_f4x2
Format: Float32
Stride: 4
FillSize: 32
- Name: Out_f2x3
Format: Float32
Stride: 4
FillSize: 24
- Name: Out_f2x4
Format: Float32
Stride: 4
FillSize: 32
- Name: ExpectedOut_f4x1
Format: Float32
Data: [ 1.1, 2.2, 3.3, 4.4 ]
- Name: ExpectedOut_f4x2
Format: Float32
Data: [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 ]
- Name: ExpectedOut_f2x3
Format: Float32
Data: [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ]
- Name: ExpectedOut_f2x4
Format: Float32
Data: [ 1.1, 5.5, 2.2, 6.6, 3.3, 7.7, 4.4, 8.8 ]
Results:
- Result: Out_f4x1
Rule: BufferExact
Actual: Out_f4x1
Expected: ExpectedOut_f4x1
- Result: Out_f4x2
Rule: BufferExact
Actual: Out_f4x2
Expected: ExpectedOut_f4x2
- Result: Out_f2x3
Rule: BufferExact
Actual: Out_f2x3
Expected: ExpectedOut_f2x3
- Result: Out_f2x4
Rule: BufferExact
Actual: Out_f2x4
Expected: ExpectedOut_f2x4
DescriptorSets:
- Resources:
- Name: cbuffer_f4x1
Kind: ConstantBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: cbuffer_f2x4
Kind: ConstantBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
- Name: cbuffer_f3x2
Kind: ConstantBuffer
DirectXBinding:
Register: 2
Space: 0
VulkanBinding:
Binding: 2
- Name: cbuffer_f4x2
Kind: ConstantBuffer
DirectXBinding:
Register: 3
Space: 0
VulkanBinding:
Binding: 3
- Name: Out_f4x1
Kind: RWStructuredBuffer
DirectXBinding:
Register: 4
Space: 0
VulkanBinding:
Binding: 4
- Name: Out_f4x2
Kind: RWStructuredBuffer
DirectXBinding:
Register: 5
Space: 0
VulkanBinding:
Binding: 5
- Name: Out_f2x3
Kind: RWStructuredBuffer
DirectXBinding:
Register: 6
Space: 0
VulkanBinding:
Binding: 6
- Name: Out_f2x4
Kind: RWStructuredBuffer
DirectXBinding:
Register: 7
Space: 0
VulkanBinding:
Binding: 7
# RUN: split-file %s %t
# RUN: %dxc_target -fvk-use-dx-layout -T cs_6_0 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o