@@ -1149,18 +1149,9 @@ There are also common utilities when targeting SPIR-V from any dialect:
1149
1149
1150
1150
These common utilities are implemented in the ` MLIRSPIRVTransforms ` library.
1151
1151
1152
- ## Contribution
1153
-
1154
- All kinds of contributions are highly appreciated! :) We have GitHub issues for
1155
- tracking the [ dialect] [ GitHubDialectTracking ] and
1156
- [ lowering] [ GitHubLoweringTracking ] development. You can find todo tasks there.
1157
- The [ Code organization] ( #code-organization ) section gives an overview of how
1158
- SPIR-V related functionalities are implemented in MLIR. This section gives more
1159
- concrete steps on how to contribute.
1160
-
1161
1152
## Rationale
1162
1153
1163
- ## Lowering ` memref ` s to ` !spv.array<..> ` and ` !spv.rtarray<..> ` .
1154
+ ### Lowering ` memref ` s to ` !spv.array<..> ` and ` !spv.rtarray<..> ` .
1164
1155
1165
1156
The LLVM dialect lowers ` memref ` types to a ` MemrefDescriptor ` :
1166
1157
@@ -1183,14 +1174,14 @@ is lowered directly to a `!spv.ptr<!spv.array<nelts x elem_type>>` when the
1183
1174
below.
1184
1175
1185
1176
1 . Inputs/output buffers to a SPIR-V kernel are specified using
1186
- [ ` OpVariable ` ] [ SpirvOpVariable ] inside
1187
- [ interface storage classes] [ VulkanShaderInterfaceStorageClass ] (e.g.,
1188
- Uniform, StorageBuffer, etc.), while kernel private variables reside in
1189
- non-interface storage classes (e.g., Function, Workgroup, etc.). By default,
1190
- Vulkan-flavored SPIR-V requires logical addressing mode: one cannot
1191
- load/store pointers from/to variables and cannot perform pointer arithmetic.
1192
- Expressing a struct like ` MemrefDescriptor ` in interface storage class
1193
- requires special addressing mode
1177
+ [ ` OpVariable ` ] [ SpirvOpVariable ] inside [ interface storage
1178
+ classes] [ VulkanShaderInterfaceStorageClass ] (e.g., Uniform, StorageBuffer ,
1179
+ etc.), while kernel private variables reside in non-interface storage
1180
+ classes (e.g., Function, Workgroup, etc.). By default, Vulkan-flavored
1181
+ SPIR-V requires logical addressing mode: one cannot load/store pointers
1182
+ from/to variables and cannot perform pointer arithmetic. Expressing a
1183
+ struct like ` MemrefDescriptor ` in interface storage class requires special
1184
+ addressing mode
1194
1185
([ PhysicalStorageBuffer] [ VulkanExtensionPhysicalStorageBuffer ] ) and
1195
1186
manipulating such a struct in non-interface storage classes requires special
1196
1187
capabilities ([ VariablePointers] [ VulkanExtensionVariablePointers ] ).
@@ -1209,10 +1200,10 @@ below.
1209
1200
further advantages:
1210
1201
1211
1202
* All the dynamic shape/stride information of the ` memref ` can be combined
1212
- into a single descriptor. Descriptors are
1213
- [ limited resources on many Vulkan hardware] [ VulkanGPUInfoMaxPerStageDescriptorStorageBuffers ] .
1214
- So combining them would help make the generated code more portable
1215
- across devices.
1203
+ into a single descriptor. Descriptors are [ limited resources on many
1204
+ Vulkan hardware] [ VulkanGPUInfoMaxPerStageDescriptorStorageBuffers ] . So
1205
+ combining them would help make the generated code more portable across
1206
+ devices.
1216
1207
* If the shape/stride information is small enough, they could be accessed
1217
1208
using [ PushConstants] [ VulkanPushConstants ] that are faster to access and
1218
1209
avoid buffer allocation overheads. These would be unnecessary if all
@@ -1223,6 +1214,15 @@ below.
1223
1214
frequently than the data stored in the buffers. They could be part of
1224
1215
different descriptor sets.
1225
1216
1217
+ ## Contribution
1218
+
1219
+ All kinds of contributions are highly appreciated! :) We have GitHub issues for
1220
+ tracking the [ dialect] [ GitHubDialectTracking ] and
1221
+ [ lowering] [ GitHubLoweringTracking ] development. You can find todo tasks there.
1222
+ The [ Code organization] ( #code-organization ) section gives an overview of how
1223
+ SPIR-V related functionalities are implemented in MLIR. This section gives more
1224
+ concrete steps on how to contribute.
1225
+
1226
1226
### Automated development flow
1227
1227
1228
1228
One of the goals of SPIR-V dialect development is to leverage both the SPIR-V
0 commit comments