From 6e94b0dfa622fae83e0fe14ae08aabf9cc4fd4d3 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 11 Jul 2018 20:15:49 +0300 Subject: [PATCH] [HIPIFY] Current trunk LLVM 7.0 initial support Tested with CUDA 8.0, 9.0, 9.1 and 9.2. Only 8.0 works with LLVM 7.0, due to the changes in LLVM trunc since released 6.0, which works fine with CUDA 8.0 and 9.0. So, nothing to do in hipify-clang, hope that all the CUDA 9.x related issues will be fixed in 7.0 release. [ROCm/clr commit: b9c15702d299a5f0687e963bd65146a2701f77c8] --- projects/clr/hipamd/hipify-clang/CMakeLists.txt | 6 +++++- projects/clr/hipamd/hipify-clang/src/HipifyAction.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/hipify-clang/CMakeLists.txt b/projects/clr/hipamd/hipify-clang/CMakeLists.txt index 8b3fa7e591..5d9070be28 100644 --- a/projects/clr/hipamd/hipify-clang/CMakeLists.txt +++ b/projects/clr/hipamd/hipify-clang/CMakeLists.txt @@ -51,6 +51,10 @@ if(WIN32) target_link_libraries(hipify-clang version) endif() +if ((LLVM_PACKAGE_VERSION VERSION_EQUAL "7") OR (LLVM_PACKAGE_VERSION VERSION_GREATER "7")) + target_link_libraries(hipify-clang clangToolingInclusions) +endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") if(MSVC) @@ -95,7 +99,7 @@ if (HIPIFY_CLANG_TESTS) message(STATUS "Please install clang 4.0 or higher.") elseif (CUDA_VERSION VERSION_EQUAL "9.0") message(STATUS "Please install clang 6.0 or higher.") - elseif (CUDA_VERSION VERSION_EQUAL "9.1") + elseif ((CUDA_VERSION VERSION_EQUAL "9.1") OR (CUDA_VERSION VERSION_EQUAL "9.2")) message(STATUS "Please install clang 7.0 or higher.") endif() endif() diff --git a/projects/clr/hipamd/hipify-clang/src/HipifyAction.cpp b/projects/clr/hipamd/hipify-clang/src/HipifyAction.cpp index 7e5ff4357d..21b16e0699 100644 --- a/projects/clr/hipamd/hipify-clang/src/HipifyAction.cpp +++ b/projects/clr/hipamd/hipify-clang/src/HipifyAction.cpp @@ -428,7 +428,11 @@ public: void InclusionDirective(clang::SourceLocation hash_loc, const clang::Token& include_token, StringRef file_name, bool is_angled, clang::CharSourceRange filename_range, const clang::FileEntry* file, StringRef search_path, StringRef relative_path, - const clang::Module* imported) override { + const clang::Module* imported +#if LLVM_VERSION_MAJOR > 6 + , clang::SrcMgr::CharacteristicKind FileType +#endif + ) override { hipifyAction.InclusionDirective(hash_loc, include_token, file_name, is_angled, filename_range, file, search_path, relative_path, imported); }