Enable code object v3 codgen when compiling with HCC (#1836)

Change-Id: I590c05a418cc37ec247b89124cef17a7fe8b27e2
This commit is contained in:
Siu Chi Chan
2020-02-05 10:26:33 -05:00
committed by GitHub
parent fa363ae721
commit 713702eebc
+16
View File
@@ -346,6 +346,7 @@ my $runCmd = 1;
my $buildDeps = 0;
my $linkType = 1;
my $setLinkType = 0;
my $coFormatv3 = 1;
my @options = ();
my @inputs = ();
@@ -427,6 +428,14 @@ foreach $arg (@ARGV)
}
}
# code object format parsing
if ($trimarg eq '-mcode-object-v3') {
$coFormatv3 = 1;
}
if ($trimarg eq '-mno-code-object-v3') {
$coFormatv3 = 0;
}
if (($arg =~ /--genco/) and $HIP_PLATFORM eq 'clang' ) {
$arg = "--cuda-device-only";
}
@@ -671,6 +680,13 @@ if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
$ENV{HCC_EXTRA_LIBRARIES}="\n";
}
# hcc defaults to v2, so we need to convert to the appropriate flag
# hip-clang defaults to v3, so we don't need to do anything
if ($coFormatv3 and $HIP_PLATFORM eq 'hcc') {
$HIPLDFLAGS .= " -mcode-object-v3";
$HIPCXXFLAGS .= " -mcode-object-v3";
}
if ($hasC and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -x cu";
}