1
1

ATOMICS: renamed atomic calls to unsigned datatypes

Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
Этот коммит содержится в:
Sergey Oblomov 2018-07-13 11:33:28 +03:00
родитель 9d3a79925b
Коммит bd84165277
12 изменённых файлов: 294 добавлений и 232 удалений

Просмотреть файл

@ -379,39 +379,39 @@ OSHMEM_DECLSPEC long long pshmem_longlong_fadd(long long *target, long long valu
#endif
/* Atomic Fetch&And */
OSHMEM_DECLSPEC int pshmem_int_atomic_fand(int *target, int value, int pe);
OSHMEM_DECLSPEC long pshmem_long_atomic_fand(long *target, long value, int pe);
OSHMEM_DECLSPEC long long pshmem_longlong_atomic_fand(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_fand(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_fand, \
long*: pshmem_long_atomic_fand, \
long long*: pshmem_longlong_atomic_fand)(dst, val, pe)
OSHMEM_DECLSPEC unsigned int pshmem_uint_atomic_fetch_and(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long pshmem_ulong_atomic_fetch_and(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long pshmem_ulonglong_atomic_fetch_and(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_fetch_and(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_fetch_and, \
unsigned long*: pshmem_ulong_atomic_fetch_and, \
unsigned long long*: pshmem_ulonglong_atomic_fetch_and)(dst, val, pe)
#endif
/* Atomic Fetch&Or */
OSHMEM_DECLSPEC int pshmem_int_atomic_for(int *target, int value, int pe);
OSHMEM_DECLSPEC long pshmem_long_atomic_for(long *target, long value, int pe);
OSHMEM_DECLSPEC long long pshmem_longlong_atomic_for(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_for(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_for, \
long*: pshmem_long_atomic_for, \
long long*: pshmem_longlong_atomic_for)(dst, val, pe)
OSHMEM_DECLSPEC unsigned int pshmem_uint_atomic_fetch_or(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long pshmem_ulong_atomic_fetch_or(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long pshmem_ulonglong_atomic_fetch_or(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_fetch_or(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_fetch_or, \
unsigned long*: pshmem_ulong_atomic_fetch_or, \
unsigned long long*: pshmem_ulonglong_atomic_fetch_or)(dst, val, pe)
#endif
/* Atomic Fetch&Xor */
OSHMEM_DECLSPEC int pshmem_int_atomic_fxor(int *target, int value, int pe);
OSHMEM_DECLSPEC long pshmem_long_atomic_fxor(long *target, long value, int pe);
OSHMEM_DECLSPEC long long pshmem_longlong_atomic_fxor(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_fxor(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_fxor, \
long*: pshmem_long_atomic_fxor, \
long long*: pshmem_longlong_atomic_fxor)(dst, val, pe)
OSHMEM_DECLSPEC unsigned int pshmem_uint_atomic_fetch_xor(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long pshmem_ulong_atomic_fetch_xor(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long pshmem_ulonglong_atomic_fetch_xor(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_fetch_xor(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_fetch_xor, \
unsigned long*: pshmem_ulong_atomic_fetch_xor, \
unsigned long long*: pshmem_ulonglong_atomic_fetch_xor)(dst, val, pe)
#endif
/* Atomic Fetch */
@ -455,39 +455,39 @@ OSHMEM_DECLSPEC void pshmem_longlong_add(long long *target, long long value, int
#endif
/* Atomic And */
OSHMEM_DECLSPEC void pshmem_int_atomic_and(int *target, int value, int pe);
OSHMEM_DECLSPEC void pshmem_long_atomic_and(long *target, long value, int pe);
OSHMEM_DECLSPEC void pshmem_longlong_atomic_and(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_and(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_and, \
long*: pshmem_long_atomic_and, \
long long*: pshmem_longlong_atomic_and)(dst, val, pe)
OSHMEM_DECLSPEC void pshmem_uint_atomic_and(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void pshmem_ulong_atomic_and(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_and(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_and(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_and, \
unsigned iong*: pshmem_ulong_atomic_and, \
unsigned iong long*: pshmem_ulonglong_atomic_and)(dst, val, pe)
#endif
/* Atomic Or */
OSHMEM_DECLSPEC void pshmem_int_atomic_or(int *target, int value, int pe);
OSHMEM_DECLSPEC void pshmem_long_atomic_or(long *target, long value, int pe);
OSHMEM_DECLSPEC void pshmem_longlong_atomic_or(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_or(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_or, \
long*: pshmem_long_atomic_or, \
long long*: pshmem_longlong_atomic_or)(dst, val, pe)
OSHMEM_DECLSPEC void pshmem_uint_atomic_or(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void pshmem_ulong_atomic_or(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_or(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_or(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_or, \
unsigned iong*: pshmem_ulong_atomic_or, \
unsigned iong long*: pshmem_ulonglong_atomic_or)(dst, val, pe)
#endif
/* Atomic Xor */
OSHMEM_DECLSPEC void pshmem_int_atomic_xor(int *target, int value, int pe);
OSHMEM_DECLSPEC void pshmem_long_atomic_xor(long *target, long value, int pe);
OSHMEM_DECLSPEC void pshmem_longlong_atomic_xor(long long *target, long long value, int pe);
#if OSHMEMP_HAVE_C11
#define pshmem_atomic_xor(dst, val, pe) \
_Generic(&*(dst), \
int*: pshmem_int_atomic_xor, \
long*: pshmem_long_atomic_xor, \
long long*: pshmem_longlong_atomic_xor)(dst, val, pe)
OSHMEM_DECLSPEC void pshmem_uint_atomic_xor(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void pshmem_ulong_atomic_xor(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_xor(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define pshmem_atomic_xor(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: pshmem_uint_atomic_xor, \
unsigned iong*: pshmem_ulong_atomic_xor, \
unsigned iong long*: pshmem_ulonglong_atomic_xor)(dst, val, pe)
#endif
/* Atomic Inc */

Просмотреть файл

@ -90,16 +90,22 @@ OSHMEM_DECLSPEC int32_t pshmemx_int32_fadd(int32_t *target, int32_t value, int p
OSHMEM_DECLSPEC int64_t pshmemx_int64_fadd(int64_t *target, int64_t value, int pe);
/* Atomic Fetch&And */
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fand(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fand(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_and(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_and(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_and(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_and(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch&Or */
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_for(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_for(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_or(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_or(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_or(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_or(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch&Xor */
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fxor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fxor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_xor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_xor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_xor(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_xor(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch */
OSHMEM_DECLSPEC int32_t pshmemx_int32_fetch(const int32_t *target, int pe);
@ -116,14 +122,20 @@ OSHMEM_DECLSPEC void pshmemx_int64_add(int64_t *target, int64_t value, int pe);
/* Atomic And */
OSHMEM_DECLSPEC void pshmemx_int32_atomic_and(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_atomic_and(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint32_atomic_and(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint64_atomic_and(uint64_t *target, uint64_t value, int pe);
/* Atomic Or */
OSHMEM_DECLSPEC void pshmemx_int32_atomic_or(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_atomic_or(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint32_atomic_or(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint64_atomic_or(uint64_t *target, uint64_t value, int pe);
/* Atomic Xor */
OSHMEM_DECLSPEC void pshmemx_int32_atomic_xor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_int64_atomic_xor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint32_atomic_xor(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void pshmemx_uint64_atomic_xor(uint64_t *target, uint64_t value, int pe);
/* Atomic Inc */
OSHMEM_DECLSPEC void pshmemx_int32_inc(int32_t *target, int pe);

Просмотреть файл

@ -464,39 +464,39 @@ OSHMEM_DECLSPEC long long shmem_longlong_fadd(long long *target, long long value
#endif
/* Atomic Fetch&And */
OSHMEM_DECLSPEC int shmem_int_atomic_fand(int *target, int value, int pe);
OSHMEM_DECLSPEC long shmem_long_atomic_fand(long *target, long value, int pe);
OSHMEM_DECLSPEC long long shmem_longlong_atomic_fand(long long *target, long long value, int pe);
OSHMEM_DECLSPEC unsigned int shmem_uint_atomic_fetch_and(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long shmem_ulong_atomic_fetch_and(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long shmem_ulonglong_atomic_fetch_and(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_fand(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_fand, \
long*: shmem_long_atomic_fand, \
long long*: shmem_longlong_atomic_fand)(dst, val, pe)
#define shmem_atomic_fetch_and(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: shmem_uint_atomic_fetch_and, \
unsigned long*: shmem_ulong_atomic_fetch_and, \
unsigned long long*: shmem_ulonglong_atomic_fetch_and)(dst, val, pe)
#endif
/* Atomic Fetch&Or */
OSHMEM_DECLSPEC int shmem_int_atomic_for(int *target, int value, int pe);
OSHMEM_DECLSPEC long shmem_long_atomic_for(long *target, long value, int pe);
OSHMEM_DECLSPEC long long shmem_longlong_atomic_for(long long *target, long long value, int pe);
OSHMEM_DECLSPEC unsigned int shmem_uint_atomic_fetch_or(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long shmem_ulong_atomic_fetch_or(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long shmem_ulonglong_atomic_fetch_or(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_for(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_for, \
long*: shmem_long_atomic_for, \
long long*: shmem_longlong_atomic_for)(dst, val, pe)
#define shmem_atomic_fetch_or(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: shmem_uint_atomic_fetch_or, \
unsigned long*: shmem_ulong_atomic_fetch_or, \
unsigned long long*: shmem_ulonglong_atomic_fetch_or)(dst, val, pe)
#endif
/* Atomic Fetch&Xor */
OSHMEM_DECLSPEC int shmem_int_atomic_fxor(int *target, int value, int pe);
OSHMEM_DECLSPEC long shmem_long_atomic_fxor(long *target, long value, int pe);
OSHMEM_DECLSPEC long long shmem_longlong_atomic_fxor(long long *target, long long value, int pe);
OSHMEM_DECLSPEC unsigned int shmem_uint_atomic_fetch_xor(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC unsigned long shmem_ulong_atomic_fetch_xor(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC unsigned long long shmem_ulonglong_atomic_fetch_xor(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_fxor(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_fxor, \
long*: shmem_long_atomic_fxor, \
long long*: shmem_longlong_atomic_fxor)(dst, val, pe)
#define shmem_atomic_fetch_xor(dst, val, pe) \
_Generic(&*(dst), \
unsigned int*: shmem_uint_atomic_fetch_xor, \
unsigned long*: shmem_ulong_atomic_fetch_xor, \
unsigned long long*: shmem_ulonglong_atomic_fetch_xor)(dst, val, pe)
#endif
/* Atomic Fetch */
@ -540,39 +540,39 @@ OSHMEM_DECLSPEC void shmem_longlong_add(long long *target, long long value, int
#endif
/* Atomic And */
OSHMEM_DECLSPEC void shmem_int_atomic_and(int *target, int value, int pe);
OSHMEM_DECLSPEC void shmem_long_atomic_and(long *target, long value, int pe);
OSHMEM_DECLSPEC void shmem_longlong_atomic_and(long long *target, long long value, int pe);
OSHMEM_DECLSPEC void shmem_uint_atomic_and(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void shmem_ulong_atomic_and(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void shmem_ulonglong_atomic_and(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_and(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_and, \
long*: shmem_long_atomic_and, \
long long*: shmem_longlong_atomic_and)(dst, val, pe)
unsigned int*: shmem_uint_atomic_and, \
unsigned iong*: shmem_ulong_atomic_and, \
unsigned iong long*: shmem_ulonglong_atomic_and)(dst, val, pe)
#endif
/* Atomic Or */
OSHMEM_DECLSPEC void shmem_int_atomic_or(int *target, int value, int pe);
OSHMEM_DECLSPEC void shmem_long_atomic_or(long *target, long value, int pe);
OSHMEM_DECLSPEC void shmem_longlong_atomic_or(long long *target, long long value, int pe);
OSHMEM_DECLSPEC void shmem_uint_atomic_or(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void shmem_ulong_atomic_or(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void shmem_ulonglong_atomic_or(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_or(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_or, \
long*: shmem_long_atomic_or, \
long long*: shmem_longlong_atomic_or)(dst, val, pe)
unsigned int*: shmem_uint_atomic_or, \
unsigned iong*: shmem_ulong_atomic_or, \
unsigned iong long*: shmem_ulonglong_atomic_or)(dst, val, pe)
#endif
/* Atomic Xor */
OSHMEM_DECLSPEC void shmem_int_atomic_xor(int *target, int value, int pe);
OSHMEM_DECLSPEC void shmem_long_atomic_xor(long *target, long value, int pe);
OSHMEM_DECLSPEC void shmem_longlong_atomic_xor(long long *target, long long value, int pe);
OSHMEM_DECLSPEC void shmem_uint_atomic_xor(unsigned int *target, unsigned int value, int pe);
OSHMEM_DECLSPEC void shmem_ulong_atomic_xor(unsigned long *target, unsigned long value, int pe);
OSHMEM_DECLSPEC void shmem_ulonglong_atomic_xor(unsigned long long *target, unsigned long long value, int pe);
#if OSHMEM_HAVE_C11
#define shmem_atomic_xor(dst, val, pe) \
_Generic(&*(dst), \
int*: shmem_int_atomic_xor, \
long*: shmem_long_atomic_xor, \
long long*: shmem_longlong_atomic_xor)(dst, val, pe)
unsigned int*: shmem_uint_atomic_xor, \
unsigned iong*: shmem_ulong_atomic_xor, \
unsigned iong long*: shmem_ulonglong_atomic_xor)(dst, val, pe)
#endif
/* Atomic Inc */

Просмотреть файл

@ -77,16 +77,22 @@ OSHMEM_DECLSPEC int32_t shmemx_int32_fadd(int32_t *target, int32_t value, int pe
OSHMEM_DECLSPEC int64_t shmemx_int64_fadd(int64_t *target, int64_t value, int pe);
/* Atomic Fetch&And */
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fand(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fand(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_and(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_and(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_and(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_and(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch&Or */
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_for(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_for(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_or(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_or(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_or(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_or(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch&Xor */
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fxor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fxor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_xor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_xor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_xor(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_xor(uint64_t *target, uint64_t value, int pe);
/* Atomic Fetch */
OSHMEM_DECLSPEC int32_t shmemx_int32_fetch(const int32_t *target, int pe);
@ -103,14 +109,20 @@ OSHMEM_DECLSPEC void shmemx_int64_add(int64_t *target, int64_t value, int pe);
/* Atomic And */
OSHMEM_DECLSPEC void shmemx_int32_atomic_and(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int64_atomic_and(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint32_atomic_and(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint64_atomic_and(uint64_t *target, uint64_t value, int pe);
/* Atomic Or */
OSHMEM_DECLSPEC void shmemx_int32_atomic_or(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int64_atomic_or(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint32_atomic_or(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint64_atomic_or(uint64_t *target, uint64_t value, int pe);
/* Atomic Xor */
OSHMEM_DECLSPEC void shmemx_int32_atomic_xor(int32_t *target, int32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_int64_atomic_xor(int64_t *target, int64_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint32_atomic_xor(uint32_t *target, uint32_t value, int pe);
OSHMEM_DECLSPEC void shmemx_uint64_atomic_xor(uint64_t *target, uint64_t value, int pe);
/* Atomic Inc */
OSHMEM_DECLSPEC void shmemx_int32_inc(int32_t *target, int pe);

Просмотреть файл

@ -35,48 +35,48 @@ BEGIN_C_DECLS
#define OSHMEM_ATOMIC_PTR_2_INT(ptr, size) ((size) == 8 ? *(uint64_t*)(ptr) : *(uint32_t*)(ptr))
#define OSHMEM_TYPE_OP(type_name, type, prefix, op) \
void prefix##type_name##_atomic_##op(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
\
RUNTIME_CHECK_INIT(); \
RUNTIME_CHECK_PE(pe); \
RUNTIME_CHECK_ADDR(target); \
\
size = sizeof(value); \
rc = MCA_ATOMIC_CALL(op( \
(void*)target, \
value, \
size, \
pe)); \
RUNTIME_CHECK_RC(rc); \
\
return; \
#define OSHMEM_TYPE_OP(type_name, type, prefix, op) \
void prefix##_##type_name##_atomic_##op(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
\
RUNTIME_CHECK_INIT(); \
RUNTIME_CHECK_PE(pe); \
RUNTIME_CHECK_ADDR(target); \
\
size = sizeof(value); \
rc = MCA_ATOMIC_CALL(op( \
(void*)target, \
value, \
size, \
pe)); \
RUNTIME_CHECK_RC(rc); \
\
return; \
}
#define OSHMEM_TYPE_FOP(type_name, type, prefix, op) \
type prefix##type_name##_atomic_##op(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
type out_value; \
\
RUNTIME_CHECK_INIT(); \
RUNTIME_CHECK_PE(pe); \
RUNTIME_CHECK_ADDR(target); \
\
size = sizeof(out_value); \
rc = MCA_ATOMIC_CALL(op( \
(void*)target, \
(void*)&out_value, \
value, \
size, \
pe)); \
RUNTIME_CHECK_RC(rc); \
\
return out_value; \
#define OSHMEM_TYPE_FOP(type_name, type, prefix, op) \
type prefix##_##type_name##_atomic_fetch_##op(type *target, type value, int pe) \
{ \
int rc = OSHMEM_SUCCESS; \
size_t size = 0; \
type out_value; \
\
RUNTIME_CHECK_INIT(); \
RUNTIME_CHECK_PE(pe); \
RUNTIME_CHECK_ADDR(target); \
\
size = sizeof(out_value); \
rc = MCA_ATOMIC_CALL(f##op( \
(void*)target, \
(void*)&out_value, \
value, \
size, \
pe)); \
RUNTIME_CHECK_RC(rc); \
\
return out_value; \
}
/* ******************************************************************** */

Просмотреть файл

@ -237,25 +237,31 @@
#define shmemx_int64_fadd pshmemx_int64_fadd
/* Atomic Fetch&And */
#define shmem_int_atomic_fand pshmem_int_atomic_fand
#define shmem_long_atomic_fand pshmem_long_atomic_fand
#define shmem_longlong_atomic_fand pshmem_longlong_atomic_fand
#define shmemx_int32_atomic_fand pshmemx_int32_atomic_fand
#define shmemx_int64_atomic_fand pshmemx_int64_atomic_fand
#define shmem_uint_atomic_fetch_and pshmem_uint_atomic_fetch_and
#define shmem_ulong_atomic_fetch_and pshmem_ulong_atomic_fetch_and
#define shmem_ulonglong_atomic_fetch_and pshmem_ulonglong_atomic_fetch_and
#define shmemx_int32_atomic_fetch_and pshmemx_int32_atomic_fetch_and
#define shmemx_int64_atomic_fetch_and pshmemx_int64_atomic_fetch_and
#define shmemx_uint32_atomic_fetch_and pshmemx_uint32_atomic_fetch_and
#define shmemx_uint64_atomic_fetch_and pshmemx_uint64_atomic_fetch_and
/* Atomic Fetch&Or */
#define shmem_int_atomic_for pshmem_int_atomic_for
#define shmem_long_atomic_for pshmem_long_atomic_for
#define shmem_longlong_atomic_for pshmem_longlong_atomic_for
#define shmemx_int32_atomic_for pshmemx_int32_atomic_for
#define shmemx_int64_atomic_for pshmemx_int64_atomic_for
#define shmem_uint_atomic_fetch_or pshmem_uint_atomic_fetch_or
#define shmem_ulong_atomic_fetch_or pshmem_ulong_atomic_fetch_or
#define shmem_ulonglong_atomic_fetch_or pshmem_ulonglong_atomic_fetch_or
#define shmemx_int32_atomic_fetch_or pshmemx_int32_atomic_fetch_or
#define shmemx_int64_atomic_fetch_or pshmemx_int64_atomic_fetch_or
#define shmemx_uint32_atomic_fetch_or pshmemx_uint32_atomic_fetch_or
#define shmemx_uint64_atomic_fetch_or pshmemx_uint64_atomic_fetch_or
/* Atomic Fetch&Xor */
#define shmem_int_atomic_fxor pshmem_int_atomic_fxor
#define shmem_long_atomic_fxor pshmem_long_atomic_fxor
#define shmem_longlong_atomic_fxor pshmem_longlong_atomic_fxor
#define shmemx_int32_atomic_fxor pshmemx_int32_atomic_fxor
#define shmemx_int64_atomic_fxor pshmemx_int64_atomic_fxor
#define shmem_uint_atomic_fetch_xor pshmem_uint_atomic_fetch_xor
#define shmem_ulong_atomic_fetch_xor pshmem_ulong_atomic_fetch_xor
#define shmem_ulonglong_atomic_fetch_xor pshmem_ulonglong_atomic_fetch_xor
#define shmemx_int32_atomic_fetch_xor pshmemx_int32_atomic_fetch_xor
#define shmemx_int64_atomic_fetch_xor pshmemx_int64_atomic_fetch_xor
#define shmemx_uint32_atomic_fetch_xor pshmemx_uint32_atomic_fetch_xor
#define shmemx_uint64_atomic_fetch_xor pshmemx_uint64_atomic_fetch_xor
/* Atomic Fetch */
#define shmem_double_fetch pshmem_double_fetch
@ -281,25 +287,31 @@
#define shmemx_int64_add pshmemx_int64_add
/* Atomic And */
#define shmem_int_atomic_and pshmem_int_atomic_and
#define shmem_long_atomic_and pshmem_long_atomic_and
#define shmem_longlong_atomic_and pshmem_longlong_atomic_and
#define shmem_uint_atomic_and pshmem_uint_atomic_and
#define shmem_ulong_atomic_and pshmem_ulong_atomic_and
#define shmem_ulonglong_atomic_and pshmem_ulonglong_atomic_and
#define shmemx_int32_atomic_and pshmemx_int32_atomic_and
#define shmemx_int64_atomic_and pshmemx_int64_atomic_and
#define shmemx_uint32_atomic_and pshmemx_uint32_atomic_and
#define shmemx_uint64_atomic_and pshmemx_uint64_atomic_and
/* Atomic Or */
#define shmem_int_atomic_or pshmem_int_atomic_or
#define shmem_long_atomic_or pshmem_long_atomic_or
#define shmem_longlong_atomic_or pshmem_longlong_atomic_or
#define shmem_uint_atomic_or pshmem_uint_atomic_or
#define shmem_ulong_atomic_or pshmem_ulong_atomic_or
#define shmem_ulonglong_atomic_or pshmem_ulonglong_atomic_or
#define shmemx_int32_atomic_or pshmemx_int32_atomic_or
#define shmemx_int64_atomic_or pshmemx_int64_atomic_or
#define shmemx_uint32_atomic_or pshmemx_uint32_atomic_or
#define shmemx_uint64_atomic_or pshmemx_uint64_atomic_or
/* Atomic Xor */
#define shmem_int_atomic_xor pshmem_int_atomic_xor
#define shmem_long_atomic_xor pshmem_long_atomic_xor
#define shmem_longlong_atomic_xor pshmem_longlong_atomic_xor
#define shmem_uint_atomic_xor pshmem_uint_atomic_xor
#define shmem_ulong_atomic_xor pshmem_ulong_atomic_xor
#define shmem_ulonglong_atomic_xor pshmem_ulonglong_atomic_xor
#define shmemx_int32_atomic_xor pshmemx_int32_atomic_xor
#define shmemx_int64_atomic_xor pshmemx_int64_atomic_xor
#define shmemx_uint32_atomic_xor pshmemx_uint32_atomic_xor
#define shmemx_uint64_atomic_xor pshmemx_uint64_atomic_xor
/* Atomic Inc */
#define shmem_int_inc pshmem_int_inc

Просмотреть файл

@ -25,16 +25,20 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_and = pshmem_int_atomic_and
#pragma weak shmem_long_atomic_and = pshmem_long_atomic_and
#pragma weak shmem_longlong_atomic_and = pshmem_longlong_atomic_and
#pragma weak shmemx_int32_atomic_and = pshmemx_int32_atomic_and
#pragma weak shmemx_int64_atomic_and = pshmemx_int64_atomic_and
#pragma weak shmem_uint_atomic_and = pshmem_uint_atomic_and
#pragma weak shmem_ulong_atomic_and = pshmem_ulong_atomic_and
#pragma weak shmem_ulonglong_atomic_and = pshmem_ulonglong_atomic_and
#pragma weak shmemx_int32_atomic_and = pshmemx_int32_atomic_and
#pragma weak shmemx_int64_atomic_and = pshmemx_int64_atomic_and
#pragma weak shmemx_uint32_atomic_and = pshmemx_uint32_atomic_and
#pragma weak shmemx_uint64_atomic_and = pshmemx_uint64_atomic_and
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_OP(_int, int, shmem, and)
OSHMEM_TYPE_OP(_long, long, shmem, and)
OSHMEM_TYPE_OP(_longlong, long long, shmem, and)
OSHMEM_TYPE_OP(_int32, int32_t, shmemx, and)
OSHMEM_TYPE_OP(_int64, int64_t, shmemx, and)
OSHMEM_TYPE_OP(uint, unsigned int, shmem, and)
OSHMEM_TYPE_OP(ulong, unsigned long, shmem, and)
OSHMEM_TYPE_OP(ulonglong, unsigned long long, shmem, and)
OSHMEM_TYPE_OP(int32, int32_t, shmemx, and)
OSHMEM_TYPE_OP(int64, int64_t, shmemx, and)
OSHMEM_TYPE_OP(uint32, uint32_t, shmemx, and)
OSHMEM_TYPE_OP(uint64, uint64_t, shmemx, and)

Просмотреть файл

@ -27,16 +27,22 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_fand = pshmem_int_atomic_fand
#pragma weak shmem_long_atomic_fand = pshmem_long_atomic_fand
#pragma weak shmem_longlong_atomic_fand = pshmem_longlong_atomic_fand
#pragma weak shmemx_int32_atomic_fand = pshmemx_int32_atomic_fand
#pragma weak shmemx_int64_atomic_fand = pshmemx_int64_atomic_fand
#pragma weak shmem_uint_atomic_fetch_and = pshmem_uint_atomic_fetch_and
#pragma weak shmem_ulong_atomic_fetch_and = pshmem_ulong_atomic_fetch_and
#pragma weak shmem_ulonglong_atomic_fetch_and = pshmem_ulonglong_atomic_fetch_and
#pragma weak shmemx_int32_atomic_fetch_and = pshmemx_int32_atomic_fetch_and
#pragma weak shmemx_int64_atomic_fetch_and = pshmemx_int64_atomic_fetch_and
#pragma weak shmemx_uint32_atomic_fetch_and = pshmemx_uint32_atomic_fetch_and
#pragma weak shmemx_uint64_atomic_fetch_and = pshmemx_uint64_atomic_fetch_and
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_FOP(_int, int, shmem, fand)
OSHMEM_TYPE_FOP(_long, long, shmem, fand)
OSHMEM_TYPE_FOP(_longlong, long long, shmem, fand)
OSHMEM_TYPE_FOP(_int32, int32_t, shmemx, fand)
OSHMEM_TYPE_FOP(_int64, int64_t, shmemx, fand)
unsigned int shmem_uint_atomic_fand(unsigned int *target, unsigned int value, int pe);
OSHMEM_TYPE_FOP(uint, unsigned int, shmem, and)
OSHMEM_TYPE_FOP(ulong, unsigned long, shmem, and)
OSHMEM_TYPE_FOP(ulonglong, unsigned long long, shmem, and)
OSHMEM_TYPE_FOP(int32, int32_t, shmemx, and)
OSHMEM_TYPE_FOP(int64, int64_t, shmemx, and)
OSHMEM_TYPE_FOP(uint32, uint32_t, shmemx, and)
OSHMEM_TYPE_FOP(uint64, uint64_t, shmemx, and)

Просмотреть файл

@ -27,16 +27,20 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_for = pshmem_int_atomic_for
#pragma weak shmem_long_atomic_for = pshmem_long_atomic_for
#pragma weak shmem_longlong_atomic_for = pshmem_longlong_atomic_for
#pragma weak shmemx_int32_atomic_for = pshmemx_int32_atomic_for
#pragma weak shmemx_int64_atomic_for = pshmemx_int64_atomic_for
#pragma weak shmem_uint_atomic_fetch_or = pshmem_uint_atomic_fetch_or
#pragma weak shmem_ulong_atomic_fetch_or = pshmem_ulong_atomic_fetch_or
#pragma weak shmem_ulonglong_atomic_fetch_or = pshmem_ulonglong_atomic_fetch_or
#pragma weak shmemx_int32_atomic_fetch_or = pshmemx_int32_atomic_fetch_or
#pragma weak shmemx_int64_atomic_fetch_or = pshmemx_int64_atomic_fetch_or
#pragma weak shmemx_uint32_atomic_fetch_or = pshmemx_uint32_atomic_fetch_or
#pragma weak shmemx_uint64_atomic_fetch_or = pshmemx_uint64_atomic_fetch_or
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_FOP(_int, int, shmem, for)
OSHMEM_TYPE_FOP(_long, long, shmem, for)
OSHMEM_TYPE_FOP(_longlong, long long, shmem, for)
OSHMEM_TYPE_FOP(_int32, int32_t, shmemx, for)
OSHMEM_TYPE_FOP(_int64, int64_t, shmemx, for)
OSHMEM_TYPE_FOP(uint, unsigned int, shmem, or)
OSHMEM_TYPE_FOP(ulong, unsigned long, shmem, or)
OSHMEM_TYPE_FOP(ulonglong, unsigned long long, shmem, or)
OSHMEM_TYPE_FOP(int32, int32_t, shmemx, or)
OSHMEM_TYPE_FOP(int64, int64_t, shmemx, or)
OSHMEM_TYPE_FOP(uint32, uint32_t, shmemx, or)
OSHMEM_TYPE_FOP(uint64, uint64_t, shmemx, or)

Просмотреть файл

@ -27,16 +27,20 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_fxor = pshmem_int_atomic_fxor
#pragma weak shmem_long_atomic_fxor = pshmem_long_atomic_fxor
#pragma weak shmem_longlong_atomic_fxor = pshmem_longlong_atomic_fxor
#pragma weak shmemx_int32_atomic_fxor = pshmemx_int32_atomic_fxor
#pragma weak shmemx_int64_atomic_fxor = pshmemx_int64_atomic_fxor
#pragma weak shmem_uint_atomic_fetch_xor = pshmem_uint_atomic_fetch_xor
#pragma weak shmem_ulong_atomic_fetch_xor = pshmem_ulong_atomic_fetch_xor
#pragma weak shmem_ulonglong_atomic_fetch_xor = pshmem_ulonglong_atomic_fetch_xor
#pragma weak shmemx_int32_atomic_fetch_xor = pshmemx_int32_atomic_fetch_xor
#pragma weak shmemx_int64_atomic_fetch_xor = pshmemx_int64_atomic_fetch_xor
#pragma weak shmemx_uint32_atomic_fetch_xor = pshmemx_uint32_atomic_fetch_xor
#pragma weak shmemx_uint64_atomic_fetch_xor = pshmemx_uint64_atomic_fetch_xor
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_FOP(_int, int, shmem, fxor)
OSHMEM_TYPE_FOP(_long, long, shmem, fxor)
OSHMEM_TYPE_FOP(_longlong, long long, shmem, fxor)
OSHMEM_TYPE_FOP(_int32, int32_t, shmemx, fxor)
OSHMEM_TYPE_FOP(_int64, int64_t, shmemx, fxor)
OSHMEM_TYPE_FOP(uint, unsigned int, shmem, xor)
OSHMEM_TYPE_FOP(ulong, unsigned long, shmem, xor)
OSHMEM_TYPE_FOP(ulonglong, unsigned long long, shmem, xor)
OSHMEM_TYPE_FOP(int32, int32_t, shmemx, xor)
OSHMEM_TYPE_FOP(int64, int64_t, shmemx, xor)
OSHMEM_TYPE_FOP(uint32, uint32_t, shmemx, xor)
OSHMEM_TYPE_FOP(uint64, uint64_t, shmemx, xor)

Просмотреть файл

@ -25,16 +25,20 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_or = pshmem_int_atomic_or
#pragma weak shmem_long_atomic_or = pshmem_long_atomic_or
#pragma weak shmem_longlong_atomic_or = pshmem_longlong_atomic_or
#pragma weak shmemx_int32_atomic_or = pshmemx_int32_atomic_or
#pragma weak shmemx_int64_atomic_or = pshmemx_int64_atomic_or
#pragma weak shmem_uint_atomic_or = pshmem_uint_atomic_or
#pragma weak shmem_ulong_atomic_or = pshmem_ulong_atomic_or
#pragma weak shmem_ulonglong_atomic_or = pshmem_ulonglong_atomic_or
#pragma weak shmemx_int32_atomic_or = pshmemx_int32_atomic_or
#pragma weak shmemx_int64_atomic_or = pshmemx_int64_atomic_or
#pragma weak shmemx_uint32_atomic_or = pshmemx_uint32_atomic_or
#pragma weak shmemx_uint64_atomic_or = pshmemx_uint64_atomic_or
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_OP(_int, int, shmem, or)
OSHMEM_TYPE_OP(_long, long, shmem, or)
OSHMEM_TYPE_OP(_longlong, long long, shmem, or)
OSHMEM_TYPE_OP(_int32, int32_t, shmemx, or)
OSHMEM_TYPE_OP(_int64, int64_t, shmemx, or)
OSHMEM_TYPE_OP(uint, unsigned int, shmem, or)
OSHMEM_TYPE_OP(ulong, unsigned long, shmem, or)
OSHMEM_TYPE_OP(ulonglong, unsigned long long, shmem, or)
OSHMEM_TYPE_OP(int32, int32_t, shmemx, or)
OSHMEM_TYPE_OP(int64, int64_t, shmemx, or)
OSHMEM_TYPE_OP(uint32, uint32_t, shmemx, or)
OSHMEM_TYPE_OP(uint64, uint64_t, shmemx, or)

Просмотреть файл

@ -25,16 +25,20 @@
*/
#if OSHMEM_PROFILING
#include "oshmem/include/pshmem.h"
#pragma weak shmem_int_atomic_xor = pshmem_int_atomic_xor
#pragma weak shmem_long_atomic_xor = pshmem_long_atomic_xor
#pragma weak shmem_longlong_atomic_xor = pshmem_longlong_atomic_xor
#pragma weak shmemx_int32_atomic_xor = pshmemx_int32_atomic_xor
#pragma weak shmemx_int64_atomic_xor = pshmemx_int64_atomic_xor
#pragma weak shmem_uint_atomic_xor = pshmem_uint_atomic_xor
#pragma weak shmem_ulong_atomic_xor = pshmem_ulong_atomic_xor
#pragma weak shmem_ulonglong_atomic_xor = pshmem_ulonglong_atomic_xor
#pragma weak shmemx_int32_atomic_xor = pshmemx_int32_atomic_xor
#pragma weak shmemx_int64_atomic_xor = pshmemx_int64_atomic_xor
#pragma weak shmemx_uint32_atomic_xor = pshmemx_uint32_atomic_xor
#pragma weak shmemx_uint64_atomic_xor = pshmemx_uint64_atomic_xor
#include "oshmem/shmem/c/profile/defines.h"
#endif
OSHMEM_TYPE_OP(_int, int, shmem, xor)
OSHMEM_TYPE_OP(_long, long, shmem, xor)
OSHMEM_TYPE_OP(_longlong, long long, shmem, xor)
OSHMEM_TYPE_OP(_int32, int32_t, shmemx, xor)
OSHMEM_TYPE_OP(_int64, int64_t, shmemx, xor)
OSHMEM_TYPE_OP(uint, unsigned int, shmem, xor)
OSHMEM_TYPE_OP(ulong, unsigned long, shmem, xor)
OSHMEM_TYPE_OP(ulonglong, unsigned long long, shmem, xor)
OSHMEM_TYPE_OP(int32, int32_t, shmemx, xor)
OSHMEM_TYPE_OP(int64, int64_t, shmemx, xor)
OSHMEM_TYPE_OP(uint32, uint32_t, shmemx, xor)
OSHMEM_TYPE_OP(uint64, uint64_t, shmemx, xor)