File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -133,11 +133,7 @@ BEGIN
133
133
$HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME ;
134
134
135
135
sub get_normalized_path {
136
- if ($isWindows ) {
137
- return $doubleQuote . $_ [0] . $doubleQuote ;
138
- } else {
139
- return $_ [0];
140
- }
136
+ return $doubleQuote . $_ [0] . $doubleQuote ;
141
137
}
142
138
143
139
if ($HIP_PLATFORM eq " amd" ) {
Original file line number Diff line number Diff line change @@ -61,10 +61,7 @@ sub can_run {
61
61
}
62
62
63
63
$isWindows = ($^O eq ' MSWin32' or $^O eq ' msys' );
64
- $doubleQuote = " " ;
65
- if ($isWindows ) {
66
- $doubleQuote = " \" " ;
67
- }
64
+ $doubleQuote = " \" " ;
68
65
69
66
#
70
67
# TODO: Fix rpath LDFLAGS settings
@@ -90,6 +87,10 @@ if (-e "$HIP_PATH/bin/rocm_agent_enumerator") {
90
87
$ROCM_PATH =$ENV {' ROCM_PATH' } // " /opt/rocm" ;
91
88
}
92
89
$CUDA_PATH =$ENV {' CUDA_PATH' } // ' /usr/local/cuda' ;
90
+ if ($isWindows and defined $ENV {' CUDA_PATH' }) {
91
+ $CUDA_PATH =~ s / ^"(.*)"$/ $1 / ;
92
+ $CUDA_PATH =~ s /\\ / \/ / g ;
93
+ }
93
94
94
95
# Windows/Distro's have a different structure, all binaries are with hipcc
95
96
if ($isWindows or -e " $HIP_PATH /bin/clang" ) {
@@ -130,7 +131,7 @@ if (defined $HIP_RUNTIME and $HIP_RUNTIME eq "rocclr" and !defined $HIP_ROCCLR_H
130
131
if (not defined $HIP_PLATFORM ) {
131
132
if (can_run($doubleQuote . " $HIP_CLANG_PATH /clang++" . $doubleQuote ) or can_run(" clang++" )) {
132
133
$HIP_PLATFORM = " amd" ;
133
- } elsif (can_run(" $CUDA_PATH /bin/nvcc" ) or can_run(" nvcc" )) {
134
+ } elsif (can_run($doubleQuote . " $CUDA_PATH /bin/nvcc" . $doubleQuote ) or can_run(" nvcc" )) {
134
135
$HIP_PLATFORM = " nvidia" ;
135
136
$HIP_COMPILER = " nvcc" ;
136
137
$HIP_RUNTIME = " cuda" ;
You can’t perform that action at this time.
0 commit comments