diff options
author | Brad King <brad.king@kitware.com> | 2021-09-20 16:38:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-09-20 16:38:44 (GMT) |
commit | 36966f63ca9b43e5e2c8d7e9e0264181499734b1 (patch) | |
tree | 671ddcea389f71feaf0f4c12106144d0d830d39b /Modules/Compiler | |
parent | c03a216ca8b8fd3e01ddd3178cadacbdd5191203 (diff) | |
parent | cb93f7262469d0f7e1b7da01ad3586d001234af2 (diff) | |
download | CMake-36966f63ca9b43e5e2c8d7e9e0264181499734b1.zip CMake-36966f63ca9b43e5e2c8d7e9e0264181499734b1.tar.gz CMake-36966f63ca9b43e5e2c8d7e9e0264181499734b1.tar.bz2 |
Merge topic 'hip-no-hipcc'
cb93f72624 HIP: Simplify detection of HIP runtime CMake package
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
b125e9809a HIP: Detect ROCm path earlier
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6533
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang-HIP.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-ASM.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-C.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-CXX.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-DetermineCompiler.cmake | 19 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-FindBinUtils.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-HIP.cmake | 49 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-OBJC.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang-OBJCXX.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/ROCMClang.cmake | 35 |
10 files changed, 1 insertions, 135 deletions
diff --git a/Modules/Compiler/Clang-HIP.cmake b/Modules/Compiler/Clang-HIP.cmake index 1030a43..4dbe2e8 100644 --- a/Modules/Compiler/Clang-HIP.cmake +++ b/Modules/Compiler/Clang-HIP.cmake @@ -15,6 +15,6 @@ set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED") set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "") set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "") -# Populated by CMakeHIPRuntime.cmake +# Populated by CMakeHIPInformation.cmake set(CMAKE_HIP_RUNTIME_LIBRARIES_STATIC "") set(CMAKE_HIP_RUNTIME_LIBRARIES_SHARED "") diff --git a/Modules/Compiler/ROCMClang-ASM.cmake b/Modules/Compiler/ROCMClang-ASM.cmake deleted file mode 100644 index 85d1110..0000000 --- a/Modules/Compiler/ROCMClang-ASM.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(ASM) diff --git a/Modules/Compiler/ROCMClang-C.cmake b/Modules/Compiler/ROCMClang-C.cmake deleted file mode 100644 index cdfa95d..0000000 --- a/Modules/Compiler/ROCMClang-C.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(C) - -set(_rocm_clang_ver "${CMAKE_C_COMPILER_VERSION_INTERNAL}") -set(CMAKE_C_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION_INTERNAL}") -include(Compiler/Clang-C) -set(CMAKE_C_COMPILER_VERSION "${_rocm_clang_ver}") diff --git a/Modules/Compiler/ROCMClang-CXX.cmake b/Modules/Compiler/ROCMClang-CXX.cmake deleted file mode 100644 index 5739c8e..0000000 --- a/Modules/Compiler/ROCMClang-CXX.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(CXX) - -set(_rocm_clang_ver "${CMAKE_CXX_COMPILER_VERSION_INTERNAL}") -set(CMAKE_CXX_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION_INTERNAL}") -include(Compiler/Clang-CXX) -set(CMAKE_CXX_COMPILER_VERSION "${_rocm_clang_ver}") diff --git a/Modules/Compiler/ROCMClang-DetermineCompiler.cmake b/Modules/Compiler/ROCMClang-DetermineCompiler.cmake deleted file mode 100644 index c2fc99b..0000000 --- a/Modules/Compiler/ROCMClang-DetermineCompiler.cmake +++ /dev/null @@ -1,19 +0,0 @@ - -set(_compiler_id_pp_test "defined(__clang__) && __has_include(<hip/hip_version.h>)") - -set(_compiler_id_version_compute " -# if defined(__clang__) && __has_include(<hip/hip_version.h>) -# include <hip/hip_version.h> -# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(HIP_VERSION_MAJOR) -# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(HIP_VERSION_MINOR) -# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(HIP_VERSION_PATCH) -# endif") - -set(_compiler_id_simulate " -# if defined(_MSC_VER) -# define @PREFIX@SIMULATE_ID \"MSVC\" -# elif defined(__clang__) -# define @PREFIX@SIMULATE_ID \"Clang\" -# elif defined(__GNUC__) -# define @PREFIX@SIMULATE_ID \"GNU\" -# endif") diff --git a/Modules/Compiler/ROCMClang-FindBinUtils.cmake b/Modules/Compiler/ROCMClang-FindBinUtils.cmake deleted file mode 100644 index e721c87..0000000 --- a/Modules/Compiler/ROCMClang-FindBinUtils.cmake +++ /dev/null @@ -1 +0,0 @@ -include(Compiler/Clang-FindBinUtils) diff --git a/Modules/Compiler/ROCMClang-HIP.cmake b/Modules/Compiler/ROCMClang-HIP.cmake deleted file mode 100644 index 7af7699..0000000 --- a/Modules/Compiler/ROCMClang-HIP.cmake +++ /dev/null @@ -1,49 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(HIP) - -set(_CMAKE_COMPILE_AS_HIP_FLAG "-x hip") -set(_CMAKE_HIP_RDC_FLAG "-fgpu-rdc") - -if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") - set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") - string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -O") -endif() - -if(CMAKE_HIP_SIMULATE_ID STREQUAL "GNU") - set(CMAKE_HIP_LINKER_WRAPPER_FLAG "-Wl,") - set(CMAKE_HIP_LINKER_WRAPPER_FLAG_SEP ",") -elseif(CMAKE_HIP_SIMULATE_ID STREQUAL "Clang") - set(CMAKE_HIP_LINKER_WRAPPER_FLAG "-Xlinker" " ") - set(CMAKE_HIP_LINKER_WRAPPER_FLAG_SEP) -endif() - -if(NOT CMAKE_HIP_COMPILER_VERSION VERSION_LESS 1.0) - set(CMAKE_HIP98_STANDARD_COMPILE_OPTION "-std=c++98") - set(CMAKE_HIP98_EXTENSION_COMPILE_OPTION "-std=gnu++98") - set(CMAKE_HIP98_STANDARD__HAS_FULL_SUPPORT ON) - - set(CMAKE_HIP11_STANDARD_COMPILE_OPTION "-std=c++11") - set(CMAKE_HIP11_EXTENSION_COMPILE_OPTION "-std=gnu++11") - set(CMAKE_HIP11_STANDARD__HAS_FULL_SUPPORT ON) - - set(CMAKE_HIP14_STANDARD_COMPILE_OPTION "-std=c++14") - set(CMAKE_HIP14_EXTENSION_COMPILE_OPTION "-std=gnu++14") - set(CMAKE_HIP14_STANDARD__HAS_FULL_SUPPORT ON) - - set(CMAKE_HIP17_STANDARD_COMPILE_OPTION "-std=c++17") - set(CMAKE_HIP17_EXTENSION_COMPILE_OPTION "-std=gnu++17") - set(CMAKE_HIP17_STANDARD__HAS_FULL_SUPPORT ON) - - set(CMAKE_HIP20_STANDARD_COMPILE_OPTION "-std=c++20") - set(CMAKE_HIP20_EXTENSION_COMPILE_OPTION "-std=gnu++20") -endif() - -set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED") -set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "") -set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "") - -# Populated by CMakeHIPRuntime.cmake -set(CMAKE_HIP_RUNTIME_LIBRARIES_STATIC "") -set(CMAKE_HIP_RUNTIME_LIBRARIES_SHARED "") - -__compiler_check_default_language_standard(HIP 3.5 11) diff --git a/Modules/Compiler/ROCMClang-OBJC.cmake b/Modules/Compiler/ROCMClang-OBJC.cmake deleted file mode 100644 index 794973d..0000000 --- a/Modules/Compiler/ROCMClang-OBJC.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(OBJC) - -set(_rocm_clang_ver "${CMAKE_OBJC_COMPILER_VERSION_INTERNAL}") -set(CMAKE_OBJC_COMPILER_VERSION "${CMAKE_OBJC_COMPILER_VERSION_INTERNAL}") -include(Compiler/Clang-OBJC) -set(CMAKE_OBJC_COMPILER_VERSION "${_rocm_clang_ver}") diff --git a/Modules/Compiler/ROCMClang-OBJCXX.cmake b/Modules/Compiler/ROCMClang-OBJCXX.cmake deleted file mode 100644 index 82238e1..0000000 --- a/Modules/Compiler/ROCMClang-OBJCXX.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(Compiler/ROCMClang) -__compiler_rocmclang(OBJCXX) - -set(_rocm_clang_ver "${CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL}") -set(CMAKE_OBJCXX_COMPILER_VERSION "${CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL}") -include(Compiler/Clang-OBJCXX) -set(CMAKE_OBJCXX_COMPILER_VERSION "${_rocm_clang_ver}") diff --git a/Modules/Compiler/ROCMClang.cmake b/Modules/Compiler/ROCMClang.cmake deleted file mode 100644 index 6b38c2d..0000000 --- a/Modules/Compiler/ROCMClang.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - - -# This module is shared by multiple languages; use include blocker. -include_guard() - -include(Compiler/CMakeCommonCompilerMacros) - -macro(__compiler_rocmclang lang) - - set(CMAKE_${lang}_VERBOSE_FLAG "-v") - - if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") - # Feature flags. - set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") - set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") - set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY -fvisibility=) - - string(APPEND CMAKE_HIP_FLAGS_INIT " ") - string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -g") - string(APPEND CMAKE_HIP_FLAGS_RELEASE_INIT " -O3 -DNDEBUG") - string(APPEND CMAKE_HIP_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG") - string(APPEND CMAKE_HIP_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG") - endif() - - set(CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS -shared) - set(CMAKE_INCLUDE_SYSTEM_FLAG_HIP "-isystem ") - - set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1) - set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1) - set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) - set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@") - set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@") -endmacro() |