SWDEV-431466 - Fix rocPRIM build failure

Do not populate AMDGPU_TARGETS when there is no device
detected by amdgpu-arch on the machine

Change-Id: I87fd7081f9e0b72f057aab2eb639808d2f89cfb1


[ROCm/clr commit: e36020f339]
This commit is contained in:
Satyanvesh Dittakavi
2023-11-09 19:12:07 +00:00
rodzic be743bcd59
commit cf708607da
@@ -86,8 +86,10 @@ if(NOT AMDGPU_TARGETS)
message(AUTHOR_WARNING "amdgpu-arch failed with error ${AMDGPU_ARCH_ERROR}")
message("and the output is ${AMDGPU_ARCH_OUTPUT}")
else()
string(REPLACE "\n" ";" AMDGPU_ARCH_OUTPUT ${AMDGPU_ARCH_OUTPUT})
set(AMDGPU_TARGETS ${AMDGPU_ARCH_OUTPUT} CACHE STRING "AMD GPU targets to compile for")
if (NOT AMDGPU_ARCH_OUTPUT STREQUAL "")
string(REPLACE "\n" ";" AMDGPU_ARCH_OUTPUT ${AMDGPU_ARCH_OUTPUT})
set(AMDGPU_TARGETS ${AMDGPU_ARCH_OUTPUT} CACHE STRING "AMD GPU targets to compile for")
endif()
endif()
endif()