Skip to content

Commit

Permalink
[HIPIFY][perl] Improve warning reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
emankov committed Oct 17, 2024
1 parent 1d12d4d commit b6ab7c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/CUDA2HIP_Perl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b6ab7c8

Please sign in to comment.