[flang-commits] [flang] [flang] Allow acc cache directive inside acc routine (PR #184213)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Mon Mar 2 11:55:21 PST 2026


================
@@ -55,4 +55,19 @@ program openacc_cache_validity
   !ERROR: The CACHE directive must be inside a loop
   !$acc cache(a)
 
+  call routine_with_cache()
+
+contains
+
+  subroutine routine_with_cache()
+    real(8), dimension(N) :: local_arr
+    integer :: j
+    !$acc routine vector
+    !$acc cache(local_arr)
----------------
clementval wrote:

What would happen if you switch the directive? 

```
 !$acc cache(local_arr)
!$acc routine vector
```

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


More information about the flang-commits mailing list