SWDEV-325491 - hip build when rocm_agent_enumerator returns no devices (#2535)

Change-Id: I2fe58d1eaba82a3dab2472bd37a8ab26d105ac1c

[ROCm/hip-tests commit: ef83ae6fd0]
Tento commit je obsažen v:
ROCm CI Service Account
2022-03-11 09:58:52 +05:30
odevzdal GitHub
rodič c64ccc514a
revize 2b8c3d01ef
+13 -10
Zobrazit soubor
@@ -109,16 +109,19 @@ if(NOT DEFINED OFFLOAD_ARCH_STR AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerat
RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT)
# Trim out gfx000
string(REPLACE "gfx000\n" "" HIP_GPU_ARCH ${HIP_GPU_ARCH})
string(LENGTH ${HIP_GPU_ARCH} HIP_GPU_ARCH_LEN)
# If string has more gfx target except gfx000
if(${HIP_GPU_ARCH_LEN} GREATER_EQUAL 1)
string(REGEX REPLACE "\n" ";" HIP_GPU_ARCH_LIST "${HIP_GPU_ARCH}")
set(OFFLOAD_ARCH_STR "")
foreach(_hip_gpu_arch ${HIP_GPU_ARCH_LIST})
set(OFFLOAD_ARCH_STR " ${OFFLOAD_ARCH_STR} --offload-arch=${_hip_gpu_arch} ")
endforeach()
message(STATUS "Using offload arch string: ${OFFLOAD_ARCH_STR}")
if (NOT HIP_GPU_ARCH STREQUAL "")
string(LENGTH ${HIP_GPU_ARCH} HIP_GPU_ARCH_LEN)
# If string has more gfx target except gfx000
if(${HIP_GPU_ARCH_LEN} GREATER_EQUAL 1)
string(REGEX REPLACE "\n" ";" HIP_GPU_ARCH_LIST "${HIP_GPU_ARCH}")
set(OFFLOAD_ARCH_STR "")
foreach(_hip_gpu_arch ${HIP_GPU_ARCH_LIST})
set(OFFLOAD_ARCH_STR " ${OFFLOAD_ARCH_STR} --offload-arch=${_hip_gpu_arch} ")
endforeach()
message(STATUS "Using offload arch string: ${OFFLOAD_ARCH_STR}")
endif()
else()
message(STATUS "ROCm Agent Enumurator found no valid architectures")
endif()
endif()