[Mlir-commits] [mlir] 6883343 - [mlir] Guard NVPTX backend initialization on it being configured (NFC)

Mehdi Amini llvmlistbot at llvm.org
Fri Nov 3 22:23:10 PDT 2023


Author: Mehdi Amini
Date: 2023-11-03T22:23:01-07:00
New Revision: 6883343843716154ba7d359990a9356700bc63c3

URL: https://github.com/llvm/llvm-project/commit/6883343843716154ba7d359990a9356700bc63c3
DIFF: https://github.com/llvm/llvm-project/commit/6883343843716154ba7d359990a9356700bc63c3.diff

LOG: [mlir] Guard NVPTX backend initialization on it being configured (NFC)

This is just helping with some build failure in some new configurations.

Added: 
    

Modified: 
    mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
index fb9f14ddbc0d134..34ad4e6868e157b 100644
--- a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
@@ -85,10 +85,12 @@ SerializeToCubinPass::SerializeToCubinPass(StringRef triple, StringRef chip,
   // is initialized exactly once.
   llvm::call_once(initializeBackendOnce, []() {
     // Initialize LLVM NVPTX backend.
+#if LLVM_HAS_NVPTX_TARGET
     LLVMInitializeNVPTXTarget();
     LLVMInitializeNVPTXTargetInfo();
     LLVMInitializeNVPTXTargetMC();
     LLVMInitializeNVPTXAsmPrinter();
+#endif
   });
 
   maybeSetOption(this->triple, triple);


        


More information about the Mlir-commits mailing list