[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
This commit is contained in:
Evgeny Mankov
2019-09-25 18:53:17 +03:00
parent bafec0a20e
commit 9d1d4b78e3
5 changed files with 53 additions and 13 deletions
+10 -2
View File
@@ -37,8 +37,8 @@ namespace ct = clang::tooling;
namespace mat = clang::ast_matchers;
const std::string sHIP_DYNAMIC_SHARED = "HIP_DYNAMIC_SHARED";
const std::string sHIP_SYMBOL = "HIP_SYMBOL";
const std::string s_reinterpret_cast = "reinterpret_cast<const void*>";
std::string sHIP_SYMBOL = "HIP_SYMBOL";
std::string s_reinterpret_cast = "reinterpret_cast<const void*>";
const std::string sHipLaunchKernelGGL = "hipLaunchKernelGGL(";
const std::string sDim3 = "dim3(";
@@ -68,6 +68,14 @@ std::set<std::string> ReinterpretFunctions{
{sCudaFuncGetAttributes}
};
std::set<std::string> ReinterpretFunctions0{
{sCudaFuncSetCacheConfig}
};
std::set<std::string> ReinterpretFunctions1{
{sCudaFuncGetAttributes}
};
void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) {
clang::SourceManager& SM = getCompilerInstance().getSourceManager();
size_t begin = 0;