[MLIR] Allow for multiple gpu modules during translation.
authorStephan Herhut <herhut@google.com>
Thu, 16 Apr 2020 11:14:43 +0000 (13:14 +0200)
committerStephan Herhut <herhut@google.com>
Thu, 16 Apr 2020 12:18:31 +0000 (14:18 +0200)
commit69040d5b0bfa59edacc2ad10d517b4270bf76845
tree81de46ba098c5cefa1727f436c59d414f3ebc60b
parentda207407866a683563f6243e2b5f7502783b9842
[MLIR] Allow for multiple gpu modules during translation.

This change makes the ModuleTranslation threadsafe by locking on the
LLVMContext. Furthermore, we now clone the llvm module into a new
context when compiling to PTX similar to what the OrcJit does.

Differential Revision: https://reviews.llvm.org/D78207
mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/ExecutionEngine/CMakeLists.txt
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/mlir-cuda-runner/two-modules.mlir [new file with mode: 0644]