Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Return double quote on linux + fix CUDA_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
kzhuravl committed Jul 21, 2023
1 parent 1915078 commit 15a3b8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 1 addition & 5 deletions bin/hipcc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
11 changes: 6 additions & 5 deletions bin/hipvars.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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") {
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 15a3b8f

Please sign in to comment.