[Openmp-commits] [PATCH] D55496: [OpenMP] RFC: fixes for LIBOMP_OMP_VERSION=4.5/4

Roman Lebedev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Dec 9 07:26:20 PST 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: jlpeyton, Hahnfeld, AndreyChurbanov.
lebedev.ri added a project: OpenMP.
Herald added subscribers: jfb, guansong.

I have discovered this because i wanted to experiment with building static libomp
(with openmp-4.0 support only) for debugging purposes.

This is marked as RFC because i'm not sure if non-default values for
`LIBOMP_OMP_VERSION` are supposed to work or not.

There are three kinds of problems here:

1. `__kmp_compare_and_store_acq()` simply does not exist. It was added in D47903 <https://reviews.llvm.org/D47903> by @jlpeyton I'm guessing `__kmp_atomic_compare_store_acq()` was meant.
2. In `__kmp_is_ticket_lock_initialized()`, `lck->lk.initialized` is `std::atomic<bool>`, while `lck` is `kmp_ticket_lock_t *`. Naturally, they can't be equality-compared. Either, it should return the value read from `lck->lk.initialized`, or do what `__kmp_is_queuing_lock_initialized()` does, compare the passed pointer with the field in the struct pointed by the pointer. I think the latter is correct-er choice here.
3. Tests were not versioned. They assume that `LIBOMP_OMP_VERSION` is at the latest version.

Thoughts?


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D55496

Files:
  runtime/src/kmp_lock.cpp
  runtime/src/kmp_lock.h
  runtime/src/kmp_tasking.cpp
  runtime/test/api/omp_alloc.c
  runtime/test/lit.cfg
  runtime/test/lit.site.cfg.in
  runtime/test/ompt/misc/control_tool_no_ompt_support.c
  runtime/test/tasking/bug_nested_proxy_task.c
  runtime/test/tasking/bug_proxy_task_dep_waiting.c
  runtime/test/tasking/kmp_task_reduction_nest.cpp
  runtime/test/tasking/kmp_taskloop.c
  runtime/test/tasking/omp_task_priority.c
  runtime/test/tasking/omp_taskloop_grainsize.c
  runtime/test/tasking/omp_taskloop_num_tasks.c
  runtime/test/worksharing/for/kmp_doacross_check.c
  runtime/test/worksharing/for/kmp_sch_simd_guided.c
  runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c
  runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c
  runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c
  runtime/test/worksharing/for/omp_doacross.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55496.177425.patch
Type: text/x-patch
Size: 12687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20181209/4f67dbee/attachment-0001.bin>


More information about the Openmp-commits mailing list