[Mlir-commits] [mlir] 3320249 - [MLIR][NVVM] Make the call to findTool optional for fatbinary (#93968)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri May 31 12:09:01 PDT 2024


Author: Adam Paszke
Date: 2024-05-31T21:08:57+02:00
New Revision: 3320249688d216a25d5297152e59b58e3fb89915

URL: https://github.com/llvm/llvm-project/commit/3320249688d216a25d5297152e59b58e3fb89915
DIFF: https://github.com/llvm/llvm-project/commit/3320249688d216a25d5297152e59b58e3fb89915.diff

LOG: [MLIR][NVVM] Make the call to findTool optional for fatbinary (#93968)

Added: 
    

Modified: 
    mlir/lib/Target/LLVM/NVVM/Target.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index e75547ff9b850..acb903aa37caf 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -267,9 +267,12 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
   std::optional<std::string> ptxasCompiler = findTool("ptxas");
   if (!ptxasCompiler)
     return std::nullopt;
-  std::optional<std::string> fatbinaryTool = findTool("fatbinary");
-  if (createFatbin && !fatbinaryTool)
-    return std::nullopt;
+  std::optional<std::string> fatbinaryTool;
+  if (createFatbin) {
+    fatbinaryTool = findTool("fatbinary");
+    if (!fatbinaryTool)
+      return std::nullopt;
+  }
   Location loc = getOperation().getLoc();
 
   // Base name for all temp files: mlir-<module name>-<target triple>-<chip>.


        


More information about the Mlir-commits mailing list