Skip to content

Commit 48e78ed

Browse files
MaheshRavishankarmemfrob
authored andcommitted
[mlir][SPIR-V] Fix wrongly placed Rationale section.
Differential Revision: https://reviews.llvm.org/D85461
1 parent c309e16 commit 48e78ed

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

mlir/docs/Dialects/SPIR-V.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,18 +1149,9 @@ There are also common utilities when targeting SPIR-V from any dialect:
11491149

11501150
These common utilities are implemented in the `MLIRSPIRVTransforms` library.
11511151

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-
11611152
## Rationale
11621153

1163-
## Lowering `memref`s to `!spv.array<..>` and `!spv.rtarray<..>`.
1154+
### Lowering `memref`s to `!spv.array<..>` and `!spv.rtarray<..>`.
11641155

11651156
The LLVM dialect lowers `memref` types to a `MemrefDescriptor`:
11661157

@@ -1183,14 +1174,14 @@ is lowered directly to a `!spv.ptr<!spv.array<nelts x elem_type>>` when the
11831174
below.
11841175

11851176
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
11941185
([PhysicalStorageBuffer][VulkanExtensionPhysicalStorageBuffer]) and
11951186
manipulating such a struct in non-interface storage classes requires special
11961187
capabilities ([VariablePointers][VulkanExtensionVariablePointers]).
@@ -1209,10 +1200,10 @@ below.
12091200
further advantages:
12101201

12111202
* 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.
12161207
* If the shape/stride information is small enough, they could be accessed
12171208
using [PushConstants][VulkanPushConstants] that are faster to access and
12181209
avoid buffer allocation overheads. These would be unnecessary if all
@@ -1223,6 +1214,15 @@ below.
12231214
frequently than the data stored in the buffers. They could be part of
12241215
different descriptor sets.
12251216

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+
12261226
### Automated development flow
12271227

12281228
One of the goals of SPIR-V dialect development is to leverage both the SPIR-V

0 commit comments

Comments
 (0)