Skip to content

Commit

Permalink
[HIPIFY][perl][fix] Eliminated more erroneous warnings
Browse files Browse the repository at this point in the history
+ Eliminated erroneous warnings like `unsupported MIOpen identifier: cudnnOpTensor` when the actual identifier is `cudnnOpTensor_t`
  • Loading branch information
emankov committed Jan 20, 2025
1 parent f4fa022 commit 87ed157
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -9922,7 +9922,7 @@ sub countSupportedDeviceDataTypes {
my $k = 0;
while (my($func) = each %SupportedDeviceDataTypes)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
}
Expand All @@ -9939,7 +9939,7 @@ sub warnUnsupportedDeviceDataTypes {
my $k = 0;
while (my($func) = each %UnsupportedDeviceDataTypes)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: unsupported device data type identifier: $func\n";
Expand All @@ -9953,7 +9953,7 @@ sub warnExperimentalFunctions {
my $k = 0;
while (my($func, $val) = each %experimental_funcs)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: experimental ROCm HIP identifier: $func $val\n";
Expand All @@ -9967,7 +9967,7 @@ sub warnDeprecatedFunctions {
my $k = 0;
while (my($func, $val) = each %deprecated_funcs)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
my $cudnn = "CUDNN";
Expand All @@ -9986,7 +9986,7 @@ sub warnRemovedFunctions {
my $k = 0;
while (my($func, $val) = each %removed_funcs)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
my $cudnn = "CUDNN";
Expand Down Expand Up @@ -11398,7 +11398,7 @@ sub warnHipOnlyUnsupportedFunctions {
my $k = 0;
while (my($func) = each %HipOnlyUnsupportedFunctions)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: unsupported HIP identifier: $func\n";
Expand Down Expand Up @@ -12976,7 +12976,7 @@ sub warnRocOnlyUnsupportedFunctions {
my $k = 0;
while (my($func) = each %RocOnlyUnsupportedFunctions)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: unsupported ROC identifier: $func\n";
Expand Down Expand Up @@ -13599,7 +13599,7 @@ sub warnMIOpenOnlyUnsupportedFunctions {
my $k = 0;
while (my($func) = each %MIOpenOnlyUnsupportedFunctions)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: unsupported MIOpen identifier: $func\n";
Expand Down Expand Up @@ -14511,7 +14511,7 @@ sub warnHipDNNOnlyUnsupportedFunctions {
my $k = 0;
while (my($func) = each %HipDNNOnlyUnsupportedFunctions)
{
my $mt = m/($func)/g;
my $mt = m/\b($func)\b/g;
if ($mt) {
$k += $mt;
print STDERR " $fileName:$line_num: warning: unsupported hipDNN identifier: $func\n";
Expand Down
4 changes: 2 additions & 2 deletions src/CUDA2HIP_Perl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ namespace perl {
miopen_unsupported << endl << ");" << endl;
hipdnn_unsupported << endl << ");" << endl;
sCommon << tab << "{" << endl;
sCommon << tab_2 << my << "$mt = m/($func)/g;" << endl;
sCommon << tab_2 << my << "$mt = m/\\b($func)\\b/g;" << endl;
sCommon << tab_2 << "if ($mt) {" << endl;
sCommon << tab_3 << "$k += $mt;" << endl;
sCommon1 << tab_3 << my << "$cudnn = \"CUDNN\";" << endl;
Expand Down Expand Up @@ -749,7 +749,7 @@ namespace perl {
}
if (countSupportedDataTypes || countUnsupportedDataTypes) {
subCommonDataTypes << tab << "{" << endl;
subCommonDataTypes << tab_2 << my << "$mt = m/($func)/g;" << endl;
subCommonDataTypes << tab_2 << my << "$mt = m/\\b($func)\\b/g;" << endl;
subCommonDataTypes << tab_2 << "if ($mt) {" << endl;
subCommonDataTypes << tab_3 << "$k += $mt;" << endl;
}
Expand Down

0 comments on commit 87ed157

Please sign in to comment.