hipcc defaults to code object v3 (#1298)

Change-Id: I272ec61090fa504d631fb54371a73dd6fd17a167
This commit is contained in:
Maneesh Gupta
2019-10-04 13:35:21 +05:30
committato da GitHub
parent dcf70ff9a2
commit d39a2a0749
+23
Vedi File
@@ -337,6 +337,7 @@ my $runCmd = 1;
my $buildDeps = 0;
my $linkType = 1;
my $setLinkType = 0;
my $coFormatv3 = 1;
my @options = ();
my @inputs = ();
@@ -456,6 +457,22 @@ foreach $arg (@ARGV)
$swallowArg = 1;
}
# code object format parsing
if ($trimarg eq '-mcode-object-v3') {
$coFormatv3 = 1;
# hip-clang already recognizes -mcode-object-v3, so we just pass it on
if ($HIP_PLATFORM eq 'hcc') {
$swallowArg = 1;
}
}
if ($trimarg eq '-mno-code-object-v3') {
$coFormatv3 = 0;
# hip-clang already recognizes -mno-code-object-v3, so we just pass it on
if ($HIP_PLATFORM eq 'hcc') {
$swallowArg = 1;
}
}
if (($arg =~ /--genco/) and $HIP_PLATFORM eq 'clang' ) {
$arg = "--cuda-device-only";
}
@@ -831,6 +848,12 @@ if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
}
}
# 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 .= " -Wl,-hcc-cov3 ";
}
if ($hasC and $HIP_PLATFORM eq 'nvcc') {
$HIPCXXFLAGS .= " -x cu";
}