From 1a8b50e63c8aadd2293a931c7071d983881b854c Mon Sep 17 00:00:00 2001 From: Aaron Enye Shi Date: Fri, 8 Feb 2019 18:29:14 +0000 Subject: [PATCH 1/2] hipcc should consume -mcode-object-v3 flag [ROCm/hip commit: eb33507774444a984e6f8bed9671a0b0e78c7a07] --- projects/hip/bin/hipcc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index d422174ad8..d173d761dd 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -300,6 +300,7 @@ my $runCmd = 1; my $buildDeps = 0; my $linkType = 1; my $setLinkType = 0; +my $useCodeObjectV3 = 0; my @options = (); my @inputs = (); @@ -403,6 +404,10 @@ foreach $arg (@ARGV) $swallowArg = 1; } + if (($trimarg eq '-mcode-object-v3') and ($HIP_PLATFORM eq 'clang') ) { + $useCodeObjectV3 = 1; + } + if (($arg =~ /--genco/) and $HIP_PLATFORM eq 'clang' ) { $arg = "--cuda-device-only"; } @@ -736,6 +741,12 @@ if ($buildDeps and $HIP_PLATFORM eq 'clang') { $HIPCXXFLAGS .= " --cuda-host-only"; } +if ($useCodeObjectV3 and $HIP_PLATFORM eq 'clang') { + $HIPCXXFLAGS .= " -mcode-object-v3"; +} else { + $HIPCXXFLAGS .= " -mno-code-object-v3"; +} + # Add --hip-link only if there are no source files. if (!$needCXXFLAGS and $HIP_PLATFORM eq 'clang') { $HIPLDFLAGS .= " --hip-link"; From 17a853c277c0c29a9bf41afad0f27e1b59ecdfd8 Mon Sep 17 00:00:00 2001 From: Aaron Enye Shi Date: Mon, 11 Feb 2019 17:18:12 +0000 Subject: [PATCH 2/2] Change code-object flag to only HIP-Clang [ROCm/hip commit: 1c6365fbe77c4d15b83f08f3a32b7bd3f1ee2640] --- projects/hip/bin/hipcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index d173d761dd..792d1da59a 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -743,7 +743,7 @@ if ($buildDeps and $HIP_PLATFORM eq 'clang') { if ($useCodeObjectV3 and $HIP_PLATFORM eq 'clang') { $HIPCXXFLAGS .= " -mcode-object-v3"; -} else { +} elsif ($HIP_PLATFORM eq 'clang') { $HIPCXXFLAGS .= " -mno-code-object-v3"; }