llvm-project
fb18d570 - [flang][OpenMP] Use cuf.alloc for privatization of CUDA Fortran device arrays (#185984)

Commit
2 days ago
[flang][OpenMP] Use cuf.alloc for privatization of CUDA Fortran device arrays (#185984) When CUDA Fortran device arrays are listed in an OpenMP private clause, the compiler previously allocated private copies on the host heap using fir.allocmem. This caused device-side operations to receive host pointers instead of device pointers, leading to cudaErrorIllegalAddress (700). Fix by detecting symbols with a CUDA data attribute (device, managed, unified, etc.) during privatization and using cuf.alloc / cuf.free instead of fir.allocmem / fir.freemem, so the private copies reside in device memory.
Author
Parents
Loading