Added functions those implement "atomic compare".
Though clang does not use library interfaces to implement OpenMP atomics,
the functions added for consistency.
Also added missed functions for 80-bit floating min/max atomics.
Paths
| Differential D110109
[OpenMP] libomp: add atomic functions for new OpenMP 5.1 atomics. ClosedPublic Authored by AndreyChurbanov on Sep 20 2021, 2:51 PM.
Details Summary Added functions those implement "atomic compare". Also added missed functions for 80-bit floating min/max atomics.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Oct 13 2021, 10:17 AM Closed by commit rG621d7a75b16d: [OpenMP] libomp: add atomic functions for new OpenMP 5.1 atomics. (authored by AndreyChurbanov). · Explain WhyOct 13 2021, 11:02 AM This revision was automatically updated to reflect the committed changes. Comment Actions Is this patch only applicable to KMP_ARCH_X86 || KMP_ARCH_X86_64 arch? The newly added test cases fail on non-X86 platform due to undefined symbols. The __kmpc_atomic_*_cas_* prototypes got preprocessed out inside the extern "C" hence the names are mangled. Comment Actions Why are the types in __kmpc_atomic_val_4_cas_cpt different from the types in __kmpc_atomic_val_4_cas? I think, all the functions should use fixed-size integer to respect the width suggested by the name of the function. Comment Actions
Thanks for comment. The implementation is indeed supposed to be applicable to KMP_ARCH_X86 || KMP_ARCH_X86_64 only. Comment Actions
Sorry, Joachim, I haven't got your comment. Both functions deal with kmp_int32 that is 4 bytes. Or am I missing something? Comment Actions @AndreyChurbanov There is one more issue. kmp_atomic_float10_max_min.c specifies -mlong-double-80 but some platforms (e.g. Power) do not support such option. Comment Actions
Thanks for reporting.
Revision Contents
Diff 379470 openmp/runtime/src/dllexports
openmp/runtime/src/kmp_atomic.h
openmp/runtime/src/kmp_atomic.cpp
openmp/runtime/test/atomic/kmp_atomic_cas.c
openmp/runtime/test/atomic/kmp_atomic_cas_cpt.c
openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
|