[Openmp-commits] [PATCH] D104555: [OpenMP][Offloading] Fix data race in data mapping by using two locks

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 19 10:55:45 PDT 2021


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/src/device.cpp:244
     IsNew = true;
+    MoveData = true;
     uintptr_t Ptr = (uintptr_t)allocData(Size, HstPtrBegin);
----------------
grokos wrote:
> This is not correct either. `getTargetPointer()` doesn't know whether the `TO` flag is set, yet it will perform a data transfer even if we just `map(alloc : ...)` as long as we are mapping a new entry. That's why I proposed that you use a 3-state integer instead of a `bool` for `MoveData`.
Oh, you're right. I'll update it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104555



More information about the Openmp-commits mailing list