-
Notifications
You must be signed in to change notification settings - Fork 3
/
hipcc
executable file
·570 lines (501 loc) · 17.5 KB
/
hipcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
#!/usr/bin/perl -w
# Need perl > 5.10 to use logic-defined or
use 5.006; use v5.10.1;
use File::Basename;
# HIP compiler driver
# Will call NVCC or HCC (depending on target) and pass the appropriate include and library options for
# the target compiler and HIP infrastructure.
# Will pass-through options to the target compiler. The tools calling HIPCC must ensure the compiler
# options are appropriate for the target compiler.
# Environment variable HIP_PLATFORM control compilation path:
# HIP_PLATFORM='nvcc' or HIP_PLATFORM='hcc'.
# If HIP_PLATFORM is not set hipcc will attempt auto-detect based on if nvcc is found.
#
# Other environment variable controls:
# HIP_PATH : Path to HIP directory, default is one dir level above location of this script
# CUDA_PATH : Path to CUDA SDK (default /usr/local/cuda). Used on NVIDIA platforms only.
# HCC_HOME : Path to HCC SDK (default /opt/rocm/hcc). Used on AMD platforms only.
# HSA_PATH : Path to HSA dir (default /opt/rocm/hsa). Used on AMD platforms only.
if(scalar @ARGV == 0){
print "No Arguments passed, exiting ...\n";
exit(-1);
}
#---
# Function to parse config file
sub parse_config_file {
my ($file, $config) = @_;
if (open (CONFIG, "$file")) {
while (<CONFIG>) {
my $config_line=$_;
chop ($config_line);
$config_line =~ s/^\s*//;
$config_line =~ s/\s*$//;
if (($config_line !~ /^#/) && ($config_line ne "")) {
my ($name, $value) = split (/=/, $config_line);
$$config{$name} = $value;
}
}
close(CONFIG);
}
}
$verbose = $ENV{'HIPCC_VERBOSE'} // 0;
# Verbose: 0x1=commands, 0x2=paths, 0x4=hipcc args
$HIP_PATH=$ENV{'HIP_PATH'} // dirname (dirname $0); # use parent directory of hipcc
$HIP_CLANG_PATH=$ENV{'HIP_CLANG_PATH'};
$DEVICE_LIB_PATH=$ENV{'DEVICE_LIB_PATH'};
#---
# Read .hipInfo
my %hipConfig = ();
parse_config_file("$HIP_PATH/lib/.hipInfo", \%hipConfig);
#---
#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
$HIP_PLATFORM= `$HIP_PATH/bin/hipconfig --platform` // "hcc";
$HIP_VERSION= `$HIP_PATH/bin/hipconfig --version`;
($HIP_VERSION_MAJOR, $HIP_VERSION_MINOR, $HIP_VERSION_PATCH) = split(/\./, $HIP_VERSION);
if (defined $HIP_CLANG_PATH) {
$HIP_PLATFORM = "clang"
}
if ($verbose & 0x2) {
print ("HIP_PATH=$HIP_PATH\n");
print ("HIP_PLATFORM=$HIP_PLATFORM\n");
}
# set if user explicitly requests -stdlib=libc++. (else we default to libstdc++ for better interop with g++):
$setStdLib = 0; # TODO - set to 0
$target_gfx701 = 0;
$target_gfx801 = 0;
$target_gfx802 = 0;
$target_gfx803 = 0;
$target_gfx900 = 0;
$target_gfx906 = 0;
$default_amdgpu_target = 1;
if ($HIP_PLATFORM eq "clang") {
if ($verbose & 0x2) {
print ("HIP_CLANG_PATH=$HIP_CLANG_PATH\n");
}
$ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm";
$HIPCC="$HIP_CLANG_PATH/clang++";
#$HIPCXXFLAGS .= "-std=c++11 -I$HIP_PATH/include";
$HIPLDFLAGS = "--hip-link --hip-device-lib-path=$DEVICE_LIB_PATH -L$HIP_PATH/lib -lhip_hcc";
} elsif ($HIP_PLATFORM eq "hcc") {
$HSA_PATH=$ENV{'HSA_PATH'} // "/opt/rocm/hsa";
$HCC_HOME=$ENV{'HCC_HOME'} // $hipConfig{'HCC_HOME'} // "/opt/rocm/hcc";
$HCC_VERSION=`${HCC_HOME}/bin/hcc --version`;
$HCC_VERSION=~/.*based on HCC ([^ ]+).*/;
$HCC_VERSION=$1;
$HCC_VERSION_MAJOR=$HCC_VERSION;
$HCC_VERSION_MAJOR=~s/\..*//;
$ROCM_PATH=$ENV{'ROCM_PATH'} // "/opt/rocm";
$HIP_ATP_MARKER=$ENV{'HIP_ATP_MARKER'} // 1;
$marker_path = "$ROCM_PATH/profiler/CXLActivityLogger";
# HCC* may be used to compile src/hip_hcc.o (and also feed the HIPCXXFLAGS below)
$HCC = "$HCC_HOME/bin/hcc";
#$HCCFLAGS = "-hc -D__HIPCC__ -I$HCC_HOME/include ";
$HCCFLAGS = "-hc -D__HIPCC__";
$HIPCC=$HCC;
$HIPCXXFLAGS = $HCCFLAGS;
$HIPLDFLAGS = `${HCC_HOME}/bin/hcc-config --ldflags`;
#### GCC system includes workaround ####
$HCC_WA_FLAGS = " ";
$HOST_OSNAME= `cat /etc/os-release | grep "^ID\=" | cut -d= -f2 | tr -d '\n'`;
if ($HCC_VERSION_MAJOR eq 1) {
my $GCC_CUR_VER = `gcc -dumpversion`;
my $GPP_CUR_VER = `g++ -dumpversion`;
$GCC_CUR_VER =~ s/\R//g;
$GPP_CUR_VER =~ s/\R//g;
my @GPP_VER_FIELDS = split('\.', $GPP_CUR_VER);
# Only include the libstdc++ headers and libraries flags explicitly if the g++ is older than version 5.
# That's because HCC already uses libstdc++ by default if a newer g++/libstdc++ is available
# Cent OS 7 and RHEL 7.4 cannot use libstdc++ for compilation, default to libc++
if (${GCC_CUR_VER} eq ${GPP_CUR_VER} and $GPP_VER_FIELDS[0] < 5 and ($HOST_OSNAME ne "\"centos\"") and ($HOST_OSNAME ne "\"rhel\"")) {
$HCC_WA_FLAGS .= " -stdlib=libstdc++ -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu/c++/${GCC_CUR_VER} -I/usr/include/c++/${GCC_CUR_VER} ";
# Add C++ libs for GCC.
$HIPLDFLAGS .= " -lstdc++";
}
}
# Force -stdlib=libc++ on UB14.04
$HOST_OSVER= `cat /etc/os-release | grep "^VERSION_ID\=" | cut -d= -f2 | tr -d '\n'`;
if ($HOST_OSNAME eq "ubuntu" and $HOST_OSVER eq "\"14.04\"") {
$HIPCXXFLAGS .= " -stdlib=libc++";
$setStdLib = 1;
}
#$HIPCXXFLAGS .= " -I$HIP_PATH/include/hip/hcc_detail/cuda";
#$HIPCXXFLAGS .= " -I$HSA_PATH/include";
$HIPCXXFLAGS .= " -Wno-deprecated-register";
$HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am -lhsakmt ";
# $HIPLDFLAGS .= " -L$HCC_HOME/compiler/lib -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMMC -lLLVMCore -lLLVMSupport ";
# Add trace marker library:
# TODO - once we cleanly separate the HIP API headers from HIP library headers this logic should move to CMakebuild option - apps do not need to see the marker library.
if ($HIP_ATP_MARKER) {
$marker_inc_path = "$marker_path/include";
if (-e $marker_inc_path) {
$HIPCXXFLAGS .= " -I$marker_inc_path";
}
}
$marker_lib_path = "$marker_path/bin/x86_64";
if (-e $marker_lib_path) {
$HIPLDFLAGS .= " -L$marker_lib_path -lCXLActivityLogger -Wl,--rpath=$marker_lib_path";
}
$HIPLDFLAGS .= " -lm";
if ($verbose & 0x2) {
print ("HSA_PATH=$HSA_PATH\n");
print ("HCC_HOME=$HCC_HOME\n");
}
} elsif ($HIP_PLATFORM eq "nvcc") {
if ($verbose & 0x2) {
print ("CUDA_PATH=$CUDA_PATH\n");
}
$CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda';
$HIPCC="$CUDA_PATH/bin/nvcc";
$HIPCXXFLAGS .= " -Wno-deprecated-gpu-targets ";
$HIPCXXFLAGS .= " -I$CUDA_PATH/include";
$HIPLDFLAGS = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L$CUDA_PATH/lib64";
} else {
printf ("error: unknown HIP_PLATFORM = '$HIP_PLATFORM'");
exit (-1);
}
# Add paths to common HIP includes:
#$HIPCXXFLAGS .= " -I$HIP_PATH/include -DHIP_VERSION_MAJOR=$HIP_VERSION_MAJOR -DHIP_VERSION_MINOR=$HIP_VERSION_MINOR -DHIP_VERSION_PATCH=$HIP_VERSION_PATCH" ;
$HIPCXXFLAGS .= " -DHIP_VERSION_MAJOR=$HIP_VERSION_MAJOR -DHIP_VERSION_MINOR=$HIP_VERSION_MINOR -DHIP_VERSION_PATCH=$HIP_VERSION_PATCH" ;
my $compileOnly = 0;
my $needCXXFLAGS = 0; # need to add CXX flags to compile step
my $needLDFLAGS = 1; # need to add LDFLAGS to compile step.
my $hasC = 0; # options contain a c-style file (NVCC must force recognition as GPU file)
my $hasCU = 0; # options contain a cu-style file (HCC must force recognition as GPU file)
my $needHipHcc = ($HIP_PLATFORM eq 'hcc'); # set if we need to link hip_hcc.o from src tree. (some builds, ie cmake, provide their own)
my $printHipVersion = 0; # print HIP version
my $runCmd = 1;
my $buildDeps = 0;
my $linkType = 1;
my $setLinkType = 0;
my @options = ();
my @inputs = ();
if ($verbose & 0x4) {
print "hipcc-args: ", join (" ", @ARGV), "\n";
}
# Handle code object generation
my $ISACMD="";
if($HIP_PLATFORM eq "hcc"){
$ISACMD .= "$HIP_PATH/bin/lpl ";
if($ARGV[0] eq "--genco"){
foreach $isaarg (@ARGV[1..$#ARGV]){
$ISACMD .= " ";
$ISACMD .= $isaarg;
}
if ($verbose & 0x1) {
print "hipcc-cmd: ", $ISACMD, "\n";
}
system($ISACMD) and die();
exit(0);
}
}
if(($HIP_PLATFORM eq "hcc")){
$ENV{HCC_EXTRA_LIBRARIES}="$HIP_PATH/lib/hip_hc.ll\n";
$ENV{HIP_HC_IR_FILE}="";
}
if($HIP_PLATFORM eq "nvcc"){
$ISACMD .= "$HIP_PATH/bin/hipcc -ptx ";
if($ARGV[0] eq "--genco"){
foreach $isaarg (@ARGV[1..$#ARGV]){
$ISACMD .= " ";
$ISACMD .= $isaarg;
}
if ($verbose & 0x1) {
print "hipcc-cmd: ", $ISACMD, "\n";
}
system($ISACMD) and die();
exit(0);
}
}
my $toolArgs = ""; # arguments to pass to the hcc or nvcc tool
foreach $arg (@ARGV)
{
$trimarg = $arg;
$trimarg =~ s/^\s+|\s+$//g; # Remive whitespace
my $swallowArg = 0;
if ($arg eq '-c') {
$compileOnly = 1;
$needCXXFLAGS = 1;
$needLDFLAGS = 0;
}
if ($arg eq '-o') {
$needLDFLAGS = 1;
}
if(($trimarg eq '-stdlib=libc++') and ($setStdLib eq 0))
{
$HIPCXXFLAGS .= " -stdlib=libc++";
$setStdLib = 1;
}
# TODO: Add support for comma separated list like HCC_AMDGPU_TARGET
if($arg eq '--amdgpu-target=gfx701')
{
$target_gfx701 = 1;
$default_amdgpu_target = 0;
}
if($arg eq '--amdgpu-target=gfx801')
{
$target_gfx801 = 1;
$default_amdgpu_target = 0;
}
if($arg eq '--amdgpu-target=gfx802')
{
$target_gfx802 = 1;
$default_amdgpu_target = 0;
}
if($arg eq '--amdgpu-target=gfx803')
{
$target_gfx803 = 1;
$default_amdgpu_target = 0;
}
if($arg eq '--amdgpu-target=gfx900')
{
$target_gfx900 = 1;
$default_amdgpu_target = 0;
}
if($arg eq '--amdgpu-target=gfx906')
{
$target_gfx906 = 1;
$default_amdgpu_target = 0;
}
# hip-clang does not accept --amdgpu-target= options.
if (($arg =~ /--amdgpu-target=/) and $HIP_PLATFORM eq 'clang' ) {
$swallowArg = 1;
}
if(($trimarg eq '-stdlib=libstdc++') and ($setStdLib eq 0))
{
$HIPCXXFLAGS .= $HCC_WA_FLAGS;
$setStdLib = 1;
}
if($trimarg eq '--version') {
$printHipVersion = 1;
}
if($trimarg eq '--short-version') {
$printHipVersion = 1;
$runCmd = 0;
}
if($trimarg eq '-M') {
$compileOnly = 1;
$buildDeps = 1;
}
if($trimarg eq '-use_fast_math') {
$HIPCXXFLAGS .= " -DHIP_FAST_MATH ";
}
if(($trimarg eq '-use-staticlib') and ($setLinkType eq 0))
{
$linkType = 0;
$setLinkType = 1;
}
if(($trimarg eq '-use-sharedlib') and ($setLinkType eq 0))
{
$linkType = 1;
$setLinkType = 1;
}
if ($arg =~ m/^-/) {
# options start with -
# Process HIPCC options here:
if ($arg =~ m/^--hipcc/) {
$swallowArg = 1;
#if $arg eq "--hipcc_profile") { # Example argument here, hipcc
#
#}
} else {
push (@options, $arg);
}
#print "O: <$arg>\n";
} else {
# input files and libraries
if (($arg =~ /\.cpp$/) or ($arg =~ /\.c$/) or ($arg =~ /\.cc$/) ) {
$hasC = 1;
$needCXXFLAGS = 1;
if ($HIP_PLATFORM eq 'clang') {
$toolArgs .= " -x hip"
}
}
if (($arg =~ /\.cu$/) or ($arg =~ /\.cuh$/)) {
$hasCU = 1;
$needCXXFLAGS = 1;
if ($HIP_PLATFORM eq 'clang') {
$toolArgs .= " -x hip"
}
}
push (@inputs, $arg);
#print "I: <$arg>\n";
}
$toolArgs .= " $arg" unless $swallowArg;
}
if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
# No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET
if($default_amdgpu_target eq 1 and defined $ENV{HCC_AMDGPU_TARGET})
{
foreach my $target (split(/,/, $ENV{HCC_AMDGPU_TARGET}))
{
if($target eq 'gfx701')
{
$target_gfx701 = 1;
$default_amdgpu_target = 0;
}
if($target eq 'gfx801')
{
$target_gfx801 = 1;
$default_amdgpu_target = 0;
}
if($target eq 'gfx802')
{
$target_gfx802 = 1;
$default_amdgpu_target = 0;
}
if($target eq 'gfx803')
{
$target_gfx803 = 1;
$default_amdgpu_target = 0;
}
if($target eq 'gfx900')
{
$target_gfx900 = 1;
$default_amdgpu_target = 0;
}
if($target eq 'gfx906')
{
$target_gfx906 = 1;
$default_amdgpu_target = 0;
}
}
}
# Else try using rocm_agent_enumerator
if($default_amdgpu_target eq 1)
{
$ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
my $myAgents = `${ROCM_AGENT_ENUM} -t GPU`;
my @agentsLine = split('\n', $myAgents);
foreach my $val (@agentsLine) {
if($val eq "gfx701") {
$target_gfx701 = 1;
$default_amdgpu_target = 0;
}
if($val eq "gfx801") {
$target_gfx801 = 1;
$default_amdgpu_target = 0;
}
if($val eq "gfx802") {
$target_gfx802 = 1;
$default_amdgpu_target = 0;
}
if($val eq "gfx803") {
$target_gfx803 = 1;
$default_amdgpu_target = 0;
}
if($val eq "gfx900") {
$target_gfx900 = 1;
$default_amdgpu_target = 0;
}
if($val eq "gfx906") {
$target_gfx906 = 1;
$default_amdgpu_target = 0;
}
}
}
# rocm_agent_enumerator failed! Throw an error and die if linking is required
if ($default_amdgpu_target eq 1 and $compileOnly eq 0)
{
print "No valid AMD GPU target was either specified or found. Please specify a valid target using --amdgpu-target=" and die();
}
$ENV{HCC_EXTRA_LIBRARIES}="$HIP_PATH/lib/hip_hc.ll\n";
if($HIP_PLATFORM eq "hcc") {
$GPU_ARCH_OPT = " --amdgpu-target=";
} else {
$GPU_ARCH_OPT = " --cuda-gpu-arch=";
}
# Handle ROCm target platform
if ($target_gfx701 eq 1) {
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx701";
$HIPLDFLAGS .= $GPU_ARCH_ARG;
if ($HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
}
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX701__=1 ";
}
if ($target_gfx801 eq 1) {
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx801";
$HIPLDFLAGS .= $GPU_ARCH_ARG;
if ($HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
}
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX801__=1 ";
}
if ($target_gfx802 eq 1) {
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx802";
$HIPLDFLAGS .= $GPU_ARCH_ARG;
if ($HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
}
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX802__=1 ";
}
if ($target_gfx803 eq 1) {
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx803";
$HIPLDFLAGS .= $GPU_ARCH_ARG;
if ($HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
}
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX803__=1 ";
}
if ($target_gfx900 eq 1) {
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx900";
$HIPLDFLAGS .= $GPU_ARCH_ARG;
if ($HIP_PLATFORM eq 'clang') {
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
}
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX900__=1 ";
}
if ($target_gfx906 eq 1) {
$HIPLDFLAGS .= " --amdgpu-target=gfx906";
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX906__=1 ";
}
}
if ($hasC and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -x cu";
}
if ($hasCU and $HIP_PLATFORM eq 'hcc') {
$HIPCXXFLAGS .= " -x c++";
}
if ($buildDeps and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -M -D__CUDACC__";
}
if ($setStdLib eq 0 and $HIP_PLATFORM eq 'hcc')
{
$HIPCXXFLAGS .= $HCC_WA_FLAGS;
}
if ($needHipHcc) {
if ($linkType eq 0) {
substr($HIPLDFLAGS,0,0) = " $HIP_PATH/lib/libhip_hcc_static.a $HIP_PATH/lib/libhip_device.a " ;
} else {
substr($HIPLDFLAGS,0,0) = " -Wl,--rpath=$HIP_PATH/lib $HIP_PATH/lib/libhip_hcc.so $HIP_PATH/lib/libhip_device.a ";
}
}
# hipcc currrently requires separate compilation of source files, ie it is not possible to pass
# CPP files combined with .O files
# Reason is that NVCC uses the file extension to determine whether to compile in CUDA mode or
# pass-through CPP mode.
my $CMD="$HIPCC";
if ($needCXXFLAGS) {
$CMD .= " $HIPCXXFLAGS";
}
if ($needLDFLAGS and not $compileOnly) {
$CMD .= " $HIPLDFLAGS";
}
$CMD .= " $toolArgs";
if ($verbose & 0x1) {
print "hipcc-cmd: ", $CMD, "\n";
}
if ($printHipVersion) {
if ($runCmd) {
print "HIP version: "
}
print $HIP_VERSION, "\n";
}
if ($runCmd) {
if ($HIP_PLATFORM eq "hcc" and exists($hipConfig{'HCC_VERSION'}) and $HCC_VERSION ne $hipConfig{'HCC_VERSION'}) {
print ("HIP ($HIP_PATH) was built using hcc $hipConfig{'HCC_VERSION'}, but you are using $HCC_HOME/hcc with version $HCC_VERSION from hipcc. Please rebuild HIP including cmake or update HCC_HOME variable.\n") ;
die unless $ENV{'HIP_IGNORE_HCC_VERSION'};
}
system ("$CMD") and die ();
}
# vim: ts=4:sw=4:expandtab:smartindent