Commit 2bf34581 by Denis Khalikov Committed by masahi

[CODEGEN LLVM GPU] Initialize llvm before lookup for the target (#2683)

parent 55c0243f
...@@ -151,7 +151,7 @@ def find_libdevice_path(arch): ...@@ -151,7 +151,7 @@ def find_libdevice_path(arch):
selected_ver = 0 selected_ver = 0
selected_path = None selected_path = None
cuda_ver = get_cuda_version(cuda_path) cuda_ver = get_cuda_version(cuda_path)
if cuda_ver in (9.0, 9.1): if cuda_ver in (9.0, 9.1, 10.0):
path = os.path.join(lib_path, "libdevice.10.bc") path = os.path.join(lib_path, "libdevice.10.bc")
else: else:
for fn in os.listdir(lib_path): for fn in os.listdir(lib_path):
......
...@@ -156,6 +156,7 @@ inline int DetectROCMComputeVersion(const std::string& target) { ...@@ -156,6 +156,7 @@ inline int DetectROCMComputeVersion(const std::string& target) {
} }
runtime::Module BuildAMDGPU(Array<LoweredFunc> funcs, std::string target) { runtime::Module BuildAMDGPU(Array<LoweredFunc> funcs, std::string target) {
InitializeLLVM();
CHECK(target.length() >= 4 && CHECK(target.length() >= 4 &&
target.substr(0, 4) == "rocm"); target.substr(0, 4) == "rocm");
std::ostringstream config; std::ostringstream config;
......
...@@ -166,6 +166,7 @@ inline int DetectCUDAComputeVersion() { ...@@ -166,6 +166,7 @@ inline int DetectCUDAComputeVersion() {
} }
runtime::Module BuildNVPTX(Array<LoweredFunc> funcs, std::string target) { runtime::Module BuildNVPTX(Array<LoweredFunc> funcs, std::string target) {
InitializeLLVM();
CHECK(target.length() >= 5 && CHECK(target.length() >= 5 &&
target.substr(0, 5) == "nvptx"); target.substr(0, 5) == "nvptx");
int compute_ver = DetectCUDAComputeVersion(); int compute_ver = DetectCUDAComputeVersion();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment