[all-commits] [llvm/llvm-project] ea0be9: [flang][cuda] Count managed symbols per component ...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Wed Sep 30 14:19:19 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ea0be90fd97a0cd0e927b427e08aa3539e830b57
      https://github.com/llvm/llvm-project/commit/ea0be90fd97a0cd0e927b427e08aa3539e830b57
  Author: Valentin Clement (バレンタイン クレメン) <clementval at gmail.com>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M flang/include/flang/Evaluate/tools.h
    M flang/lib/Evaluate/tools.cpp
    M flang/lib/Semantics/check-cuda.cpp
    A flang/test/Semantics/CUDA/cuf-managed-component-rhs.cuf

  Log Message:
  -----------
  [flang][cuda] Count managed symbols per component chain in assignment check (#227825)

The check for a device to host transfer with more than one device object
on the right hand side compares the number of unique device symbols with
the number of managed or unified symbols, to allow the case where every
object is managed. The two counts were computed differently: device
symbols are counted once per component chain, while managed symbols were
counted individually. When both a derived type object and its component
are managed, the component chain contributed one device symbol but two
managed symbols, so the counts never matched and a valid assignment was
rejected:

```
  type(t), managed, allocatable :: s(:)   ! t has a managed component a
  real, managed, allocatable :: b(:,:), c(:,:)
  x = (b(i,j) - s(1)%a(i,j)) * c(i,j)
  ! error: More than one reference to a CUDA object on the right hand
  !        side of the assignment
```

This shows up with -gpu=mem:managed, where allocatable variables and
components are implicitly managed.

Count managed or unified symbols from the same per-chain set used for
device symbols, so the two counts can be compared.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list