Skip to content

Commit f17718a

Browse files
committed
Promote develop branch (as of 7ea6313) to mainline
2 parents fb3ee7b + 7ea6313 commit f17718a

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

amd/hipcc/bin/hipcc.pl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ BEGIN
121121

122122
use hipvars;
123123
$isWindows = $hipvars::isWindows;
124+
$doubleQuote = $hipvars::doubleQuote;
124125
$HIP_RUNTIME = $hipvars::HIP_RUNTIME;
125126
$HIP_PLATFORM = $hipvars::HIP_PLATFORM;
126127
$HIP_COMPILER = $hipvars::HIP_COMPILER;
@@ -131,6 +132,10 @@ BEGIN
131132
$HIP_VERSION = $hipvars::HIP_VERSION;
132133
$HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
133134

135+
sub get_normalized_path {
136+
return $doubleQuote . $_[0] . $doubleQuote;
137+
}
138+
134139
if ($HIP_PLATFORM eq "amd") {
135140
$HIP_INCLUDE_PATH = "$HIP_ROCCLR_HOME/include";
136141
if (!defined $HIP_LIB_PATH) {
@@ -155,17 +160,17 @@ BEGIN
155160
if($isWindows) {
156161
$execExtension = ".exe";
157162
}
158-
$HIPCC="\"$HIP_CLANG_PATH/clang++" . $execExtension . "\"";
163+
$HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang++" . $execExtension);
159164

160165
# If $HIPCC clang++ is not compiled, use clang instead
161166
if ( ! -e $HIPCC ) {
162-
$HIPCC="\"$HIP_CLANG_PATH/clang" . $execExtension . "\"";
167+
$HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang" . $execExtension);
163168
$HIPLDFLAGS = "--driver-mode=g++";
164169
}
165170
# to avoid using dk linker or MSVC linker
166171
if($isWindows) {
167172
$HIPLDFLAGS .= " -fuse-ld=lld";
168-
$HIPLDFLAGS .= " --ld-path=\"$HIP_CLANG_PATH/lld-link.exe\"";
173+
$HIPLDFLAGS .= " --ld-path=" . get_normalized_path("$HIP_CLANG_PATH/lld-link.exe");
169174
}
170175

171176
# get Clang RT Builtin path
@@ -201,21 +206,21 @@ BEGIN
201206
print ("CUDA_PATH=$CUDA_PATH\n");
202207
}
203208

204-
$HIPCC="\"$CUDA_PATH/bin/nvcc\"";
209+
$HIPCC=get_normalized_path("$CUDA_PATH/bin/nvcc");
205210
$HIPCXXFLAGS .= " -Wno-deprecated-gpu-targets ";
206-
$HIPCXXFLAGS .= " -isystem \"$CUDA_PATH/include\"";
207-
$HIPCFLAGS .= " -isystem \"$CUDA_PATH/include\"";
211+
$HIPCXXFLAGS .= " -isystem " . get_normalized_path("$CUDA_PATH/include");
212+
$HIPCFLAGS .= " -isystem " . get_normalized_path("$CUDA_PATH/include");
208213

209-
$HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L\"$CUDA_PATH/lib64\"";
214+
$HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L" . get_normalized_path("$CUDA_PATH/lib64");
210215
} else {
211216
printf ("error: unknown HIP_PLATFORM = '$HIP_PLATFORM'");
212217
printf (" or HIP_COMPILER = '$HIP_COMPILER'");
213218
exit (-1);
214219
}
215220

216221
# Add paths to common HIP includes:
217-
$HIPCXXFLAGS .= " -isystem \"$HIP_INCLUDE_PATH\"" ;
218-
$HIPCFLAGS .= " -isystem \"$HIP_INCLUDE_PATH\"" ;
222+
$HIPCXXFLAGS .= " -isystem " . get_normalized_path("$HIP_INCLUDE_PATH");
223+
$HIPCFLAGS .= " -isystem " . get_normalized_path("$HIP_INCLUDE_PATH");
219224

220225
my $compileOnly = 0;
221226
my $needCXXFLAGS = 0; # need to add CXX flags to compile step
@@ -294,7 +299,7 @@ BEGIN
294299

295300
if ($skipOutputFile) {
296301
# TODO: handle filename with shell metacharacters
297-
$toolArgs .= " \"$arg\"";
302+
$toolArgs .= " " . get_normalized_path("$arg");
298303
$prevArg = $arg;
299304
$skipOutputFile = 0;
300305
next;
@@ -466,7 +471,7 @@ BEGIN
466471
if (not $isWindows and $escapeArg) {
467472
$arg =~ s/[^-a-zA-Z0-9_=+,.\/]/\\$&/g;
468473
}
469-
$toolArgs .= " \"$arg\"" unless $swallowArg;
474+
$toolArgs .= " $arg" unless $swallowArg;
470475
$prevArg = $arg;
471476
}
472477

@@ -561,14 +566,14 @@ BEGIN
561566

562567
# If the HIP_PATH env var is defined, pass that path to Clang
563568
if ($ENV{'HIP_PATH'}) {
564-
my $hip_path_flag = " --hip-path=\"$HIP_PATH\"";
569+
my $hip_path_flag = " --hip-path=" . get_normalized_path("$HIP_PATH");
565570
$HIPCXXFLAGS .= $hip_path_flag;
566571
$HIPLDFLAGS .= $hip_path_flag;
567572
}
568573

569574
if ($hasHIP) {
570575
if (defined $DEVICE_LIB_PATH) {
571-
$HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\"";
576+
$HIPCXXFLAGS .= " --hip-device-lib-path=" . get_normalized_path("$DEVICE_LIB_PATH");
572577
}
573578
}
574579

amd/hipcc/bin/hipvars.pm

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use Cwd;
2626
use File::Basename;
2727

2828
$HIP_BASE_VERSION_MAJOR = "5";
29-
$HIP_BASE_VERSION_MINOR = "5";
29+
$HIP_BASE_VERSION_MINOR = "7";
3030
$HIP_BASE_VERSION_PATCH = "0";
3131

3232
#---
@@ -61,6 +61,7 @@ sub can_run {
6161
}
6262

6363
$isWindows = ($^O eq 'MSWin32' or $^O eq 'msys');
64+
$doubleQuote = "\"";
6465

6566
#
6667
# TODO: Fix rpath LDFLAGS settings
@@ -86,6 +87,10 @@ if (-e "$HIP_PATH/bin/rocm_agent_enumerator") {
8687
$ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm";
8788
}
8889
$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+
}
8994

9095
# Windows/Distro's have a different structure, all binaries are with hipcc
9196
if ($isWindows or -e "$HIP_PATH/bin/clang") {
@@ -124,9 +129,9 @@ if (defined $HIP_RUNTIME and $HIP_RUNTIME eq "rocclr" and !defined $HIP_ROCCLR_H
124129
}
125130

126131
if (not defined $HIP_PLATFORM) {
127-
if (can_run("\"$HIP_CLANG_PATH/clang++\"") or can_run("clang++")) {
132+
if (can_run($doubleQuote . "$HIP_CLANG_PATH/clang++" . $doubleQuote) or can_run("clang++")) {
128133
$HIP_PLATFORM = "amd";
129-
} 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")) {
130135
$HIP_PLATFORM = "nvidia";
131136
$HIP_COMPILER = "nvcc";
132137
$HIP_RUNTIME = "cuda";
@@ -154,7 +159,11 @@ if ($HIP_COMPILER eq "clang") {
154159
#---
155160
# Read .hipVersion
156161
my %hipVersion = ();
157-
parse_config_file("$hipvars::HIP_PATH/bin/.hipVersion", \%hipVersion);
162+
if ($isWindows) {
163+
parse_config_file("$hipvars::HIP_PATH/bin/.hipVersion", \%hipVersion);
164+
} else {
165+
parse_config_file("$hipvars::HIP_PATH/share/hip/version", \%hipVersion);
166+
}
158167
$HIP_VERSION_MAJOR = $hipVersion{'HIP_VERSION_MAJOR'} // $HIP_BASE_VERSION_MAJOR;
159168
$HIP_VERSION_MINOR = $hipVersion{'HIP_VERSION_MINOR'} // $HIP_BASE_VERSION_MINOR;
160169
$HIP_VERSION_PATCH = $hipVersion{'HIP_VERSION_PATCH'} // $HIP_BASE_VERSION_PATCH;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rocm-docs-core==0.14.0
1+
rocm-docs-core==0.19.0

amd/hipcc/docs/.sphinx/requirements.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ jinja2==3.1.2
5050
# via
5151
# myst-parser
5252
# sphinx
53-
linkify-it-py==1.0.3
54-
# via myst-parser
5553
markdown-it-py==2.2.0
5654
# via
5755
# mdit-py-plugins
@@ -62,7 +60,7 @@ mdit-py-plugins==0.3.5
6260
# via myst-parser
6361
mdurl==0.1.2
6462
# via markdown-it-py
65-
myst-parser[linkify]==1.0.0
63+
myst-parser==1.0.0
6664
# via rocm-docs-core
6765
packaging==23.0
6866
# via
@@ -94,7 +92,7 @@ requests==2.28.2
9492
# via
9593
# pygithub
9694
# sphinx
97-
rocm-docs-core==0.14.0
95+
rocm-docs-core==0.19.0
9896
# via -r requirements.in
9997
smmap==5.0.0
10098
# via gitdb
@@ -137,8 +135,6 @@ sphinxcontrib-serializinghtml==1.1.5
137135
# via sphinx
138136
typing-extensions==4.5.0
139137
# via pydata-sphinx-theme
140-
uc-micro-py==1.0.1
141-
# via linkify-it-py
142138
urllib3==1.26.15
143139
# via requests
144140
wrapt==1.15.0

0 commit comments

Comments
 (0)