-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][spirv]: Add Image to Vulkan Storage Class Map #144899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Extend the "storage class" <-> "memory space" map for the Vulkan SPIR-V environment to include the Image class. 12 is chosen as the next available value in the MemRef memory space list. Signed-off-by: Jack Frankland <[email protected]>
@llvm/pr-subscribers-mlir Author: Jack Frankland (FranklandJack) ChangesExtend the "storage class" <-> "memory space" map for the Vulkan SPIR-V environment to include the Image class. 12 is chosen as the next available value in the MemRef memory space list. Full diff: https://github.com/llvm/llvm-project/pull/144899.diff 1 Files Affected:
diff --git a/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp b/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
index 4cbc3dfdae223..1fbc5a03987e8 100644
--- a/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
+++ b/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
@@ -59,7 +59,8 @@ using namespace mlir;
MAP_FN(spirv::StorageClass::UniformConstant, 8) \
MAP_FN(spirv::StorageClass::Input, 9) \
MAP_FN(spirv::StorageClass::Output, 10) \
- MAP_FN(spirv::StorageClass::PhysicalStorageBuffer, 11)
+ MAP_FN(spirv::StorageClass::PhysicalStorageBuffer, 11) \
+ MAP_FN(spirv::StorageClass::Image, 12)
std::optional<spirv::StorageClass>
spirv::mapMemorySpaceToVulkanStorageClass(Attribute memorySpaceAttr) {
|
@llvm/pr-subscribers-mlir-spirv Author: Jack Frankland (FranklandJack) ChangesExtend the "storage class" <-> "memory space" map for the Vulkan SPIR-V environment to include the Image class. 12 is chosen as the next available value in the MemRef memory space list. Full diff: https://github.com/llvm/llvm-project/pull/144899.diff 1 Files Affected:
diff --git a/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp b/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
index 4cbc3dfdae223..1fbc5a03987e8 100644
--- a/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
+++ b/mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
@@ -59,7 +59,8 @@ using namespace mlir;
MAP_FN(spirv::StorageClass::UniformConstant, 8) \
MAP_FN(spirv::StorageClass::Input, 9) \
MAP_FN(spirv::StorageClass::Output, 10) \
- MAP_FN(spirv::StorageClass::PhysicalStorageBuffer, 11)
+ MAP_FN(spirv::StorageClass::PhysicalStorageBuffer, 11) \
+ MAP_FN(spirv::StorageClass::Image, 12)
std::optional<spirv::StorageClass>
spirv::mapMemorySpaceToVulkanStorageClass(Attribute memorySpaceAttr) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we test this?
So I did have a look at the lit tests for this pass. Seems we only test the storage classes that map from memory spaces that are common to the OpenCL and Vulkan environments. The way the lit test is defined at the moment means it needs to be run in both OpenCL and Vulkan modes which I think is going to cause the CL path to fail since the index |
Can we add a new test for vulkan only? |
Extend the "storage class" <-> "memory space" map for the Vulkan SPIR-V environment to include the Image class. 12 is chosen as the next available value in the MemRef memory space list.