Skip to content
Snippets Groups Projects
Commit deb8829c authored by Andreas Beckmann's avatar Andreas Beckmann
Browse files

switch from __sync_add_and_fetch to __atomic_add_fetch

parent 2fb5858e
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ Notable User Facing Changes
* and other small fixes and improvements
- All device names used to control the platform setup via
POCL_DEVICES are now lower case (as documented in the user manual).
- Switch from __sync_*() to __atomic_*() (compiler builtins).
3.0 June 2022
=============
......
......@@ -77,9 +77,9 @@ typedef pthread_t pocl_thread_t;
#if defined(__GNUC__) || defined(__clang__)
/* These return the new value. */
/* See: https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html */
#define POCL_ATOMIC_INC(x) __sync_add_and_fetch (&x, 1)
#define POCL_ATOMIC_DEC(x) __sync_sub_and_fetch (&x, 1)
/* See: https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gcc/_005f_005fatomic-Builtins.html */
#define POCL_ATOMIC_INC(x) __atomic_add_fetch (&x, 1, __ATOMIC_SEQ_CST)
#define POCL_ATOMIC_DEC(x) __atomic_sub_fetch (&x, 1, __ATOMIC_SEQ_CST)
#elif defined(_WIN32)
#define POCL_ATOMIC_INC(x) InterlockedIncrement64 (&x)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment