[HIPIFY][#1439] Add reinterpret_cast to args of some functions

+ Perl part of [#1458]
+ Affected functions: hipFuncSetCacheConfig, hipFuncGetAttributes
+ Implement function generateHostFunctions() in hipify-clang for that purposes
+ Update hipify-perl accordingly


[ROCm/hip commit: 9d1d4b78e3]
Этот коммит содержится в:
Evgeny Mankov committed 2019-09-25 18:53:17 +03:00
1 родитель 0d0f963eb1
Коммит ca15d193e8
5 files changed
+53 -13

No files matched your search

+14 -2
Просмотреть файл
@@ -1757,7 +1757,7 @@ while (@ARGV) {
$ft{'kernel_func'} += countSupportedDeviceFunctions();
}
$ft{'memory'} += transformSymbolFunctions();
transformHostFunctions();
# Print it!
# TODO - would like to move this code outside loop but it uses $_ which contains the whole file.
@@ -1813,7 +1813,7 @@ if ($count_conversions) {
}
}
sub transformSymbolFunctions
sub transformHostFunctions
{
my $m = 0;
foreach $func (
@@ -1832,6 +1832,18 @@ sub transformSymbolFunctions
{
$m += s/(?<!\/\/ CHECK: )($func)\s*\(\s*([^,]+)\s*,\s*([^,\)]+)\s*(,\s*|\))\s*/$func\($2, HIP_SYMBOL\($3\)$4/g;
}
foreach $func (
"hipFuncSetCacheConfig"
)
{
$m += s/(?<!\/\/ CHECK: )($func)\s*\(\s*([^,]+)\s*,/$func\(reinterpret_cast<const void*>\($2\),/g
}
foreach $func (
"hipFuncGetAttributes"
)
{
$m += s/(?<!\/\/ CHECK: )($func)\s*\(\s*([^,]+)\s*,\s*([^,\)]+)\s*(,\s*|\))\s*/$func\($2, reinterpret_cast<const void*>\($3\)$4/g;
}
return $m;
}