Skip to content

Commit

Permalink
[CODEGEN LLVM GPU] Initialize llvm before lookup for the target (#2683)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis0x0D authored and masahi committed Feb 27, 2019
1 parent 55c0243 commit 2bf3458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/contrib/nvcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def find_libdevice_path(arch):
selected_ver = 0
selected_path = None
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")
else:
for fn in os.listdir(lib_path):
Expand Down
1 change: 1 addition & 0 deletions src/codegen/llvm/codegen_amdgpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ inline int DetectROCMComputeVersion(const std::string& target) {
}

runtime::Module BuildAMDGPU(Array<LoweredFunc> funcs, std::string target) {
InitializeLLVM();
CHECK(target.length() >= 4 &&
target.substr(0, 4) == "rocm");
std::ostringstream config;
Expand Down
1 change: 1 addition & 0 deletions src/codegen/llvm/codegen_nvptx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ inline int DetectCUDAComputeVersion() {
}

runtime::Module BuildNVPTX(Array<LoweredFunc> funcs, std::string target) {
InitializeLLVM();
CHECK(target.length() >= 5 &&
target.substr(0, 5) == "nvptx");
int compute_ver = DetectCUDAComputeVersion();
Expand Down

0 comments on commit 2bf3458

Please sign in to comment.