[flang-commits] [flang] [flang][cuda] Only apply the implicit data attribute on the component for use_device (PR #192146)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Thu Apr 16 21:54:12 PDT 2026


================
@@ -13,9 +13,32 @@ module m
     !dir$ ignore_tkr(c) a
 end
 end interface
+type t
+    integer, pointer :: p1
+    integer, pointer :: p2
+  end type
+interface foo
+subroutine foo_device(p)
+  integer, pointer, device :: p
+end subroutine
+subroutine foo_host(p)
+  integer, pointer :: p
+end subroutine
+end interface
 
 contains
 
+  subroutine test(obj)
+    type(t) :: obj
+    !$acc host_data use_device(obj%p1)
----------------
clementval wrote:

Added. It was a good suggestion because the second occurrence should not make a copy of obj but rather find the previously made copy to update p2. 

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


More information about the flang-commits mailing list