[Openmp-commits] [PATCH] D96438: [OpenMP] Move synchronization into `__tgt_async_info`

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 10 16:54:22 PST 2021

tianshilei1992 added inline comments.

Comment at: openmp/libomptarget/include/omptarget.h:136
+/// The libomptarget wrapper around a __tgt_async_info object directly
+/// associated with a libomptarget layer device. RAII semantics to avoid
+/// mistakes.
jdoerfert wrote:
> tianshilei1992 wrote:
> > jdoerfert wrote:
> > > tianshilei1992 wrote:
> > > > Not sure the wrapper has a bonus to fix issues mentioned in D96431.
> > > I don't understand.
> > If we have event, `AsyncInfoTy`'s lifetime can still be out of its scope.
> Let's cross that bridge when we get events? I was assuming we copy the __tgt_async_info into the appropriate locations of the runtime and null it in the `AsyncInfoTy` object. Or something along those lines.
That should be fine. Actually we cannot use `AsyncInfoTy` in `libomp` because it's a C library. If it is a C++ library, we also don't need to worry about that because we can use smart pointer then,

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list