From b046ec698bc2dbfae77f41c45d4d23df9fff6105 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 28 Aug 2019 21:03:11 -0400 Subject: [PATCH] Do not change opt level for -g for hip-clang (#1369) Currently hipcc uses -O3 for hip-clang by default but uses -O0 if -g is used. This causes surprise for users since -g should not affect default opt level. --- bin/hipcc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/hipcc b/bin/hipcc index 4be1c084fb..c759802e2e 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -383,7 +383,6 @@ if($HIP_PLATFORM eq "nvcc"){ my $toolArgs = ""; # arguments to pass to the hcc or nvcc tool my $optArg = ""; # -O args -my $gArg = ""; # -g args foreach $arg (@ARGV) { @@ -494,10 +493,6 @@ foreach $arg (@ARGV) { $optArg = $arg; } - if($arg =~ m/^-g/) - { - $gArg = $arg; - } ## process linker response file for hip-clang ## extract object files from static library and pass them directly to @@ -876,7 +871,7 @@ if ($needHipHcc) { if ($HIP_PLATFORM eq "clang") { # Set default optimization level to -O3 for hip-clang. - if ($optArg eq "" and $gArg ne "-g") { + if ($optArg eq "") { $HIPCXXFLAGS .= " -O3"; $HIPLDFLAGS .= " -O3"; }