From 4adc690374cb9bb064b00904cfabde28a30ee42e Mon Sep 17 00:00:00 2001 From: Freddy Paul Date: Wed, 23 Sep 2020 17:14:04 -0700 Subject: [PATCH] HIP:Break dependency to rocm-dev package Check for rocm_agent_enumerator instead of rocminfo or .info/version. Change-Id: I1718bd4f70b3e527ea3afe19c1a685ab7ed70808 [ROCm/hip commit: 863082c52879d0179ca54a7e5f71e6f4adb00089] --- projects/hip/bin/hipcc | 4 ++-- projects/hip/bin/hipconfig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 74d794f977..eeab8222a0 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -73,11 +73,11 @@ $HIPCC_LINK_FLAGS_APPEND=$ENV{'HIPCC_LINK_FLAGS_APPEND'}; # derive HIP_PATH, as dirname $0 could be /opt/rocm/bin or /opt/rocm/hip/bin # depending on how it gets invoked. # ROCM_PATH which points to is determined based on whether -# we find bin/rocminfo in the parent of HIP_PATH or not. If it is found, +# we find bin/rocm_agent_enumerator in the parent of HIP_PATH or not. If it is found, # ROCM_PATH is defined relative to HIP_PATH else it is hardcoded to /opt/rocm. # $HIP_PATH=$ENV{'HIP_PATH'} // dirname(Cwd::abs_path("$0/../")); # use parent directory of hipcc -if (-e "$HIP_PATH/../bin/rocminfo") { +if (-e "$HIP_PATH/../bin/rocm_agent_enumerator") { $ROCM_PATH=$ENV{'ROCM_PATH'} // dirname("$HIP_PATH"); # use parent directory of HIP_PATH } else { $ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm"; diff --git a/projects/hip/bin/hipconfig b/projects/hip/bin/hipconfig index 7a4986493c..13dbea68a5 100755 --- a/projects/hip/bin/hipconfig +++ b/projects/hip/bin/hipconfig @@ -80,7 +80,7 @@ sub can_run { # Define HIP_PATH based on location of the script. Same as hipcc. # Derive ROCM_PATH same as hipcc does. Others are relative to ROCM_PATH. $HIP_PATH=$ENV{'HIP_PATH'} // dirname(Cwd::abs_path("$0/../")); # use parent directory of hipcc -if (-e "$HIP_PATH/../.info/version") { +if (-e "$HIP_PATH/../bin/rocm_agent_enumerator") { $ROCM_PATH=$ENV{'ROCM_PATH'} // dirname("$HIP_PATH"); # use parent directory of HIP_PATH } else { $ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm";