From b6ab7c8e70e4b67e87be9a5aada58a4d6c833573 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 17 Oct 2024 16:20:31 +0100 Subject: [PATCH] [HIPIFY][perl] Improve warning reporting --- bin/hipify-perl | 14 +++++++------- src/CUDA2HIP_Perl.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index 489c722b..7ddefe06 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -9034,7 +9034,7 @@ sub warnUnsupportedDeviceFunctions { my $mt = m/\b($func)\b\s*\(\s*.*\s*\)/g; if ($mt && !$mt_namespace) { $k += $mt; - print STDERR " warning: $fileName:$line_num: unsupported device function \"$func\": $_\n"; + print STDERR " $fileName:$line_num: warning: unsupported device function \"$func\": $_\n"; } } return $k; @@ -9048,7 +9048,7 @@ sub warnExperimentalFunctions { my $mt = m/($func)/g; if ($mt) { $k += $mt; - print STDERR " warning: $fileName:$line_num: experimental identifier \"$func\" in HIP $val\n"; + print STDERR " $fileName:$line_num: warning: experimental ROCm HIP identifier: $func $val\n"; } } return $k; @@ -9067,7 +9067,7 @@ sub warnDeprecatedFunctions { if (index(lc($func),lc($cudnn)) == 0) { $cuda = $cudnn; } - print STDERR " warning: $fileName:$line_num: deprecated identifier \"$func\" since $cuda $val\n"; + print STDERR " $fileName:$line_num: warning: deprecated CUDA identifier: $func since $cuda $val\n"; } } return $k; @@ -9086,7 +9086,7 @@ sub warnRemovedFunctions { if (index(lc($func),lc($cudnn)) == 0) { $cuda = $cudnn; } - print STDERR " warning: $fileName:$line_num: removed identifier \"$func\" since $cuda $val\n"; + print STDERR " $fileName:$line_num: warning: removed CUDA identifier: $func since $cuda $val\n"; } } return $k; @@ -11065,7 +11065,7 @@ sub warnUnsupportedFunctions { my $mt = m/($func)/g; if ($mt) { $k += $mt; - print STDERR " warning: $fileName:$line_num: unsupported identifier \"$func\"\n"; + print STDERR " $fileName:$line_num: warning: unsupported ROCm HIP identifier: $func\n"; } } return $k; @@ -12685,7 +12685,7 @@ sub warnHipOnlyUnsupportedFunctions { my $mt = m/($func)/g; if ($mt) { $k += $mt; - print STDERR " warning: $fileName:$line_num: unsupported identifier \"$func\"\n"; + print STDERR " $fileName:$line_num: warning: unsupported HIP identifier: $func\n"; } } return $k; @@ -14173,7 +14173,7 @@ sub warnRocOnlyUnsupportedFunctions { my $mt = m/($func)/g; if ($mt) { $k += $mt; - print STDERR " warning: $fileName:$line_num: unsupported by ROC identifier \"$func\"\n"; + print STDERR " $fileName:$line_num: warning: unsupported ROC identifier: $func\n"; } } return $k; diff --git a/src/CUDA2HIP_Perl.cpp b/src/CUDA2HIP_Perl.cpp index 2bc73b2f..2c441943 100644 --- a/src/CUDA2HIP_Perl.cpp +++ b/src/CUDA2HIP_Perl.cpp @@ -91,7 +91,7 @@ namespace perl { const string printf = "printf STDERR "; const string no_warns = "no warnings qw/uninitialized/;"; const string hipify_perl = "hipify-perl"; - const string warning = "warning: $fileName:$line_num: "; + const string warning = "$fileName:$line_num: warning: "; const string warningsPlus = "$warnings += $s;"; const string sWarnExperimentalFunctions = "warnExperimentalFunctions"; const string sWarnDeprecatedFunctions = "warnDeprecatedFunctions"; @@ -635,12 +635,12 @@ namespace perl { sRocUnsupported << sCommon.str(); sCommon.str(std::string()); sCommon << tab_2 << "}\n" << tab << "}\n" << tab << return_k << "}" << endl; - sExperimental << tab_3 << print << "\" " << warning << "experimental identifier \\\"$func\\\" in HIP $val\\n\";" << endl << sCommon.str(); - sDeprecated << tab_3 << print << "\" " << warning << "deprecated identifier \\\"$func\\\" since $cuda $val\\n\";" << endl << sCommon.str(); - sRemoved << tab_3 << print << "\" " << warning << "removed identifier \\\"$func\\\" since $cuda $val\\n\";" << endl << sCommon.str(); - sUnsupported << tab_3 << print << "\" " << warning << "unsupported identifier \\\"$func\\\"\\n\";" << endl << sCommon.str(); - sHipUnsupported << tab_3 << print << "\" " << warning << "unsupported identifier \\\"$func\\\"\\n\";" << endl << sCommon.str(); - sRocUnsupported << tab_3 << print << "\" " << warning << "unsupported by ROC identifier \\\"$func\\\"\\n\";" << endl << sCommon.str(); + sExperimental << tab_3 << print << "\" " << warning << "experimental ROCm HIP identifier: $func $val\\n\";" << endl << sCommon.str(); + sDeprecated << tab_3 << print << "\" " << warning << "deprecated CUDA identifier: $func since $cuda $val\\n\";" << endl << sCommon.str(); + sRemoved << tab_3 << print << "\" " << warning << "removed CUDA identifier: $func since $cuda $val\\n\";" << endl << sCommon.str(); + sUnsupported << tab_3 << print << "\" " << warning << "unsupported ROCm HIP identifier: $func\\n\";" << endl << sCommon.str(); + sHipUnsupported << tab_3 << print << "\" " << warning << "unsupported HIP identifier: $func\\n\";" << endl << sCommon.str(); + sRocUnsupported << tab_3 << print << "\" " << warning << "unsupported ROC identifier: $func\\n\";" << endl << sCommon.str(); *streamPtr.get() << sExperimental.str(); *streamPtr.get() << sDeprecated.str(); *streamPtr.get() << sRemoved.str();