SWDEV-343493 - hipcc ignores --rocm-path if env var such as ROCM_PATH is set (#2974)

Change-Id: I5723694158f35b73dc0c93e9dd9ee6666df1ca72

[ROCm/hip commit: 825225b232]
Cette révision appartient à :
ROCm CI Service Account
2022-10-10 15:25:37 +05:30
révisé par GitHub
Parent 3528b35e47
révision 618185c951
+20 -1
Voir le fichier
@@ -52,6 +52,19 @@ if(scalar @ARGV == 0){
exit(-1);
}
# retrieve --rocm-path hipcc option from command line.
# We need to respect this over the env var ROCM_PATH for this compilation.
sub get_rocm_path_option {
my $rocm_path="";
my @CLArgs = @ARGV;
foreach $arg (@CLArgs) {
if (index($arg,"--rocm-path=") != -1) {
($rocm_path) = $arg=~ /=\s*(.*)\s*$/;
}
}
return $rocm_path;
}
$verbose = $ENV{'HIPCC_VERBOSE'} // 0;
# Verbose: 0x1=commands, 0x2=paths, 0x4=hipcc args
@@ -88,12 +101,18 @@ sub delete_temp_dirs {
}
my $base_dir;
my $rocmPath;
BEGIN {
$base_dir = dirname(Cwd::realpath(__FILE__) );
$rocmPath = get_rocm_path_option();
if ($rocmPath ne '') {
# --rocm-path takes precedence over ENV{ROCM_PATH}
$ENV{ROCM_PATH}=$rocmPath;
}
}
use lib "$base_dir/";
use hipvars;
use hipvars;
$isWindows = $hipvars::isWindows;
$HIP_RUNTIME = $hipvars::HIP_RUNTIME;
$HIP_PLATFORM = $hipvars::HIP_PLATFORM;