2
0

SWDEV-346857 - Removed hard coded path /opt/rocm (#2839)

As per the requirements in SWDEV-287540 ,config files should not have hard coded path /opt/rocm.
Removed the same
Also handled the case where ROCM_PATH is defined and not set in ENV. Earlier this condition was getting handled in default case

Change-Id: I9b28c4208175be61bc7c90c1fe2885fd299c5536
Este cometimento está contido em:
ROCm CI Service Account
2022-08-03 23:45:15 +05:30
cometido por GitHub
ascendente 1a3cbc472e
cometimento 357186bf9e
2 ficheiros modificados com 9 adições e 12 eliminações
+8 -9
Ver ficheiro
@@ -63,7 +63,6 @@ if(NOT APPLE)
"$ENV{ROCM_PATH}/hip"
ENV HIP_PATH
${_IMPORT_PREFIX}
/opt/rocm/hip
DOC "HIP installed location"
NO_DEFAULT_PATH
)
@@ -86,8 +85,6 @@ if(NOT APPLE)
"${HIP_ROOT_DIR}"
ENV ROCM_PATH
ENV HIP_PATH
/opt/rocm
/opt/rocm/hip
PATH_SUFFIXES bin
NO_DEFAULT_PATH
)
@@ -104,8 +101,6 @@ if(NOT APPLE)
"${HIP_ROOT_DIR}"
ENV ROCM_PATH
ENV HIP_PATH
/opt/rocm
/opt/rocm/hip
PATH_SUFFIXES bin
NO_DEFAULT_PATH
)
@@ -128,8 +123,6 @@ if(NOT APPLE)
"${HIP_ROOT_DIR}"
ENV ROCM_PATH
ENV HIP_PATH
/opt/rocm
/opt/rocm/hip
PATH_SUFFIXES bin
NO_DEFAULT_PATH
)
@@ -253,8 +246,11 @@ elseif("${HIP_COMPILER}" STREQUAL "clang")
else()
set(HIP_CLANG_PATH "${HIP_PATH}/../llvm/bin")
endif()
# Handle the case where ROCM_PATH is defined and not set in ENV
elseif(DEFINED ROCM_PATH)
set(HIP_CLANG_PATH "${ROCM_PATH}/llvm/bin")
else()
set(HIP_CLANG_PATH "/opt/rocm/llvm/bin")
message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env ")
endif()
endif()
#Number of parallel jobs by default is 1
@@ -680,8 +676,11 @@ macro(HIP_ADD_EXECUTABLE hip_target)
else()
set(HIP_CLANG_PATH "${HIP_PATH}/../llvm/bin")
endif()
# Handle the case where ROCM_PATH is defined and not set in ENV
elseif(DEFINED ROCM_PATH)
set(HIP_CLANG_PATH "${ROCM_PATH}/llvm/bin")
else()
set(HIP_CLANG_PATH "/opt/rocm/llvm/bin")
message(FATAL_ERROR "Unable to find the clang compiler path. Set ROCM_PATH or HIP_PATH in env")
endif()
endif()
set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+1 -3
Ver ficheiro
@@ -65,8 +65,7 @@ find_dependency(amd_comgr)
include( "${CMAKE_CURRENT_LIST_DIR}/hip-lang-targets.cmake" )
#get_filename_component cannot resolve the symlinks if called from /opt/rocm/lib/hip
#and do three level up again
# From hip-lang config directory, do three level up
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH)
@@ -91,7 +90,6 @@ find_path(HSA_HEADER hsa/hsa.h
"${_IMPORT_PREFIX}/../include" #FILE_REORG_BACKWARD_COMPATIBILITY
"${_IMPORT_PREFIX}/include"
"${ROCM_PATH}/include"
/opt/rocm/include
)
if (NOT HSA_HEADER)