Skip to content

Commit 6883343

Browse files
committed
[mlir] Guard NVPTX backend initialization on it being configured (NFC)
This is just helping with some build failure in some new configurations.
1 parent b0d5b4d commit 6883343

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ SerializeToCubinPass::SerializeToCubinPass(StringRef triple, StringRef chip,
8585
// is initialized exactly once.
8686
llvm::call_once(initializeBackendOnce, []() {
8787
// Initialize LLVM NVPTX backend.
88+
#if LLVM_HAS_NVPTX_TARGET
8889
LLVMInitializeNVPTXTarget();
8990
LLVMInitializeNVPTXTargetInfo();
9091
LLVMInitializeNVPTXTargetMC();
9192
LLVMInitializeNVPTXAsmPrinter();
93+
#endif
9294
});
9395

9496
maybeSetOption(this->triple, triple);

0 commit comments

Comments
 (0)