Update to upstream version '3.21.3'
with Debian dir 09df7c6912
ci/unstable
commit
13afa71e65
@ -1,99 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
|
||||
function(_CMAKE_FIND_HIP_RUNTIME )
|
||||
# Determined when hipcc is the HIP compiler
|
||||
set(_CMAKE_HIP_COMPILER_ROCM_ROOT "@_CMAKE_HIP_COMPILER_ROCM_ROOT@")
|
||||
|
||||
# Forward facing value that can be provided by the user
|
||||
set(CMAKE_HIP_COMPILER_TOOLKIT_ROOT @CMAKE_HIP_COMPILER_TOOLKIT_ROOT@)
|
||||
|
||||
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
|
||||
set(message_on_found TRUE)
|
||||
endif()
|
||||
|
||||
set(explicit_search_only FALSE)
|
||||
set(rocm_root_dirs )
|
||||
if(DEFINED CMAKE_HIP_COMPILER_TOOLKIT_ROOT)
|
||||
set(rocm_root_dirs "${CMAKE_HIP_COMPILER_TOOLKIT_ROOT}")
|
||||
set(explicit_search_only TRUE)
|
||||
set(error_message_location "the variable CMAKE_HIP_COMPILER_TOOLKIT_ROOT [\"${CMAKE_HIP_COMPILER_TOOLKIT_ROOT}\"]")
|
||||
elseif(DEFINED ENV{CMAKE_HIP_COMPILER_TOOLKIT_ROOT})
|
||||
set(rocm_root_dirs "$ENV{CMAKE_HIP_COMPILER_TOOLKIT_ROOT}")
|
||||
set(explicit_search_only TRUE)
|
||||
set(error_message_location "CMAKE_HIP_COMPILER_TOOLKIT_ROOT")
|
||||
set(error_message_location "the environment variable CMAKE_HIP_COMPILER_TOOLKIT_ROOT [\"$ENV{CMAKE_HIP_COMPILER_TOOLKIT_ROOT}\"]")
|
||||
elseif(DEFINED _CMAKE_HIP_COMPILER_ROCM_ROOT)
|
||||
set(rocm_root_dirs "${_CMAKE_HIP_COMPILER_ROCM_ROOT}")
|
||||
set(explicit_search_only TRUE)
|
||||
set(error_message_location "the associated hipconfig --rocmpath [\"${_CMAKE_HIP_COMPILER_ROCM_ROOT}\"]")
|
||||
endif()
|
||||
|
||||
# Guess on where rocm is installed
|
||||
if(NOT rocm_root_dirs AND (UNIX AND NOT APPLE))
|
||||
set(platform_base "/opt/rocm-")
|
||||
|
||||
# Finad all default rocm installations
|
||||
file(GLOB possible_paths "${platform_base}*")
|
||||
|
||||
set(versions)
|
||||
foreach(p ${possible_paths})
|
||||
# Extract version number from end of string
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+$" p_version ${p})
|
||||
if(IS_DIRECTORY ${p} AND p_version)
|
||||
list(APPEND versions ${p_version})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Sort numerically in descending order, so we try the newest versions first.
|
||||
list(SORT versions COMPARE NATURAL ORDER DESCENDING)
|
||||
|
||||
# With a descending list of versions, populate possible paths to search.
|
||||
set(rocm_root_dirs "/opt/rocm")
|
||||
foreach(v IN LISTS versions)
|
||||
list(APPEND rocm_root_dirs "${platform_base}${v}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(search_rel_path "/lib/cmake/hip-lang/")
|
||||
list(TRANSFORM rocm_root_dirs APPEND "${search_rel_path}")
|
||||
|
||||
find_package(hip-lang
|
||||
CONFIG
|
||||
PATHS ${rocm_root_dirs}
|
||||
QUIET
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET AND NOT explicit_search_only)
|
||||
find_package(hip-lang CONFIG QUIET)
|
||||
endif()
|
||||
|
||||
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
|
||||
set(CMAKE_HIP_RUNTIME_LIBRARIES_STATIC
|
||||
${CMAKE_HIP_RUNTIME_LIBRARIES_STATIC}
|
||||
${_CMAKE_HIP_DEVICE_RUNTIME_TARGET} PARENT_SCOPE)
|
||||
set(CMAKE_HIP_RUNTIME_LIBRARIES_SHARED
|
||||
${CMAKE_HIP_RUNTIME_LIBRARIES_SHARED}
|
||||
${_CMAKE_HIP_DEVICE_RUNTIME_TARGET} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET AND message_on_found)
|
||||
message(STATUS "Found HIP runtime: ${hip-lang_DIR}")
|
||||
elseif(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
|
||||
if(explicit_search_only)
|
||||
set(error_message "Failed to find the HIP runtime, Could not find hip-lang-config.cmake at the following location(s):\n")
|
||||
foreach(p IN LISTS rocm_root_dirs)
|
||||
string(APPEND error_message "\t${p}\n")
|
||||
endforeach()
|
||||
string(APPEND "which are computed from the location specified by ${error_message_location}. \
|
||||
Please specify CMAKE_HIP_COMPILER_TOOLKIT_ROOT to the location of")
|
||||
message(FATAL_ERROR "${error_message}")
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Failed to find the HIP runtime, Could not find hip-lang-config.cmake.\
|
||||
Try setting CMAKE_HIP_COMPILER_TOOLKIT_ROOT")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
@ -1,2 +0,0 @@
|
||||
include(Compiler/ROCMClang)
|
||||
__compiler_rocmclang(ASM)
|
@ -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}")
|
@ -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}")
|
@ -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")
|
@ -1 +0,0 @@
|
||||
include(Compiler/Clang-FindBinUtils)
|
@ -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)
|
@ -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}")
|
@ -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}")
|
@ -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()
|
Loading…
Reference in new issue