[all-commits] [llvm/llvm-project] 11b427: [flang][cuda] Record implicit managed attribution ...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Tue Sep 22 04:34:35 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11b427b038a33f4301bdbc818ffc77c425e4494a
      https://github.com/llvm/llvm-project/commit/11b427b038a33f4301bdbc818ffc77c425e4494a
  Author: Kareem Ergawy <kergawy at nvidia.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M flang/docs/ModFiles.md
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/include/flang/Support/Fortran-features.h
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Support/Fortran-features.cpp
    M flang/test/Parser/cuf-sanity-tree.CUF
    A flang/test/Semantics/CUDA/cuda-managed-implicit-modfile.cuf

  Log Message:
  -----------
  [flang][cuda] Record implicit managed attribution in module files (#224601)

An implicit attribute the compiler applied under `-gpu=mem:managed` is
written into the module file the same way a user-written one is, so a
reader cannot tell them apart. It then treats the attribute as a user
requirement: allocating such a component in a DEVICE object is rejected,
and the memory space the user did ask for on the object no longer wins.

Spell the distinction in the module file as `MANAGED(IMPLICIT)`,
modelled on `INTENT(IN)`: CUDA-data-attr gains an optional parenthesized
qualifier, carried by a new CUDADataAttrSpec parse-tree node in AttrSpec
and ComponentAttrSpec. ATTRIBUTES(...) keeps the bare attribute, so the
qualifier cannot be written there.

The attribute itself is still written out, so a component keeps the same
memory space no matter which options a consumer is compiled with.

Also stop an implicitly applied attribute from making a module a definer
of CUDA symbols. Without this, adding `-gpu=mem:managed` to a module's
build rejects its OpenACC-only consumers over an attribute the user
never wrote.



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