Merge pull request #1615 from emankov/hipify

[HIPIFY][CUB][#1460][perl] Add "cub::" namespace prefix support in hipify-perl as well

[ROCm/clr commit: 48bb6df7e2]
This commit is contained in:
Evgeny Mankov
2019-11-01 14:35:55 +03:00
committed by GitHub
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -1680,6 +1680,7 @@ sub transformKernelLaunch {
sub transformCubNamespace {
my $k = 0;
$k += s/using\s*namespace\s*cub/using namespace hipcub/g;
$k += s/\bcub::\b/hipcub::/g;
return $k;
}
@@ -253,7 +253,8 @@ namespace perl {
void generateCubNamespace(unique_ptr<ostream>& streamPtr) {
*streamPtr.get() << endl << sub << "transformCubNamespace" << " {" << endl_tab << my_k << endl;
*streamPtr.get() << tab << "$k += s/using\\s*namespace\\s*cub/using namespace hipcub/g;" << endl << tab << return_k << "}" << endl;
*streamPtr.get() << tab << "$k += s/using\\s*namespace\\s*cub/using namespace hipcub/g;" << endl;
*streamPtr.get() << tab << "$k += s/\\bcub::\\b/hipcub::/g;" << endl << tab << return_k << "}" << endl;
}
void generateHostFunctions(unique_ptr<ostream>& streamPtr) {