[Openmp-commits] [PATCH] D104418: [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 5 17:04:56 PST 2022

tianshilei1992 marked an inline comment as done.
tianshilei1992 added inline comments.

Comment at: openmp/libomptarget/src/device.cpp:311
+      if (Event) {
+        int Ret = waitEvent(Event, AsyncInfo);
+        Entry->unlock();
ye-luo wrote:
> ye-luo wrote:
> > ye-luo wrote:
> > > After the first transfer, every look up calls waitEvent which is still costly.
> > > It is better to return the even back to the pool and avoid waitEvent cost.
> > I misunderstood waitEvent. It just enqueues the event to the stream. Need to find a better place to reduce the necessary waitEvent.
> I think waitEvent can be bypassed if the present modifier is true.
`waitEvent` will not be triggered for entry with present modifier because its attached `event` will be empty, but we can save a lock.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list