[HIPIFY] Narrow cudaKernelCallExpr matcher.

[Explanation]
Narrow cudaKernelCallExpr matcher to isExpansionInMainFile() - to the file being actually converted (without system includes).
But as for Thrust, there are *.inl files, which are nevertheless being expanded in main file.
These files contain cuda kernel launches, which are not converted successfully by hipify, for instance:
thrust/system/cuda/detail/detail/launch_closure.inl:98:23.

[ToDo]
File a bug on cudaKernelCallExpr matcher for conversion error (thrust\examples\cuda\<any cu example>).


[ROCm/hip commit: d1cfcf55f1]
This commit is contained in:
Evgeny Mankov
2017-02-14 16:28:05 +03:00
parent 31dfd8bb1f
commit af7455bd64
+1 -1
View File
@@ -2494,7 +2494,7 @@ void addAllMatchers(ast_matchers::MatchFinder &Finder, Cuda2HipCallback *Callbac
callee(functionDecl(matchesName("cu.*"))))
.bind("cudaCall"),
Callback);
Finder.addMatcher(cudaKernelCallExpr().bind("cudaLaunchKernel"), Callback);
Finder.addMatcher(cudaKernelCallExpr(isExpansionInMainFile()).bind("cudaLaunchKernel"), Callback);
Finder.addMatcher(memberExpr(isExpansionInMainFile(),
hasObjectExpression(hasType(cxxRecordDecl(
matchesName("__cuda_builtin_")))))