Merge pull request #133 from scchan/hcc_version_detect

detect the hcc version and conditionally add -hc-function-calls

[ROCm/rccl commit: de25e4cb7c]
This commit is contained in:
Wenkai Du
2019-10-03 10:53:45 -07:00
committed by GitHub
+7 -1
View File
@@ -152,7 +152,13 @@ if("${HIP_COMPILER}" MATCHES "clang")
endif()
if("${HIP_COMPILER}" MATCHES "hcc")
target_link_libraries(rccl PRIVATE -hc-function-calls)
find_program( hcc_executable hcc )
execute_process(COMMAND bash "-c" "${hcc_executable} --version | sed -e '1!d' -e 's/.*based on HCC\\s*//'" OUTPUT_VARIABLE hcc_version_string)
execute_process(COMMAND bash "-c" "echo \"${hcc_version_string}\" | awk -F\".\" '{ printf $1}'" OUTPUT_VARIABLE hcc_major_version)
execute_process(COMMAND bash "-c" "echo \"${hcc_version_string}\" | awk -F\".\" '{ printf $2}'" OUTPUT_VARIABLE hcc_minor_version)
if ("${hcc_major_version}.${hcc_minor_version}" VERSION_LESS "2.10")
target_link_libraries(rccl PRIVATE -hc-function-calls)
endif()
endif()
if(TARGET hip::device)