[flang-commits] [flang] [flang][OpenMP] Lower `target .. private(..)` to `omp.private` ops (PR #94195)
Pranav Bhandarkar via flang-commits
flang-commits at lists.llvm.org
Tue Jun 4 23:08:00 PDT 2024
bhandarkar-pranav wrote:
> Could you add a few more tests? -> With a default private. -> With three different types of privates.
>
> Did you get a chance to discuss with @mjklemm about how privatisation works for tasks and since target has some task like properties whether we need something more than inlining?
Yes, we'll need a way to send the privates via the target task to the target kernel so that `firstprivate` variables can be initialized. The way clang does this is by tacking on the private variables at the end of the `task_t` structure in the call to `kmpc_omp_task_alloc`. For now, this is a TODO item for both, [Tasks](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp#L1790) and [Target](https://github.com/bhandarkar-pranav/llvm-project/blob/ompirbuilder/target_task_codegen/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp#L5529) in the `OpenMPIRBuilder`. These values can then be picked up by the inlined code (generated out of the privatizers by way of a `PrivCB` callback) in the target kernel.
https://github.com/llvm/llvm-project/pull/94195
More information about the flang-commits
mailing list