[Openmp-commits] [PATCH] D146642: [OpenMP] Implement task record and replay mechanism
Chenle YU via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Apr 13 06:32:16 PDT 2023
yuchenle marked an inline comment as done.
yuchenle added inline comments.
================
Comment at: openmp/runtime/test/tasking/omp_record_replay.cpp:21
+void func(int *num_exec) {
+ (*num_exec)++;
+}
----------------
randreshg wrote:
> I think the test will fail if you don't guarantee that this line will be executed atomically.
> I think the test will fail if you don't guarantee that this line will be executed atomically.
You are right, if the TDG is asynchronous. However, in the current implementation, TDG execution is synchronous, using taskgroup. Plus, there is only one node in the TDG so there is no contention. Only one thread can access to "num_exec" at any given time : )
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146642/new/
https://reviews.llvm.org/D146642
More information about the Openmp-commits
mailing list