[flang-commits] [flang] [Flang][OpenMP] Heap-allocate GPU dynamic private arrays in distribute parallel do (PR #200841)

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Thu Jun 4 06:34:37 PDT 2026


TIFitis wrote:

> So, what I would like to know is what happens in these cases and whether this patch already addresses the only cases that are currently broken.

The `distribute` case is different because the lowering captures the Fortran
box descriptor through the distribute runtime callback path. If the descriptor
points to runtime-sized GPU scratch storage, that pointer can be used across the
callback boundary and we hit the crash. The other constructs do not have
that same descriptor-capture failure pattern.

I've done a quick local test for the other constructs you mentioned and they work without needing the workaround in this PR. For the other constructs it's an optional trade-off between performance and stack-size.



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


More information about the flang-commits mailing list