Loading mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt +11 −16 Original line number Diff line number Diff line 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() mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -57,10 +57,9 @@ public: 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) Loading mlir/tools/mlir-opt/CMakeLists.txt +13 −10 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ set(LIBS MLIREDSC MLIRFxpMathOps MLIRGPU MLIRGPUtoCUDATransforms MLIRGPUtoNVVMTransforms MLIRGPUtoROCDLTransforms MLIRGPUtoSPIRVTransforms Loading Loading @@ -75,17 +76,19 @@ set(LIBS LLVMAsmParser ) if(MLIR_CUDA_CONVERSIONS_ENABLED) list(APPEND LIBS LLVMNVPTXCodeGen LLVMNVPTXDesc LLVMNVPTXInfo MLIRGPUtoCUDATransforms MLIRTargetNVVMIR ) endif() add_llvm_tool(mlir-opt mlir-opt.cpp ) # Manually expand the target library, since our MLIR libraries # aren't plugged into the LLVM dependency tracking. If we don't # do this then we can't insert the CodeGen library after ourselves llvm_expand_pseudo_components(TARGET_LIBS AllTargetsCodeGens) # Prepend LLVM in front of every target, this is how the library # are named with CMake SET(targets_to_link) FOREACH(t ${TARGET_LIBS}) LIST(APPEND targets_to_link "LLVM${t}") ENDFOREACH(t) llvm_update_compile_flags(mlir-opt) target_link_libraries(mlir-opt PRIVATE ${LIBS}) target_link_libraries(mlir-opt PRIVATE ${LIBS} ${targets_to_link}) Loading
mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt +11 −16 Original line number Diff line number Diff line 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()
mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -57,10 +57,9 @@ public: 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) Loading
mlir/tools/mlir-opt/CMakeLists.txt +13 −10 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ set(LIBS MLIREDSC MLIRFxpMathOps MLIRGPU MLIRGPUtoCUDATransforms MLIRGPUtoNVVMTransforms MLIRGPUtoROCDLTransforms MLIRGPUtoSPIRVTransforms Loading Loading @@ -75,17 +76,19 @@ set(LIBS LLVMAsmParser ) if(MLIR_CUDA_CONVERSIONS_ENABLED) list(APPEND LIBS LLVMNVPTXCodeGen LLVMNVPTXDesc LLVMNVPTXInfo MLIRGPUtoCUDATransforms MLIRTargetNVVMIR ) endif() add_llvm_tool(mlir-opt mlir-opt.cpp ) # Manually expand the target library, since our MLIR libraries # aren't plugged into the LLVM dependency tracking. If we don't # do this then we can't insert the CodeGen library after ourselves llvm_expand_pseudo_components(TARGET_LIBS AllTargetsCodeGens) # Prepend LLVM in front of every target, this is how the library # are named with CMake SET(targets_to_link) FOREACH(t ${TARGET_LIBS}) LIST(APPEND targets_to_link "LLVM${t}") ENDFOREACH(t) llvm_update_compile_flags(mlir-opt) target_link_libraries(mlir-opt PRIVATE ${LIBS}) target_link_libraries(mlir-opt PRIVATE ${LIBS} ${targets_to_link})