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

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 16 17:10:32 PDT 2021


jdoerfert added a comment.

I don't understand why we have an event in the async_info object at all. I would have assumed only to have some plugin specific "lock" in the table.



================
Comment at: openmp/libomptarget/src/device.h:53
+  /// Pointer to the event corresponding to the data movement of this map.
+  volatile mutable void *Event;
+
----------------
JonChesterfield wrote:
> 'volatile mutable' reads as 'buggy', why is this volatile or mutable? Also, why is this target thing exposed to the host runtime at all, instead of being purely within an async object?
It has to be here. As discussed in our call today. You need a lock per entry in the mapping table.
That said, I don't know why we want it to be volatile or mutable, the latter if we only get const references somewhere but that would be odd anyway.


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