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.i2x3.test
More file actions
103 lines (95 loc) · 2.07 KB
/
Copy pathmatrix_single_subscript_basic.i2x3.test
File metadata and controls
103 lines (95 loc) · 2.07 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
#--- 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() {
int3 A = int3(In[0], In[1], In[2]);
int3 B = int3(In[3], In[4], In[5]);
int2x3 Mat;
Mat[Index[0]] = A;
Mat[Index[1]] = B;
int2x3 Mat2;
Mat2[Index[1]] = Mat[Index[0]];
Mat2[Index[0]] = Mat[Index[1]];
const uint COLS = 3;
for(uint i = 0; i < 6; 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]
- Name: Index
Format: Int32
Data: [ 1, 0]
- Name: Out
Format: Int32
FillSize: 24
- Name: ExpectedOut
Format: Int32
Data: [ 4, 5, 6, 1, 2, 3]
- Name: Out2
Format: Int32
FillSize: 24
- Name: ExpectedOut2
Format: Int32
Data: [ 1, 2, 3, 4, 5, 6]
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