[PATCH] D74472: Fix MLIR build when the NVPTX target isn't configured
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 12 02:15:30 PST 2020
mehdi_amini created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, herhut, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mgorny.
Herald added a reviewer: mravishankar.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74472
Files:
mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
mlir/tools/mlir-opt/CMakeLists.txt
Index: mlir/tools/mlir-opt/CMakeLists.txt
===================================================================
--- mlir/tools/mlir-opt/CMakeLists.txt
+++ mlir/tools/mlir-opt/CMakeLists.txt
@@ -31,6 +31,7 @@
MLIREDSC
MLIRFxpMathOps
MLIRGPU
+ MLIRGPUtoCUDATransforms
MLIRGPUtoNVVMTransforms
MLIRGPUtoROCDLTransforms
MLIRGPUtoSPIRVTransforms
@@ -75,15 +76,10 @@
LLVMAsmParser
)
-if(MLIR_CUDA_CONVERSIONS_ENABLED)
- list(APPEND LIBS
- LLVMNVPTXCodeGen
- LLVMNVPTXDesc
- LLVMNVPTXInfo
- MLIRGPUtoCUDATransforms
- MLIRTargetNVVMIR
- )
-endif()
+set(LLVM_LINK_COMPONENTS
+ AllTargetsCodeGens
+)
+
add_llvm_tool(mlir-opt
mlir-opt.cpp
)
Index: mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
===================================================================
--- mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
+++ mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
@@ -57,10 +57,9 @@
gpu::GPUModuleOp module = getOperation();
// Make sure the NVPTX target is initialized.
- LLVMInitializeNVPTXTarget();
- LLVMInitializeNVPTXTargetInfo();
- LLVMInitializeNVPTXTargetMC();
- LLVMInitializeNVPTXAsmPrinter();
+ llvm::InitializeAllTargets();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmPrinters();
auto llvmModule = translateModuleToNVVMIR(module);
if (!llvmModule)
Index: mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
===================================================================
--- mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
+++ mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
@@ -1,16 +1,11 @@
-if(MLIR_CUDA_CONVERSIONS_ENABLED)
- add_llvm_library(MLIRGPUtoCUDATransforms
- ConvertKernelFuncToCubin.cpp
- ConvertLaunchFuncToCudaCalls.cpp
- )
- target_link_libraries(MLIRGPUtoCUDATransforms
- LLVMNVPTXCodeGen
- LLVMNVPTXDesc
- LLVMNVPTXInfo
- MLIRGPU
- MLIRLLVMIR
- MLIRNVVMIR
- MLIRPass
- MLIRTargetNVVMIR
- )
-endif()
+add_llvm_library(MLIRGPUtoCUDATransforms
+ ConvertKernelFuncToCubin.cpp
+ ConvertLaunchFuncToCudaCalls.cpp
+)
+target_link_libraries(MLIRGPUtoCUDATransforms
+ MLIRGPU
+ MLIRLLVMIR
+ MLIRNVVMIR
+ MLIRPass
+ MLIRTargetNVVMIR
+)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74472.244108.patch
Type: text/x-patch
Size: 2220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/2b69079c/attachment.bin>
More information about the llvm-commits
mailing list