From bd841652776eefe39d9f234870932bd79603a0b5 Mon Sep 17 00:00:00 2001 From: Sergey Oblomov Date: Fri, 13 Jul 2018 11:33:28 +0300 Subject: [PATCH 1/2] ATOMICS: renamed atomic calls to unsigned datatypes Signed-off-by: Sergey Oblomov --- oshmem/include/pshmem.h | 108 +++++++++++++++---------------- oshmem/include/pshmemx.h | 24 +++++-- oshmem/include/shmem.h.in | 84 ++++++++++++------------ oshmem/include/shmemx.h | 24 +++++-- oshmem/mca/atomic/atomic.h | 80 +++++++++++------------ oshmem/shmem/c/profile/defines.h | 60 ++++++++++------- oshmem/shmem/c/shmem_and.c | 24 ++++--- oshmem/shmem/c/shmem_fand.c | 26 +++++--- oshmem/shmem/c/shmem_for.c | 24 ++++--- oshmem/shmem/c/shmem_fxor.c | 24 ++++--- oshmem/shmem/c/shmem_or.c | 24 ++++--- oshmem/shmem/c/shmem_xor.c | 24 ++++--- 12 files changed, 294 insertions(+), 232 deletions(-) diff --git a/oshmem/include/pshmem.h b/oshmem/include/pshmem.h index f01201b403..8f5e6b9115 100644 --- a/oshmem/include/pshmem.h +++ b/oshmem/include/pshmem.h @@ -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 */ diff --git a/oshmem/include/pshmemx.h b/oshmem/include/pshmemx.h index f5472f6221..50a141a97d 100644 --- a/oshmem/include/pshmemx.h +++ b/oshmem/include/pshmemx.h @@ -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); diff --git a/oshmem/include/shmem.h.in b/oshmem/include/shmem.h.in index c58099f1e1..63b872c78e 100644 --- a/oshmem/include/shmem.h.in +++ b/oshmem/include/shmem.h.in @@ -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 */ diff --git a/oshmem/include/shmemx.h b/oshmem/include/shmemx.h index 22aac84c8d..da67a0cb51 100644 --- a/oshmem/include/shmemx.h +++ b/oshmem/include/shmemx.h @@ -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); diff --git a/oshmem/mca/atomic/atomic.h b/oshmem/mca/atomic/atomic.h index 8d81c386a7..ddda726726 100644 --- a/oshmem/mca/atomic/atomic.h +++ b/oshmem/mca/atomic/atomic.h @@ -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; \ } /* ******************************************************************** */ diff --git a/oshmem/shmem/c/profile/defines.h b/oshmem/shmem/c/profile/defines.h index 61ee740392..bc43d415b1 100644 --- a/oshmem/shmem/c/profile/defines.h +++ b/oshmem/shmem/c/profile/defines.h @@ -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 diff --git a/oshmem/shmem/c/shmem_and.c b/oshmem/shmem/c/shmem_and.c index cdb5174266..4f013f2e35 100644 --- a/oshmem/shmem/c/shmem_and.c +++ b/oshmem/shmem/c/shmem_and.c @@ -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) diff --git a/oshmem/shmem/c/shmem_fand.c b/oshmem/shmem/c/shmem_fand.c index 8c68eeb09f..357f902c3b 100644 --- a/oshmem/shmem/c/shmem_fand.c +++ b/oshmem/shmem/c/shmem_fand.c @@ -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) diff --git a/oshmem/shmem/c/shmem_for.c b/oshmem/shmem/c/shmem_for.c index dbc0905693..c09fa43842 100644 --- a/oshmem/shmem/c/shmem_for.c +++ b/oshmem/shmem/c/shmem_for.c @@ -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) diff --git a/oshmem/shmem/c/shmem_fxor.c b/oshmem/shmem/c/shmem_fxor.c index 193b0a6308..a95fd88e73 100644 --- a/oshmem/shmem/c/shmem_fxor.c +++ b/oshmem/shmem/c/shmem_fxor.c @@ -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) diff --git a/oshmem/shmem/c/shmem_or.c b/oshmem/shmem/c/shmem_or.c index 96e46045bf..ba9460f151 100644 --- a/oshmem/shmem/c/shmem_or.c +++ b/oshmem/shmem/c/shmem_or.c @@ -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) diff --git a/oshmem/shmem/c/shmem_xor.c b/oshmem/shmem/c/shmem_xor.c index 806e7d00e8..149fba3366 100644 --- a/oshmem/shmem/c/shmem_xor.c +++ b/oshmem/shmem/c/shmem_xor.c @@ -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) From da1afcaaaf7b2d254c0e0cc6a482774b4a7beced Mon Sep 17 00:00:00 2001 From: Sergey Oblomov Date: Mon, 16 Jul 2018 14:49:06 +0300 Subject: [PATCH 2/2] ATOMIC/UCX: fixed typo in datatype macro Signed-off-by: Sergey Oblomov --- oshmem/include/pshmem.h | 12 ++++++------ oshmem/include/shmem.h.in | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/oshmem/include/pshmem.h b/oshmem/include/pshmem.h index 8f5e6b9115..8ca0696360 100644 --- a/oshmem/include/pshmem.h +++ b/oshmem/include/pshmem.h @@ -462,8 +462,8 @@ OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_and(unsigned long long *target, uns #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) + unsigned long*: pshmem_ulong_atomic_and, \ + unsigned long long*: pshmem_ulonglong_atomic_and)(dst, val, pe) #endif /* Atomic Or */ @@ -474,8 +474,8 @@ OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_or(unsigned long long *target, unsi #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) + unsigned long*: pshmem_ulong_atomic_or, \ + unsigned long long*: pshmem_ulonglong_atomic_or)(dst, val, pe) #endif /* Atomic Xor */ @@ -486,8 +486,8 @@ OSHMEM_DECLSPEC void pshmem_ulonglong_atomic_xor(unsigned long long *target, uns #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) + unsigned long*: pshmem_ulong_atomic_xor, \ + unsigned long long*: pshmem_ulonglong_atomic_xor)(dst, val, pe) #endif /* Atomic Inc */ diff --git a/oshmem/include/shmem.h.in b/oshmem/include/shmem.h.in index 63b872c78e..cf663a8ced 100644 --- a/oshmem/include/shmem.h.in +++ b/oshmem/include/shmem.h.in @@ -547,8 +547,8 @@ OSHMEM_DECLSPEC void shmem_ulonglong_atomic_and(unsigned long long *target, unsi #define shmem_atomic_and(dst, val, pe) \ _Generic(&*(dst), \ unsigned int*: shmem_uint_atomic_and, \ - unsigned iong*: shmem_ulong_atomic_and, \ - unsigned iong long*: shmem_ulonglong_atomic_and)(dst, val, pe) + unsigned long*: shmem_ulong_atomic_and, \ + unsigned long long*: shmem_ulonglong_atomic_and)(dst, val, pe) #endif /* Atomic Or */ @@ -559,8 +559,8 @@ OSHMEM_DECLSPEC void shmem_ulonglong_atomic_or(unsigned long long *target, unsig #define shmem_atomic_or(dst, val, pe) \ _Generic(&*(dst), \ unsigned int*: shmem_uint_atomic_or, \ - unsigned iong*: shmem_ulong_atomic_or, \ - unsigned iong long*: shmem_ulonglong_atomic_or)(dst, val, pe) + unsigned long*: shmem_ulong_atomic_or, \ + unsigned long long*: shmem_ulonglong_atomic_or)(dst, val, pe) #endif /* Atomic Xor */ @@ -571,8 +571,8 @@ OSHMEM_DECLSPEC void shmem_ulonglong_atomic_xor(unsigned long long *target, unsi #define shmem_atomic_xor(dst, val, pe) \ _Generic(&*(dst), \ unsigned int*: shmem_uint_atomic_xor, \ - unsigned iong*: shmem_ulong_atomic_xor, \ - unsigned iong long*: shmem_ulonglong_atomic_xor)(dst, val, pe) + unsigned long*: shmem_ulong_atomic_xor, \ + unsigned long long*: shmem_ulonglong_atomic_xor)(dst, val, pe) #endif /* Atomic Inc */