[all-commits] [llvm/llvm-project] 0341a4: [flang][cuda] Include constant extents in cuf.allo...

khaki3 via All-commits all-commits at lists.llvm.org
Mon Apr 27 11:19:03 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0341a4fec3e4d604d51e444bec2d49c85e268046
      https://github.com/llvm/llvm-project/commit/0341a4fec3e4d604d51e444bec2d49c85e268046
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M flang/lib/Optimizer/Transforms/CUDA/CUFAllocationConversion.cpp
    M flang/test/Fir/CUDA/cuda-alloc-free.fir

  Log Message:
  -----------
  [flang][cuda] Include constant extents in cuf.alloc size computation (#194288)

Example:
```fortran
real, device :: arr(n, 4, m)
```

For arrays with mixed constant and dynamic extents
(`!fir.array<?x4x?xf32>`), the allocation size only includes the dynamic
extents (`n * m * 4 bytes`), missing the constant extent `4`. This
under-allocates by a factor of 4, causing `cudaErrorIllegalAddress`.

Fix: After multiplying the dynamic extents, also multiply in constant
extents from the type, producing the correct size (`n * m * 4 * 4
bytes`).



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