Commit b6ec0c8 1 parent 9b1caa6 commit b6ec0c8 Copy full SHA for b6ec0c8
File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 52
52
exit (-1);
53
53
}
54
54
55
+ # retrieve --rocm-path hipcc option from command line.
56
+ # We need to respect this over the env var ROCM_PATH for this compilation.
57
+ sub get_rocm_path_option {
58
+ my $rocm_path =" " ;
59
+ my @CLArgs = @ARGV ;
60
+ foreach $arg (@CLArgs ) {
61
+ if (index ($arg ," --rocm-path=" ) != -1) {
62
+ ($rocm_path ) = $arg =~ / =\s *(.*)\s *$ / ;
63
+ }
64
+ }
65
+ return $rocm_path ;
66
+ }
67
+
55
68
$verbose = $ENV {' HIPCC_VERBOSE' } // 0;
56
69
# Verbose: 0x1=commands, 0x2=paths, 0x4=hipcc args
57
70
@@ -88,12 +101,18 @@ sub delete_temp_dirs {
88
101
}
89
102
90
103
my $base_dir ;
104
+ my $rocmPath ;
91
105
BEGIN {
92
106
$base_dir = dirname(Cwd::realpath(__FILE__ ) );
107
+ $rocmPath = get_rocm_path_option();
108
+ if ($rocmPath ne ' ' ) {
109
+ # --rocm-path takes precedence over ENV{ROCM_PATH}
110
+ $ENV {ROCM_PATH }=$rocmPath ;
111
+ }
93
112
}
94
113
use lib " $base_dir /" ;
95
- use hipvars;
96
114
115
+ use hipvars;
97
116
$isWindows = $hipvars::isWindows ;
98
117
$HIP_RUNTIME = $hipvars::HIP_RUNTIME ;
99
118
$HIP_PLATFORM = $hipvars::HIP_PLATFORM ;
You can’t perform that action at this time.
0 commit comments