Adding backward compatibility for target-id syntax for AMDGPU_TARGETS (#306)
This commit is contained in:
+15
-1
@@ -11,7 +11,21 @@ set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "")
|
||||
|
||||
project(rccl CXX)
|
||||
|
||||
set(AMDGPU_TARGETS gfx803;gfx900;gfx906:xnack-;gfx908:xnack- CACHE STRING "List of specific machine types for library to target")
|
||||
# Detect compiler support for target ID
|
||||
if( CMAKE_CXX_COMPILER MATCHES ".*/hipcc$" )
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} "--help"
|
||||
OUTPUT_VARIABLE CXX_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX MATCH ".mcode\-object\-version" TARGET_ID_SUPPORT ${CXX_OUTPUT})
|
||||
endif()
|
||||
|
||||
# Use target ID syntax if supported for AMDGPU_TARGETS
|
||||
if(TARGET_ID_SUPPORT)
|
||||
set(AMDGPU_TARGETS gfx803;gfx900;gfx906:xnack-;gfx908:xnack- CACHE STRING "List of specific machine types for library to target")
|
||||
else()
|
||||
set(AMDGPU_TARGETS gfx803;gfx900;gfx906;gfx908 CACHE STRING "List of specific machine types for library to target")
|
||||
endif()
|
||||
|
||||
option(BUILD_TESTS "Build test programs" OFF)
|
||||
option(INSTALL_DEPENDENCIES "Force install dependencies" OFF)
|
||||
|
||||
Reference in New Issue
Block a user