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

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 19 03:54:29 PDT 2021


grokos added inline comments.


================
Comment at: openmp/libomptarget/src/device.cpp:244
     IsNew = true;
+    MoveData = true;
     uintptr_t Ptr = (uintptr_t)allocData(Size, HstPtrBegin);
----------------
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`.


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