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

[ROCm/rccl commit: b87ef4f152]
Tá an tiomantas seo le fáil i:
Siu Chi Chan tiomanta 2019-10-03 13:25:25 -04:00
1 tuismitheoir 4164cac99a
tiomantas 0af7f5268f
1 comhad athraithe
+7 -1
+7 -1
Féach ar an gComhad
@@ -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)