diff --git a/cmake/FindRocmAgentEnumerator.cmake b/cmake/FindRocmAgentEnumerator.cmake index 6c32410265..987c1bb74f 100644 --- a/cmake/FindRocmAgentEnumerator.cmake +++ b/cmake/FindRocmAgentEnumerator.cmake @@ -9,7 +9,7 @@ # rocm_agent_enumerator is found. # -find_program(ROCM_AGENT_ENUMERATOR NAMES rocm_agent_enumerator) +find_program(ROCM_AGENT_ENUMERATOR NAMES not_rocm_agent_enumerator) if(ROCM_AGENT_ENUMERATOR) set(ROCM_AGENT_ENUMERATOR_FOUND TRUE) diff --git a/test/conformance/device_code/CMakeLists.txt b/test/conformance/device_code/CMakeLists.txt index f64baf876f..5d0a06c42a 100644 --- a/test/conformance/device_code/CMakeLists.txt +++ b/test/conformance/device_code/CMakeLists.txt @@ -3,7 +3,9 @@ # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -function(detect_amd_arch AMD_ARCH) +set(AMD_ARCH "${UR_AMD_ARCH}") + +if("${AMD_ARCH}" STREQUAL "" AND "${TARGET_TRIPLES}" MATCHES "amd") find_package(RocmAgentEnumerator) if(NOT ROCM_AGENT_ENUMERATOR_FOUND) message(FATAL_ERROR @@ -28,14 +30,6 @@ function(detect_amd_arch AMD_ARCH) "please specify which target to use by setting UR_AMD_ARCH.") endif() list(GET ROCM_AGENT_LIST 0 AMD_ARCH) - return(${AMD_ARCH}) -endfunction() - -set(AMD_ARCH "${UR_AMD_ARCH}") - -if("${AMD_ARCH}" STREQUAL "" AND "${TARGET_TRIPLES}" MATCHES "amd") - detect_amd_arch(AMD_ARCH) - message(STATUS "AMD_ARCH: ${AMD_ARCH}") endif() macro(add_device_binary SOURCE_FILE)