GL_NV_integer_cooperative_matrix support
This commit is contained in:
418
Test/baseResults/spv.intcoopmat.comp.out
Normal file
418
Test/baseResults/spv.intcoopmat.comp.out
Normal file
@@ -0,0 +1,418 @@
|
||||
spv.intcoopmat.comp
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 262
|
||||
|
||||
Capability Shader
|
||||
Capability Float16
|
||||
Capability Int8
|
||||
Capability StorageBuffer8BitAccess
|
||||
Capability VulkanMemoryModelKHR
|
||||
Capability PhysicalStorageBufferAddressesEXT
|
||||
Capability CooperativeMatrixNV
|
||||
Extension "SPV_EXT_physical_storage_buffer"
|
||||
Extension "SPV_KHR_8bit_storage"
|
||||
Extension "SPV_KHR_storage_buffer_storage_class"
|
||||
Extension "SPV_KHR_vulkan_memory_model"
|
||||
Extension "SPV_NV_cooperative_matrix"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel PhysicalStorageBuffer64EXT VulkanKHR
|
||||
EntryPoint GLCompute 4 "main"
|
||||
ExecutionMode 4 LocalSize 64 1 1
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_buffer_reference"
|
||||
SourceExtension "GL_EXT_shader_explicit_arithmetic_types"
|
||||
SourceExtension "GL_KHR_memory_scope_semantics"
|
||||
SourceExtension "GL_NV_cooperative_matrix"
|
||||
SourceExtension "GL_NV_integer_cooperative_matrix"
|
||||
Name 4 "main"
|
||||
Name 14 "ineg(i81;"
|
||||
Name 13 "m"
|
||||
Name 21 "umul(u81;"
|
||||
Name 20 "m"
|
||||
Name 35 "mu"
|
||||
Name 39 "mi"
|
||||
Name 55 "mf16_0"
|
||||
Name 61 "mf32_0"
|
||||
Name 64 "mf16_1"
|
||||
Name 67 "mf32_1"
|
||||
Name 71 "x"
|
||||
Name 81 "tempArg"
|
||||
Name 85 "Block"
|
||||
MemberName 85(Block) 0 "y"
|
||||
MemberName 85(Block) 1 "x"
|
||||
Name 87 "block"
|
||||
Name 98 "tempArg"
|
||||
Name 103 "Block16"
|
||||
MemberName 103(Block16) 0 "y"
|
||||
MemberName 103(Block16) 1 "x"
|
||||
MemberName 103(Block16) 2 "b"
|
||||
Name 106 "Block"
|
||||
MemberName 106(Block) 0 "y"
|
||||
MemberName 106(Block) 1 "x"
|
||||
Name 108 "block8"
|
||||
Name 115 "tempArg"
|
||||
Name 128 "D"
|
||||
Name 129 "A"
|
||||
Name 131 "B"
|
||||
Name 133 "C"
|
||||
Name 137 "l"
|
||||
Name 142 "a"
|
||||
Name 146 "md1"
|
||||
Name 156 "Y"
|
||||
Name 157 "Z"
|
||||
Name 161 "muC2"
|
||||
Name 169 "miC2"
|
||||
Name 176 "tempArg"
|
||||
Name 182 "tempArg"
|
||||
Name 188 "p1"
|
||||
Name 189 "param"
|
||||
Name 192 "p2"
|
||||
Name 193 "param"
|
||||
Name 207 "tempArg"
|
||||
Name 212 "shmatrix"
|
||||
Name 217 "ms"
|
||||
Name 225 "miC"
|
||||
Name 226 "muC"
|
||||
Name 231 "iarr"
|
||||
Name 236 "iarr2"
|
||||
Name 241 "uarr"
|
||||
Name 246 "uarr2"
|
||||
Name 251 "S"
|
||||
MemberName 251(S) 0 "a"
|
||||
MemberName 251(S) 1 "b"
|
||||
MemberName 251(S) 2 "c"
|
||||
Name 256 "SC"
|
||||
Name 261 "scm"
|
||||
Decorate 83 ArrayStride 4
|
||||
Decorate 84 ArrayStride 4
|
||||
MemberDecorate 85(Block) 0 Offset 0
|
||||
MemberDecorate 85(Block) 1 Offset 4194304
|
||||
Decorate 85(Block) Block
|
||||
Decorate 87(block) DescriptorSet 0
|
||||
Decorate 87(block) Binding 0
|
||||
Decorate 99 ArrayStride 1
|
||||
Decorate 101 ArrayStride 1
|
||||
MemberDecorate 103(Block16) 0 Offset 0
|
||||
MemberDecorate 103(Block16) 1 Offset 1048576
|
||||
MemberDecorate 103(Block16) 2 Offset 1048584
|
||||
Decorate 103(Block16) Block
|
||||
Decorate 104 ArrayStride 4
|
||||
Decorate 105 ArrayStride 4
|
||||
MemberDecorate 106(Block) 0 Offset 0
|
||||
MemberDecorate 106(Block) 1 Offset 4194304
|
||||
Decorate 106(Block) Block
|
||||
Decorate 108(block8) DescriptorSet 0
|
||||
Decorate 108(block8) Binding 0
|
||||
Decorate 156(Y) SpecId 0
|
||||
Decorate 223 BuiltIn WorkgroupSize
|
||||
Decorate 256(SC) SpecId 2
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 8 1
|
||||
7: TypeInt 32 0
|
||||
8: 7(int) Constant 3
|
||||
9: 7(int) Constant 8
|
||||
10: TypeCooperativeMatrixNV 6(int8_t) 8 9 9
|
||||
11: TypePointer Function 10
|
||||
12: TypeFunction 10 11(ptr)
|
||||
16: TypeInt 8 0
|
||||
17: TypeCooperativeMatrixNV 16(int8_t) 8 9 9
|
||||
18: TypePointer Function 17
|
||||
19: TypeFunction 17 18(ptr)
|
||||
28: 16(int8_t) Constant 2
|
||||
32: 7(int) Constant 16
|
||||
33: TypeCooperativeMatrixNV 16(int8_t) 8 32 9
|
||||
34: TypePointer Function 33
|
||||
36: 33 ConstantComposite 28
|
||||
37: TypeCooperativeMatrixNV 6(int8_t) 8 32 9
|
||||
38: TypePointer Function 37
|
||||
40: 6(int8_t) Constant 2
|
||||
41: 37 ConstantComposite 40
|
||||
52: TypeFloat 16
|
||||
53: TypeCooperativeMatrixNV 52(float16_t) 8 32 9
|
||||
54: TypePointer Function 53
|
||||
58: TypeFloat 32
|
||||
59: TypeCooperativeMatrixNV 58(float) 8 32 9
|
||||
60: TypePointer Function 59
|
||||
70: TypePointer Function 16(int8_t)
|
||||
72: TypeInt 32 1
|
||||
73: 72(int) Constant 1
|
||||
76: 72(int) Constant 0
|
||||
79: TypePointer Function 6(int8_t)
|
||||
82: 7(int) Constant 1048576
|
||||
83: TypeArray 7(int) 82
|
||||
84: TypeRuntimeArray 7(int)
|
||||
85(Block): TypeStruct 83 84
|
||||
86: TypePointer StorageBuffer 85(Block)
|
||||
87(block): 86(ptr) Variable StorageBuffer
|
||||
88: 7(int) Constant 5
|
||||
89: TypePointer StorageBuffer 7(int)
|
||||
91: 7(int) Constant 128
|
||||
92: TypeBool
|
||||
93: 92(bool) ConstantFalse
|
||||
99: TypeArray 6(int8_t) 82
|
||||
100: 7(int) Constant 1
|
||||
101: TypeArray 6(int8_t) 100
|
||||
TypeForwardPointer 102 PhysicalStorageBufferEXT
|
||||
103(Block16): TypeStruct 99 101 102
|
||||
104: TypeArray 7(int) 82
|
||||
105: TypeRuntimeArray 7(int)
|
||||
106(Block): TypeStruct 104 105
|
||||
102: TypePointer PhysicalStorageBufferEXT 106(Block)
|
||||
107: TypePointer StorageBuffer 103(Block16)
|
||||
108(block8): 107(ptr) Variable StorageBuffer
|
||||
109: TypePointer StorageBuffer 6(int8_t)
|
||||
116: 72(int) Constant 2
|
||||
117: TypePointer StorageBuffer 102(ptr)
|
||||
120: TypePointer PhysicalStorageBufferEXT 7(int)
|
||||
136: TypePointer Function 72(int)
|
||||
138: 7(int) SpecConstantOp 5362 33
|
||||
139: 72(int) SpecConstantOp 128 138 76
|
||||
140: TypeArray 37 88
|
||||
141: TypePointer Function 140
|
||||
143: 72(int) Constant 3
|
||||
144: 6(int8_t) Constant 1
|
||||
150: 72(int) Constant 1234
|
||||
155: 72(int) Constant 8
|
||||
156(Y): 72(int) SpecConstant 2
|
||||
157(Z): 72(int) SpecConstantOp 132 155 156(Y)
|
||||
158: TypeCooperativeMatrixNV 16(int8_t) 8 157(Z) 9
|
||||
159: TypeArray 158 8
|
||||
160: TypePointer Private 159
|
||||
161(muC2): 160(ptr) Variable Private
|
||||
162: TypePointer Private 158
|
||||
166: TypeCooperativeMatrixNV 6(int8_t) 8 157(Z) 9
|
||||
167: TypeArray 166 8
|
||||
168: TypePointer Private 167
|
||||
169(miC2): 168(ptr) Variable Private
|
||||
170: TypePointer Private 6(int8_t)
|
||||
174: TypePointer Private 16(int8_t)
|
||||
204: 16(int8_t) Constant 4
|
||||
208: TypeVector 7(int) 4
|
||||
209: 7(int) Constant 32
|
||||
210: TypeArray 208(ivec4) 209
|
||||
211: TypePointer Workgroup 210
|
||||
212(shmatrix): 211(ptr) Variable Workgroup
|
||||
213: 7(int) Constant 2
|
||||
214: TypePointer Workgroup 208(ivec4)
|
||||
221: TypeVector 7(int) 3
|
||||
222: 7(int) Constant 64
|
||||
223: 221(ivec3) ConstantComposite 222 100 100
|
||||
224: TypePointer Private 166
|
||||
225(miC): 224(ptr) Variable Private
|
||||
226(muC): 162(ptr) Variable Private
|
||||
227: 7(int) SpecConstantOp 5362 166
|
||||
228: 72(int) SpecConstantOp 128 227 76
|
||||
229: TypeArray 72(int) 228
|
||||
230: TypePointer Private 229
|
||||
231(iarr): 230(ptr) Variable Private
|
||||
232: 7(int) SpecConstantOp 5362 166
|
||||
233: 72(int) SpecConstantOp 128 232 76
|
||||
234: TypeArray 72(int) 233
|
||||
235: TypePointer Private 234
|
||||
236(iarr2): 235(ptr) Variable Private
|
||||
237: 7(int) SpecConstantOp 5362 158
|
||||
238: 72(int) SpecConstantOp 128 237 76
|
||||
239: TypeArray 72(int) 238
|
||||
240: TypePointer Private 239
|
||||
241(uarr): 240(ptr) Variable Private
|
||||
242: 7(int) SpecConstantOp 5362 158
|
||||
243: 72(int) SpecConstantOp 128 242 76
|
||||
244: TypeArray 72(int) 243
|
||||
245: TypePointer Private 244
|
||||
246(uarr2): 245(ptr) Variable Private
|
||||
247: TypeCooperativeMatrixNV 72(int) 8 157(Z) 9
|
||||
248: 247 ConstantComposite 73
|
||||
249: 16(int8_t) Constant 1
|
||||
250: 17 ConstantComposite 249
|
||||
251(S): TypeStruct 72(int) 72(int) 72(int)
|
||||
252: 72(int) Constant 12
|
||||
253: 72(int) Constant 23
|
||||
254: 72(int) Constant 34
|
||||
255: 251(S) ConstantComposite 252 253 254
|
||||
256(SC): 72(int) SpecConstant 1
|
||||
257: TypeCooperativeMatrixNV 7(int) 8 256(SC) 256(SC)
|
||||
258: TypeArray 257 256(SC)
|
||||
259: TypeArray 258 256(SC)
|
||||
260: TypePointer Private 259
|
||||
261(scm): 260(ptr) Variable Private
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
35(mu): 34(ptr) Variable Function
|
||||
39(mi): 38(ptr) Variable Function
|
||||
55(mf16_0): 54(ptr) Variable Function
|
||||
61(mf32_0): 60(ptr) Variable Function
|
||||
64(mf16_1): 54(ptr) Variable Function
|
||||
67(mf32_1): 60(ptr) Variable Function
|
||||
71(x): 70(ptr) Variable Function
|
||||
81(tempArg): 38(ptr) Variable Function
|
||||
98(tempArg): 34(ptr) Variable Function
|
||||
115(tempArg): 38(ptr) Variable Function
|
||||
128(D): 34(ptr) Variable Function
|
||||
129(A): 34(ptr) Variable Function
|
||||
131(B): 18(ptr) Variable Function
|
||||
133(C): 34(ptr) Variable Function
|
||||
137(l): 136(ptr) Variable Function
|
||||
142(a): 141(ptr) Variable Function
|
||||
146(md1): 136(ptr) Variable Function
|
||||
176(tempArg): 38(ptr) Variable Function
|
||||
182(tempArg): 34(ptr) Variable Function
|
||||
188(p1): 11(ptr) Variable Function
|
||||
189(param): 11(ptr) Variable Function
|
||||
192(p2): 18(ptr) Variable Function
|
||||
193(param): 18(ptr) Variable Function
|
||||
207(tempArg): 38(ptr) Variable Function
|
||||
217(ms): 38(ptr) Variable Function
|
||||
Store 35(mu) 36
|
||||
Store 39(mi) 41
|
||||
42: 33 Load 35(mu)
|
||||
43: 33 Load 35(mu)
|
||||
44: 33 IAdd 42 43
|
||||
Store 35(mu) 44
|
||||
45: 33 Load 35(mu)
|
||||
46: 33 Load 35(mu)
|
||||
47: 33 ISub 45 46
|
||||
Store 35(mu) 47
|
||||
48: 37 Load 39(mi)
|
||||
49: 37 SNegate 48
|
||||
Store 39(mi) 49
|
||||
50: 37 Load 39(mi)
|
||||
51: 37 MatrixTimesScalar 50 40
|
||||
Store 39(mi) 51
|
||||
56: 33 Load 35(mu)
|
||||
57: 53 ConvertUToF 56
|
||||
Store 55(mf16_0) 57
|
||||
62: 33 Load 35(mu)
|
||||
63: 59 ConvertUToF 62
|
||||
Store 61(mf32_0) 63
|
||||
65: 37 Load 39(mi)
|
||||
66: 53 ConvertSToF 65
|
||||
Store 64(mf16_1) 66
|
||||
68: 37 Load 39(mi)
|
||||
69: 59 ConvertSToF 68
|
||||
Store 67(mf32_1) 69
|
||||
74: 70(ptr) AccessChain 35(mu) 73
|
||||
75: 16(int8_t) Load 74
|
||||
Store 71(x) 75
|
||||
77: 16(int8_t) Load 71(x)
|
||||
78: 6(int8_t) Bitcast 77
|
||||
80: 79(ptr) AccessChain 39(mi) 76
|
||||
Store 80 78
|
||||
90: 89(ptr) AccessChain 87(block) 73 32
|
||||
94: 37 CooperativeMatrixLoadNV 90 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 81(tempArg) 94
|
||||
95: 37 Load 81(tempArg)
|
||||
Store 39(mi) 95
|
||||
96: 37 Load 39(mi)
|
||||
97: 89(ptr) AccessChain 87(block) 73 32
|
||||
CooperativeMatrixStoreNV 97 96 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
110: 109(ptr) AccessChain 108(block8) 73 32
|
||||
111: 33 CooperativeMatrixLoadNV 110 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 98(tempArg) 111
|
||||
112: 33 Load 98(tempArg)
|
||||
Store 35(mu) 112
|
||||
113: 33 Load 35(mu)
|
||||
114: 109(ptr) AccessChain 108(block8) 73 32
|
||||
CooperativeMatrixStoreNV 114 113 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
118: 117(ptr) AccessChain 108(block8) 116
|
||||
119: 102(ptr) Load 118 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
121: 120(ptr) AccessChain 119 73 32
|
||||
122: 37 CooperativeMatrixLoadNV 121 91 93 Aligned MakePointerVisibleKHR NonPrivatePointerKHR 16 88
|
||||
Store 115(tempArg) 122
|
||||
123: 37 Load 115(tempArg)
|
||||
Store 39(mi) 123
|
||||
124: 37 Load 39(mi)
|
||||
125: 117(ptr) AccessChain 108(block8) 116
|
||||
126: 102(ptr) Load 125 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
127: 120(ptr) AccessChain 126 73 32
|
||||
CooperativeMatrixStoreNV 127 124 91 93 Aligned MakePointerAvailableKHR NonPrivatePointerKHR 16 88
|
||||
130: 33 Load 129(A)
|
||||
132: 17 Load 131(B)
|
||||
134: 33 Load 133(C)
|
||||
135: 33 CooperativeMatrixMulAddNV 130 132 134
|
||||
Store 128(D) 135
|
||||
Store 137(l) 139
|
||||
145: 79(ptr) AccessChain 142(a) 143 76
|
||||
Store 145 144
|
||||
Store 146(md1) 73
|
||||
147: 37 Load 39(mi)
|
||||
148: 37 Load 39(mi)
|
||||
149: 37 IAdd 148 147
|
||||
Store 39(mi) 149
|
||||
151: 6(int8_t) CompositeExtract 149 1234
|
||||
152: 72(int) SConvert 151
|
||||
153: 72(int) Load 146(md1)
|
||||
154: 72(int) IAdd 153 152
|
||||
Store 146(md1) 154
|
||||
163: 162(ptr) AccessChain 161(muC2) 73
|
||||
164: 158 Load 163
|
||||
165: 162(ptr) AccessChain 161(muC2) 76
|
||||
Store 165 164
|
||||
171: 170(ptr) AccessChain 169(miC2) 116 76
|
||||
172: 6(int8_t) Load 171
|
||||
173: 16(int8_t) Bitcast 172
|
||||
175: 174(ptr) AccessChain 161(muC2) 73 76
|
||||
Store 175 173
|
||||
177: 89(ptr) AccessChain 87(block) 76 32
|
||||
178: 37 CooperativeMatrixLoadNV 177 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 176(tempArg) 178
|
||||
179: 37 Load 176(tempArg)
|
||||
Store 39(mi) 179
|
||||
180: 37 Load 39(mi)
|
||||
181: 89(ptr) AccessChain 87(block) 76 32
|
||||
CooperativeMatrixStoreNV 181 180 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
183: 109(ptr) AccessChain 108(block8) 76 32
|
||||
184: 33 CooperativeMatrixLoadNV 183 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 182(tempArg) 184
|
||||
185: 33 Load 182(tempArg)
|
||||
Store 35(mu) 185
|
||||
186: 33 Load 35(mu)
|
||||
187: 109(ptr) AccessChain 108(block8) 76 32
|
||||
CooperativeMatrixStoreNV 187 186 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
190: 10 Load 188(p1)
|
||||
Store 189(param) 190
|
||||
191: 10 FunctionCall 14(ineg(i81;) 189(param)
|
||||
Store 188(p1) 191
|
||||
194: 17 Load 192(p2)
|
||||
Store 193(param) 194
|
||||
195: 17 FunctionCall 21(umul(u81;) 193(param)
|
||||
Store 192(p2) 195
|
||||
196: 10 Load 188(p1)
|
||||
197: 10 Load 188(p1)
|
||||
198: 10 SDiv 197 196
|
||||
Store 188(p1) 198
|
||||
199: 17 Load 192(p2)
|
||||
200: 17 Load 192(p2)
|
||||
201: 17 UDiv 200 199
|
||||
Store 192(p2) 201
|
||||
202: 10 Load 188(p1)
|
||||
203: 10 MatrixTimesScalar 202 40
|
||||
Store 188(p1) 203
|
||||
205: 17 Load 192(p2)
|
||||
206: 17 MatrixTimesScalar 205 204
|
||||
Store 192(p2) 206
|
||||
215: 214(ptr) AccessChain 212(shmatrix) 100
|
||||
216: 37 CooperativeMatrixLoadNV 215 213 93 MakePointerVisibleKHR NonPrivatePointerKHR 213
|
||||
Store 207(tempArg) 216
|
||||
218: 37 Load 207(tempArg)
|
||||
Store 217(ms) 218
|
||||
219: 37 Load 217(ms)
|
||||
220: 214(ptr) AccessChain 212(shmatrix) 100
|
||||
CooperativeMatrixStoreNV 220 219 213 93 MakePointerAvailableKHR NonPrivatePointerKHR 213
|
||||
Return
|
||||
FunctionEnd
|
||||
14(ineg(i81;): 10 Function None 12
|
||||
13(m): 11(ptr) FunctionParameter
|
||||
15: Label
|
||||
23: 10 Load 13(m)
|
||||
24: 10 SNegate 23
|
||||
ReturnValue 24
|
||||
FunctionEnd
|
||||
21(umul(u81;): 17 Function None 19
|
||||
20(m): 18(ptr) FunctionParameter
|
||||
22: Label
|
||||
27: 17 Load 20(m)
|
||||
29: 17 MatrixTimesScalar 27 28
|
||||
ReturnValue 29
|
||||
FunctionEnd
|
||||
117
Test/spv.intcoopmat.comp
Normal file
117
Test/spv.intcoopmat.comp
Normal file
@@ -0,0 +1,117 @@
|
||||
#version 450 core
|
||||
#extension GL_KHR_memory_scope_semantics : enable
|
||||
#extension GL_NV_cooperative_matrix : enable
|
||||
#extension GL_NV_integer_cooperative_matrix : enable
|
||||
#extension GL_EXT_shader_explicit_arithmetic_types : enable
|
||||
#extension GL_EXT_buffer_reference : enable
|
||||
|
||||
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
const int X = 8;
|
||||
layout(constant_id = 0) const int Y = 2;
|
||||
const int Z = X*Y;
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC;
|
||||
icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC2[3];
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC2[3];
|
||||
|
||||
int iarr[miC.length()];
|
||||
int iarr2[miC2[1].length()];
|
||||
int uarr[muC.length()];
|
||||
int uarr2[muC2[1].length()];
|
||||
|
||||
const icoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = icoopmatNV<32, gl_ScopeSubgroup, Z, 8>(1);
|
||||
const ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> mD2 = ucoopmatNV<8, gl_ScopeSubgroup, 8, 8>(1);
|
||||
|
||||
struct S { int a; int b; int c; };
|
||||
|
||||
const S s = S(12, 23, 34);
|
||||
|
||||
layout(set = 0, binding = 0, buffer_reference) coherent buffer Block {
|
||||
uint y[1024*1024];
|
||||
uint x[];
|
||||
} block;
|
||||
|
||||
layout(set = 0, binding = 0) coherent buffer Block16 {
|
||||
int8_t y[1024*1024];
|
||||
int8_t x[];
|
||||
|
||||
Block b;
|
||||
} block8;
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 8, 8> ineg(icoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return -m; }
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> umul(ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return m * uint8_t(2); }
|
||||
|
||||
layout(constant_id = 2) const int SC = 1;
|
||||
ucoopmatNV<32, gl_ScopeSubgroup, SC, SC> scm[SC][SC];
|
||||
|
||||
// sized for icoopmatNV<8, gl_ScopeSubgroup, 16, 16>
|
||||
shared uvec4 shmatrix[16*16*2/16];
|
||||
|
||||
void main()
|
||||
{
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mu = ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2);
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mi = icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2);
|
||||
|
||||
mu = mu + mu;
|
||||
mu = mu - mu;
|
||||
mi = -mi;
|
||||
mi = mi * int8_t(2);
|
||||
|
||||
fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_0 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mu);
|
||||
fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_0 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mu);
|
||||
fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_1 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mi);
|
||||
fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_1 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mi);
|
||||
|
||||
uint8_t x = mu[1];
|
||||
mi[0] = int8_t(x);
|
||||
|
||||
coopMatLoadNV(mi, block.x, 16, 128, false);
|
||||
coopMatStoreNV(mi, block.x, 16, 128, false);
|
||||
coopMatLoadNV(mu, block8.x, 16, 128, false);
|
||||
coopMatStoreNV(mu, block8.x, 16, 128, false);
|
||||
coopMatLoadNV(mi, block8.b.x, 16, 128, false);
|
||||
coopMatStoreNV(mi, block8.b.x, 16, 128, false);
|
||||
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> A;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> B;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> C;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> D;
|
||||
D = coopMatMulAddNV(A, B, C);
|
||||
|
||||
int l = D.length();
|
||||
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5];
|
||||
a[3][0] = int8_t(1);
|
||||
|
||||
int md1 = mD[1];
|
||||
|
||||
md1 += (mi += mi)[1234];
|
||||
|
||||
muC2[0] = muC2[1];
|
||||
muC2[1][0] = (miC2[2][0]);
|
||||
|
||||
coopMatLoadNV(mi, block.y, 16, 128, false);
|
||||
coopMatStoreNV(mi, block.y, 16, 128, false);
|
||||
coopMatLoadNV(mu, block8.y, 16, 128, false);
|
||||
coopMatStoreNV(mu, block8.y, 16, 128, false);
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 8, 8> p1;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> p2;
|
||||
|
||||
p1 = ineg(p1);
|
||||
p2 = umul(p2);
|
||||
|
||||
p1 /= p1;
|
||||
p2 /= p2;
|
||||
|
||||
p1 *= int8_t(2);
|
||||
p2 *= uint8_t(4);
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, 8> ms;
|
||||
coopMatLoadNV(ms, shmatrix, 1, 2, false);
|
||||
coopMatStoreNV(ms, shmatrix, 1, 2, false);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user