llvm-project
0341a4fe - [flang][cuda] Include constant extents in cuf.alloc size computation (#194288)

Commit
19 days ago
[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`).
Author
Parents
Loading