[Mlir-commits] [mlir] 36ee9a3 - [mlir][GPUToVulkan] Fix signature of bindMemRef function for f16

Thomas Raoux llvmlistbot at llvm.org
Fri Aug 21 10:48:26 PDT 2020


Author: Thomas Raoux
Date: 2020-08-21T10:48:00-07:00
New Revision: 36ee9a322a44cfc5af0039a4a6f23de044e9f781

URL: https://github.com/llvm/llvm-project/commit/36ee9a322a44cfc5af0039a4a6f23de044e9f781
DIFF: https://github.com/llvm/llvm-project/commit/36ee9a322a44cfc5af0039a4a6f23de044e9f781.diff

LOG: [mlir][GPUToVulkan] Fix signature of bindMemRef function for f16

Binding MemRefs of f16 needs special handling as the type is not supported on
CPU. There was a bug in the type used.

Differential Revision: https://reviews.llvm.org/D86328

Added: 
    

Modified: 
    mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp
    mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp
index 377b4f0e3e55..8099bec63f2d 100644
--- a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp
+++ b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp
@@ -328,7 +328,7 @@ void VulkanLaunchFuncToVulkanCallsPass::declareVulkanFunctions(Location loc) {
       std::string fnName = "bindMemRef" + std::to_string(i) + "D" +
                            std::string(stringifyType(type));
       if (type.isHalfTy())
-        type = getMemRefType(i, LLVM::LLVMType::getInt16Ty(&getContext()));
+        type = LLVM::LLVMType::getInt16Ty(&getContext());
       if (!module.lookupSymbol(fnName)) {
         auto fnType = LLVM::LLVMType::getFunctionTy(
             getVoidType(),

diff  --git a/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir b/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir
index e39bfa41e692..507925bc891b 100644
--- a/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir
+++ b/mlir/test/Conversion/GPUToVulkan/invoke-vulkan.mlir
@@ -15,6 +15,8 @@
 // CHECK: llvm.call @runOnVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr<i8>) -> !llvm.void
 // CHECK: llvm.call @deinitVulkan(%[[Vulkan_Runtime_ptr]]) : (!llvm.ptr<i8>) -> !llvm.void
 
+// CHECK: llvm.func @bindMemRef1DHalf(!llvm.ptr<i8>, !llvm.i32, !llvm.i32, !llvm.ptr<struct<(ptr<i16>, ptr<i16>, i64, array<1 x i64>, array<1 x i64>)>>)
+
 module attributes {gpu.container_module} {
   llvm.func @malloc(!llvm.i64) -> !llvm.ptr<i8>
   llvm.func @foo() {


        


More information about the Mlir-commits mailing list