diff --git a/bin/hipcc.pl b/bin/hipcc.pl index a70afd3..546cea7 100755 --- a/bin/hipcc.pl +++ b/bin/hipcc.pl @@ -133,11 +133,7 @@ BEGIN $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME; sub get_normalized_path { - if ($isWindows) { - return $doubleQuote . $_[0] . $doubleQuote; - } else { - return $_[0]; - } + return $doubleQuote . $_[0] . $doubleQuote; } if ($HIP_PLATFORM eq "amd") { diff --git a/bin/hipvars.pm b/bin/hipvars.pm index ec0918e..c0eae86 100644 --- a/bin/hipvars.pm +++ b/bin/hipvars.pm @@ -61,10 +61,7 @@ sub can_run { } $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); -$doubleQuote = ""; -if ($isWindows) { - $doubleQuote = "\""; -} +$doubleQuote = "\""; # # TODO: Fix rpath LDFLAGS settings @@ -90,6 +87,10 @@ if (-e "$HIP_PATH/bin/rocm_agent_enumerator") { $ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm"; } $CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda'; +if ($isWindows and defined $ENV{'CUDA_PATH'}) { + $CUDA_PATH =~ s/^"(.*)"$/$1/; + $CUDA_PATH =~ s/\\/\//g; +} # Windows/Distro's have a different structure, all binaries are with hipcc 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 if (not defined $HIP_PLATFORM) { if (can_run($doubleQuote . "$HIP_CLANG_PATH/clang++" . $doubleQuote) or can_run("clang++")) { $HIP_PLATFORM = "amd"; - } elsif (can_run("$CUDA_PATH/bin/nvcc") or can_run("nvcc")) { + } elsif (can_run($doubleQuote . "$CUDA_PATH/bin/nvcc" . $doubleQuote) or can_run("nvcc")) { $HIP_PLATFORM = "nvidia"; $HIP_COMPILER = "nvcc"; $HIP_RUNTIME = "cuda";