[Openmp-commits] [PATCH] D104418: [PoC][WIP][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
Fri Jun 18 16:15:10 PDT 2021


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/src/device.h:54
+  /// Pointer to the event corresponding to the data movement of this map.
+  mutable std::shared_ptr<std::atomic<void *>> Event;
+
----------------
jdoerfert wrote:
> tianshilei1992 wrote:
> > We have to use `shared_ptr` here as this data structure has to be copied but `std::atomic` is un-copyable.
> Why is this a shared ptr?
Because `unique_ptr` is non-copyable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104418



More information about the Openmp-commits mailing list