From ef68f2f293a33860941a335057a6c00bb05a8a94 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Thu, 11 Aug 2016 15:31:24 -0500 Subject: [PATCH] Change hipcc to take HCC_HOME from hipconfig by default 1. Current implementation checks both env var and value in hipconfig and reports error 2. New implementation gives value in hipconfig with highest priority 3. If hipconfig is not present, fall back to env variables. To Devs: No need to switch between environment variables for different HCC + different HIP. Change-Id: I6cdf37e1429d7f07be3a68c7e5ba1533d832962b --- bin/hipcc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/hipcc b/bin/hipcc index 1e5322b176..5a176dd338 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -69,10 +69,13 @@ if ($HIP_PLATFORM eq "hcc") { $HSA_PATH=$ENV{'HSA_PATH'}; $HSA_PATH="/opt/rocm/hsa" unless defined $HSA_PATH; - $HCC_HOME=$ENV{'HCC_HOME'}; - $HCC_HOME="/opt/rocm/hcc" unless defined $HCC_HOME; - $HCC_VERSION=`${HCC_HOME}/bin/hcc --version | cut -d" " -f9 | tr -d "\n"`; - + if($hipConfig{'VALID'} == 0){ + $HCC_HOME=$ENV{'HCC_HOME'}; + $HCC_HOME="/opt/rocm/hcc" unless defined $HCC_HOME; + $HCC_VERSION=`${HCC_HOME}/bin/hcc --version | cut -d" " -f9 | tr -d "\n"`; + }else{ + $HCC_HOME=$hipConfig{'HCC_HOME'}; + } $ROCM_PATH=$ENV{'ROCM_PATH'}; $ROCM_PATH="/opt/rocm" unless defined $ROCM_PATH;