[Openmp-commits] [PATCH] D64080: [OPENMP]Make __kmpc_push_tripcount thread safe.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 2 07:42:13 PDT 2019


ABataev created this revision.
ABataev added a reviewer: grokos.
Herald added subscribers: jdoerfert, jfb, guansong.
Herald added a project: OpenMP.

__kmpc_push_tripcount function is not thread safe and may lead to data
race when the target regions are executed in parallel threads. The patch
makes loopTripCnt counter thread aware and stores the tripcount value
per thread in the map. Access to map is guarded by mutex to prevent
data race in the map itself.
Test is for NVPTX target because it does not work correctly on the
host. Seems to me, there is a problem in libomp with target regions in
the parallel threads.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D64080

Files:
  libomptarget/deviceRTLs/nvptx/test/parallel/tripcount.c
  libomptarget/src/device.h
  libomptarget/src/interface.cpp
  libomptarget/src/omptarget.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64080.207559.patch
Type: text/x-patch
Size: 3457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190702/78b1ea91/attachment-0001.bin>


More information about the Openmp-commits mailing list