[flang-commits] [flang] [flang][cuda] Lower device to host and device to device transfer (PR #87387)

via flang-commits flang-commits at lists.llvm.org
Fri Apr 5 00:05:07 PDT 2024


================
@@ -1240,6 +1240,24 @@ inline bool HasCUDAAttrs(const Expr<SomeType> &expr) {
   return false;
 }
 
+/// Check if the expression is a mix of host and device variables that require
+/// implicit data transfer.
+inline bool HasCUDAImplicitTransfer(const Expr<SomeType> &expr) {
+  unsigned hostSymbols = 0;
+  unsigned deviceSymbols = 0;
+  for (const Symbol &sym : CollectSymbols(expr)) {
+    if (const auto *details =
+            sym.GetUltimate().detailsIf<semantics::ObjectEntityDetails>()) {
----------------
jeanPerier wrote:

Thanks for clarifying this!

https://github.com/llvm/llvm-project/pull/87387


More information about the flang-commits mailing list