[flang-commits] [flang] [flang][cuda] Add restriction on implicit data transfer (PR #87720)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Apr 4 15:57:18 PDT 2024


================
@@ -413,4 +415,18 @@ void CUDAChecker::Enter(const parser::CUFKernelDoConstruct &x) {
   }
 }
 
+void CUDAChecker::Enter(const parser::AssignmentStmt &x) {
+  const evaluate::Assignment *assign = semantics::GetAssignment(x);
+  unsigned nbLhs = evaluate::GetNbOfCUDASymbols(assign->lhs);
+  unsigned nbRhs = evaluate::GetNbOfCUDASymbols(assign->rhs);
+  auto lhsLoc{std::get<parser::Variable>(x.t).GetSource()};
+
+  // device to host transfer with more than one device object on the rhs is not
----------------
klausler wrote:

What if one object is used multiple times?  Maybe you need a set of symbols so that you're counting only the distinct ones.

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


More information about the flang-commits mailing list