[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


================
@@ -1226,18 +1226,24 @@ bool CheckForCoindexedObject(parser::ContextualMessages &,
     const std::optional<ActualArgument> &, const std::string &procName,
     const std::string &argName);
 
-/// Check if any of the symbols part of the expression has a cuda data
-/// attribute.
-inline bool HasCUDAAttrs(const Expr<SomeType> &expr) {
+// Get the number of symbols with CUDA attribute in the expression.
+template <typename A> inline unsigned GetNbOfCUDASymbols(const A &expr) {
----------------
klausler wrote:

Please don't use `unsigned` unless doing bit manipulation that demands modular (wrap-around) arithmetic.  If you're just counting a few things, use `int`.

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


More information about the flang-commits mailing list