forked from llvm/offload-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix_single_subscript_basic.test
More file actions
109 lines (101 loc) · 2.42 KB
/
Copy pathmatrix_single_subscript_basic.test
File metadata and controls
109 lines (101 loc) · 2.42 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
#--- source.hlsl
RWBuffer<int> In : register(u0);
RWBuffer<int> Index : register(u1);
RWBuffer<int> Out : register(u2);
RWBuffer<int> Out2 : register(u3);
[numthreads(1,1,1)]
void main() {
int4 A = int4(In[0], In[1], In[2], In[3]);
int4 B = int4(In[4], In[5], In[6], In[7]);
int4 C = int4(In[8], In[9], In[10], In[11]);
int4 D = int4(In[12], In[13], In[14], In[15]);
int4x4 Mat;
Mat[Index[0]] = A;
Mat[Index[1]] = B;
Mat[Index[2]] = C;
Mat[Index[3]] = D;
int4x4 Mat2;
Mat2[Index[3]] = Mat[Index[0]];
Mat2[Index[2]] = Mat[Index[1]];
Mat2[Index[1]] = Mat[Index[2]];
Mat2[Index[0]] = Mat[Index[3]];
const uint COLS = 4;
for(int i = 0; i < 16; i++) {
uint row = i / COLS;
uint col = i % COLS;
Out[i] = Mat[row][col];
Out2[i] = Mat2[row][col];
}
}
//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
Buffers:
- Name: In
Format: Int32
Data: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
- Name: Index
Format: Int32
Data: [ 2, 0, 3, 1 ]
- Name: Out
Format: Int32
FillSize: 64
- Name: ExpectedOut
Format: Int32
Data: [ 5, 6, 7, 8, 13, 14, 15, 16, 1, 2, 3, 4, 9, 10, 11, 12]
- Name: Out2
Format: Int32
FillSize: 64
- Name: ExpectedOut2
Format: Int32
Data: [ 9, 10, 11, 12, 1, 2, 3, 4, 13, 14, 15, 16, 5, 6, 7, 8]
Results:
- Result: Out
Rule: BufferExact
Actual: Out
Expected: ExpectedOut
- Result: Out2
Rule: BufferExact
Actual: Out2
Expected: ExpectedOut2
DescriptorSets:
- Resources:
- Name: In
Kind: RWBuffer
DirectXBinding:
Register: 0
Space: 0
VulkanBinding:
Binding: 0
- Name: Index
Kind: RWBuffer
DirectXBinding:
Register: 1
Space: 0
VulkanBinding:
Binding: 1
- Name: Out
Kind: RWBuffer
DirectXBinding:
Register: 2
Space: 0
VulkanBinding:
Binding: 2
- Name: Out2
Kind: RWBuffer
DirectXBinding:
Register: 3
Space: 0
VulkanBinding:
Binding: 3
...
#--- end
# Bug: https://github.com/llvm/offload-test-suite/issues/660
# XFAIL: Vulkan && Clang
# Bug: https://github.com/llvm/offload-test-suite/issues/696
# XFAIL:Intel-Gen-Current && DirectX && Clang
# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o