From df3687f67da5b172442ac54e3784175e3fef9699 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Fri, 8 Apr 2022 14:52:09 +0300 Subject: [PATCH] [HIPIFY][#525][perl] Populate `convertedTags` pattern with libraries' prefixes + Updated regenerated hipify-perl accordingly [ToDo] Populate with header file names, APIs without prefixes, etc. --- bin/hipify-perl | 2 +- src/CUDA2HIP_Perl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index 13353980..8e14fd30 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -7799,7 +7799,7 @@ while (@ARGV) { transformKernelLaunch(); transformCubNamespace(); if ($print_stats) { - while (/(\b(hip|HIP)([A-Z]|_)\w+\b)/g) { + while (/(\b(hip|HIP|HIP_|hipblas|HIPBLAS_|hipcub|hipdnn|HIPDNN_|hipfft|HIPFFT_|hiprand|HIPRAND_|hiprtc|HIPRTC_|hipsparse|HIPSPARSE_)([A-Z]|_)\w+\b)/g) { $convertedTags{$1}++; } } diff --git a/src/CUDA2HIP_Perl.cpp b/src/CUDA2HIP_Perl.cpp index 3248ec5f..770706fe 100644 --- a/src/CUDA2HIP_Perl.cpp +++ b/src/CUDA2HIP_Perl.cpp @@ -739,7 +739,7 @@ namespace perl { *streamPtr.get() << tab_3 << sTansformKernelLaunch << "();" << endl; *streamPtr.get() << tab_3 << sTransformCubNamespace << "();" << endl; *streamPtr.get() << tab_3 << "if ($print_stats) {" << endl; - *streamPtr.get() << tab_4 << while_ << "(/(\\b(hip|HIP)([A-Z]|_)\\w+\\b)/g) {" << endl; + *streamPtr.get() << tab_4 << while_ << "(/(\\b(hip|HIP|HIP_|hipblas|HIPBLAS_|hipcub|hipdnn|HIPDNN_|hipfft|HIPFFT_|hiprand|HIPRAND_|hiprtc|HIPRTC_|hipsparse|HIPSPARSE_)([A-Z]|_)\\w+\\b)/g) {" << endl; *streamPtr.get() << tab_5 << "$convertedTags{$1}++;" << endl_tab_4 << "}" << endl_tab_3 << "}" << endl; *streamPtr.get() << tab_3 << my << "$hasDeviceCode = $countKeywords + $ft{'device_function'};" << endl; *streamPtr.get() << tab_3 << unless_ << "($quiet_warnings) {" << endl;