tianshilei1992 added a comment. In D78075#2272398 <https://reviews.llvm.org/D78075#2272398>, @ye-luo wrote:
>> However, OpenMP task has a problem that it must be within >> to a parallel region; otherwise the task will be executed immediately. As a >> result, if we directly wrap to a regular task, the nowait target outside of a >> parallel region is still a synchronous version. > > The spec says an implicit task can be generated by an implicit parallel > region which can be the whole OpenMP program. For this reason, the need of > explicit parallel region is a limitation of the llvm OpenMP runtime, right? > > Can I have an option to run the nowait region as a regular task instead of an > unshackled task? So I can use "parallel" and well established ways to control > the thread affinity. According to the spec, an implicit parallel region is an inactive parallel region that is not generated from a parallel construct. And based on the definition of active parallel region, which is a parallel region that is executed by a team consisting of more than one thread, an inactive parallel region only has one thread. Since we only have one thread, if we encounter a task, executing it immediately does make sense as we don't have another thread to execute it. I do remember your request about the regular task. This patch is exactly what you need. Later when I finish the RTL, I could provide an option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78075/new/ https://reviews.llvm.org/D78075 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits