[Openmp-commits] [PATCH] D77609: [OpenMP] Added the support for unshackled task in RTL

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 5 04:22:46 PDT 2020


protze.joachim added a comment.

In D77609#1967875 <https://reviews.llvm.org/D77609#1967875>, @tianshilei1992 wrote:

> > What tasks should/can be given to unshackled threads? Is it user's decision, or runtime decision, or some combination (suggest new clause/hint?)?
>
> That is a good point. For current purpose, it can only be used by compiler. If a `nowait` target is not in any parallel region, an unshackled task will be created by compiler. The motivation is, just for your information in case that you don't know the context, the "unshackled" here means it will not be bound to any parallel region. That is particularly useful for the case I mentioned. Of course it also implies, especially in current implementation design, they're actually implicitly bound to the same outer-most parallel region. Regular task synchronization should NOT work for them, except one special case that the `taskwait` depends on an unshackled task. What's more, since it is not part of spec, it can not be used by users. Of course if it is part of spec in the future, users can decide it and there must be new clause for it.


According to the OpenMP specification, you always have an implicit parallel region surrounding the whole execution. Your target nowait binds to this implicit parallel region. For this reason, the target task must respect all means of synchronization like dependencies, taskwait, barrier, ...

What is the concrete scenario, in which you need this monitor thread to schedule device activity? 
Did you consider to use detached tasks to implement asynchronous target offloading?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77609/new/

https://reviews.llvm.org/D77609





More information about the Openmp-commits mailing list