[flang-commits] [flang] [llvm] [flang][cuda] Fix device-variable leaks and reset-safe cleanup (PR #209865)

via flang-commits flang-commits at lists.llvm.org
Mon Jul 20 03:59:25 PDT 2026


khaki3 wrote:

I'll commit this one.

We have allowed `cudaDeviceReset` only in main while skipping main-program finalization, which leaked managed descriptor allocations.

With this change, we also allow `cudaDeviceReset` in subroutines and clean up main-program CUDA allocations and descriptors.

If we decide that calling `cudaDeviceReset` is prohibited, we can remove the CUDA cleanup guard.

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


More information about the flang-commits mailing list