OSHMEM: v1.3: add C11 generics
add missing put*/get* functions. Move *put|get16 functions from shmemx.h to shmem.h as required by 1.3 spec.
Этот коммит содержится в:
родитель
3a034352fe
Коммит
9a21392ec2
@ -34,6 +34,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||
#define OSHMEMP_HAVE_C11 1
|
||||
#endif
|
||||
|
||||
#include <pshmemx.h>
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
@ -92,10 +96,23 @@ OSHMEM_DECLSPEC void pshmem_float_p(float* addr, float value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_p(double* addr, double value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_p(long long* addr, long long value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_p(long double* addr, long double value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_p(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_p, \
|
||||
short*: pshmem_short_p, \
|
||||
int*: pshmem_int_p, \
|
||||
long*: pshmem_long_p, \
|
||||
long long*: pshmem_longlong_p, \
|
||||
float*: pshmem_float_p, \
|
||||
double*: pshmem_double_p, \
|
||||
long double*: shmem_longdouble_p)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Block data put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmem_char_put(char *target, const char *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_short_put(short *target, const short *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_int_put(int* target, const int* source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_put(long *target, const long *source, size_t len, int pe);
|
||||
@ -103,6 +120,21 @@ OSHMEM_DECLSPEC void pshmem_float_put(float *target, const float *source, size_
|
||||
OSHMEM_DECLSPEC void pshmem_double_put(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_put(long long *target, const long long *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_put(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_put(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_put, \
|
||||
short*: pshmem_short_put, \
|
||||
int*: pshmem_int_put, \
|
||||
long*: pshmem_long_put, \
|
||||
long long*: pshmem_longlong_put, \
|
||||
float*: pshmem_float_put, \
|
||||
double*: pshmem_double_put, \
|
||||
long double*: pshmem_longdouble_put)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_put8(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put16(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put32(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put64(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put128(void *target, const void *source, size_t len, int pe);
|
||||
@ -111,13 +143,29 @@ OSHMEM_DECLSPEC void pshmem_putmem(void *target, const void *source, size_t len
|
||||
/*
|
||||
* Strided put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmem_char_iput(char* target, const char* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_short_iput(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_iput(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_float_iput(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_iput(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_iput(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_iput(long double* target, const long double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_iput(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_iput(dst, src, tst, sst, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_iput, \
|
||||
short*: pshmem_short_iput, \
|
||||
int*: pshmem_int_iput, \
|
||||
long*: pshmem_long_iput, \
|
||||
long long*: pshmem_longlong_iput, \
|
||||
float*: pshmem_float_iput, \
|
||||
double*: pshmem_double_iput, \
|
||||
long double*: pshmem_longdouble_iput)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_iput8(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iput32(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iput64(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iput128(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
@ -134,6 +182,19 @@ OSHMEM_DECLSPEC void pshmem_longlong_put_nbi(long long *target, const long long
|
||||
OSHMEM_DECLSPEC void pshmem_float_put_nbi(float *target, const float *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_put_nbi(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_put_nbi(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_put_nbi(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_put_nbi, \
|
||||
short*: pshmem_short_put_nbi, \
|
||||
int*: pshmem_int_put_nbi, \
|
||||
long*: pshmem_long_put_nbi, \
|
||||
long long*: pshmem_longlong_put_nbi, \
|
||||
float*: pshmem_float_put_nbi, \
|
||||
double*: pshmem_double_put_nbi, \
|
||||
long double*: pshmem_longdouble_put_nbi)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_put8_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put16_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_put32_nbi(void *target, const void *source, size_t len, int pe);
|
||||
@ -151,10 +212,23 @@ OSHMEM_DECLSPEC float pshmem_float_g(const float* addr, int pe);
|
||||
OSHMEM_DECLSPEC double pshmem_double_g(const double* addr, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_g(const long long* addr, int pe);
|
||||
OSHMEM_DECLSPEC long double pshmem_longdouble_g(const long double* addr, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_g(addr, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_g, \
|
||||
short*: pshmem_short_g, \
|
||||
int*: pshmem_int_g, \
|
||||
long*: pshmem_long_g, \
|
||||
long long*: pshmem_longlong_g, \
|
||||
float*: pshmem_float_g, \
|
||||
double*: pshmem_double_g, \
|
||||
long double*: pshmem_longdouble_g)(addr, val, pe)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Block data get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmem_char_get(char *target, const char *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_short_get(short *target, const short *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_int_get(int *target, const int *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_get(long *target, const long *source, size_t len, int pe);
|
||||
@ -162,6 +236,21 @@ OSHMEM_DECLSPEC void pshmem_float_get(float *target, const float *source, size_
|
||||
OSHMEM_DECLSPEC void pshmem_double_get(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_get(long long *target, const long long *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_get(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_get(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_get, \
|
||||
short*: pshmem_short_get, \
|
||||
int*: pshmem_int_get, \
|
||||
long*: pshmem_long_get, \
|
||||
long long*: pshmem_longlong_get, \
|
||||
float*: pshmem_float_get, \
|
||||
double*: pshmem_double_get, \
|
||||
long double*: pshmem_longdouble_get)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_get8(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get16(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get32(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get64(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get128(void *target, const void *source, size_t len, int pe);
|
||||
@ -170,13 +259,29 @@ OSHMEM_DECLSPEC void pshmem_getmem(void *target, const void *source, size_t len
|
||||
/*
|
||||
* Strided get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmem_int_iget(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_char_iget(char* target, const char* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_short_iget(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_int_iget(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_float_iget(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_iget(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_iget(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_iget(long double* target, const long double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_iget(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_iget(dst, src, tst, sst, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_iget, \
|
||||
short*: pshmem_short_iget, \
|
||||
int*: pshmem_int_iget, \
|
||||
long*: pshmem_long_iget, \
|
||||
long long*: pshmem_longlong_iget, \
|
||||
float*: pshmem_float_iget, \
|
||||
double*: pshmem_double_iget, \
|
||||
long double*: pshmem_longdouble_iget)(dst, src, tst, sst, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_iget8(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iget32(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iget64(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_iget128(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
@ -193,6 +298,19 @@ OSHMEM_DECLSPEC void pshmem_longlong_get_nbi(long long *target, const long long
|
||||
OSHMEM_DECLSPEC void pshmem_float_get_nbi(float *target, const float *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_get_nbi(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longdouble_get_nbi(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_get_nbi(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: pshmem_char_get_nbi, \
|
||||
short*: pshmem_short_get_nbi, \
|
||||
int*: pshmem_int_get_nbi, \
|
||||
long*: pshmem_long_get_nbi, \
|
||||
long long*: pshmem_longlong_get_nbi, \
|
||||
float*: pshmem_float_get_nbi, \
|
||||
double*: pshmem_double_get_nbi, \
|
||||
long double*: pshmem_longdouble_get_nbi)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void pshmem_get8_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get16_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_get32_nbi(void *target, const void *source, size_t len, int pe);
|
||||
@ -203,12 +321,20 @@ OSHMEM_DECLSPEC void pshmem_get128_nbi(void *target, const void *source, size_t
|
||||
* Atomic operations
|
||||
*/
|
||||
/* Atomic swap */
|
||||
OSHMEM_DECLSPEC long pshmem_swap(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC double pshmem_double_swap(double *target, double value, int pe);
|
||||
OSHMEM_DECLSPEC float pshmem_float_swap(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC int pshmem_int_swap(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC long pshmem_long_swap(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_swap(long long*target, long long value, int pe);
|
||||
OSHMEM_DECLSPEC float pshmem_float_swap(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC double pshmem_double_swap(double *target, double value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_swap(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_swap, \
|
||||
long*: pshmem_long_swap, \
|
||||
long long*: pshmem_longlong_swap, \
|
||||
float*: pshmem_float_swap, \
|
||||
double*: pshmem_double_swap)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic set */
|
||||
OSHMEM_DECLSPEC void pshmem_int_set(int *target, int value, int pe);
|
||||
@ -216,16 +342,39 @@ OSHMEM_DECLSPEC void pshmem_long_set(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_set(long long*target, long long value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_float_set(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_double_set(double *target, double value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_set(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_set, \
|
||||
long*: pshmem_long_set, \
|
||||
long long*: pshmem_longlong_set, \
|
||||
float*: pshmem_float_set, \
|
||||
double*: pshmem_double_set)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic conditional swap */
|
||||
OSHMEM_DECLSPEC int pshmem_int_cswap(int *target, int cond, int value, int pe);
|
||||
OSHMEM_DECLSPEC long pshmem_long_cswap(long *target, long cond, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_cswap(long long *target, long long cond, long long value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_cswap(dst, cond, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_cswap, \
|
||||
long*: pshmem_long_cswap, \
|
||||
long long*: pshmem_longlong_cswap)(dst, cond, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch&Add */
|
||||
OSHMEM_DECLSPEC int pshmem_int_fadd(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC long pshmem_long_fadd(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_fadd(long long *target, long long value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_fadd(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_fadd, \
|
||||
long*: pshmem_long_fadd, \
|
||||
long long*: pshmem_longlong_fadd)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch */
|
||||
OSHMEM_DECLSPEC int pshmem_int_fetch(const int *target, int pe);
|
||||
@ -233,23 +382,51 @@ OSHMEM_DECLSPEC long pshmem_long_fetch(const long *target, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_fetch(const long long *target, int pe);
|
||||
OSHMEM_DECLSPEC float pshmem_float_fetch(const float *target, int pe);
|
||||
OSHMEM_DECLSPEC double pshmem_double_fetch(const double *target, int pe);
|
||||
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define pshmem_fetch(dst, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_fetch, \
|
||||
long*: pshmem_long_fetch, \
|
||||
long long*: pshmem_longlong_fetch, \
|
||||
float*: pshmem_float_fetch, \
|
||||
double*: pshmem_double_fetch)(dst, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch&Inc */
|
||||
OSHMEM_DECLSPEC int pshmem_int_finc(int *target, int pe);
|
||||
OSHMEM_DECLSPEC long pshmem_long_finc(long *target, int pe);
|
||||
OSHMEM_DECLSPEC long long pshmem_longlong_finc(long long *target, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_finc(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_finc, \
|
||||
long*: pshmem_long_finc, \
|
||||
long long*: pshmem_longlong_finc)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Add*/
|
||||
OSHMEM_DECLSPEC void pshmem_int_add(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_add(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_add(long long *target, long long value, int pe);
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_add(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_add, \
|
||||
long*: pshmem_long_add, \
|
||||
long long*: pshmem_longlong_add)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Inc */
|
||||
OSHMEM_DECLSPEC void pshmem_int_inc(int *target, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_long_inc(long *target, int pe);
|
||||
OSHMEM_DECLSPEC void pshmem_longlong_inc(long long *target, int pe);
|
||||
|
||||
#if OSHMEMP_HAVE_C11
|
||||
#define pshmem_inc(dst, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: pshmem_int_inc, \
|
||||
long*: pshmem_long_inc, \
|
||||
long long*: pshmem_longlong_inc)(dst, pe)
|
||||
#endif
|
||||
/*
|
||||
* Lock functions
|
||||
*/
|
||||
|
@ -50,12 +50,10 @@ OSHMEM_DECLSPEC void pshmemx_int64_p(int64_t* addr, int64_t value, int pe);
|
||||
/*
|
||||
* Block data put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmemx_put16(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Strided put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmemx_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Elemental get routines
|
||||
@ -67,12 +65,10 @@ OSHMEM_DECLSPEC int64_t pshmemx_int64_g(const int64_t* addr, int pe);
|
||||
/*
|
||||
* Block data get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmemx_get16(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Strided get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void pshmemx_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Atomic operations
|
||||
@ -156,16 +152,10 @@ OSHMEM_DECLSPEC void pshmemx_int64_prod_to_all(int64_t *target, const int64_t *s
|
||||
#define pshmem_int32_p pshmemx_int32_p
|
||||
#define pshmem_int64_p pshmemx_int64_p
|
||||
|
||||
#define pshmem_put16 pshmemx_put16
|
||||
#define pshmem_iput16 pshmemx_iput16
|
||||
|
||||
#define pshmem_int16_g pshmemx_int16_g
|
||||
#define pshmem_int32_g pshmemx_int32_g
|
||||
#define pshmem_int64_g pshmemx_int64_g
|
||||
|
||||
#define pshmem_get16 pshmemx_get16
|
||||
#define pshmem_iget16 pshmemx_iget16
|
||||
|
||||
#define pshmem_int32_swap pshmemx_int32_swap
|
||||
#define pshmem_int64_swap pshmemx_int64_swap
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
# define OSHMEM_COMPLEX_TYPE(type) type complex
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* SHMEM version
|
||||
*/
|
||||
@ -42,6 +41,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||
#define OSHMEM_HAVE_C11 1
|
||||
#endif
|
||||
|
||||
#include <shmem-compat.h>
|
||||
#include <shmemx.h>
|
||||
|
||||
@ -157,10 +160,23 @@ OSHMEM_DECLSPEC void shmem_float_p(float* addr, float value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_double_p(double* addr, double value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_p(long long* addr, long long value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_p(long double* addr, long double value, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_p(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_p, \
|
||||
short*: shmem_short_p, \
|
||||
int*: shmem_int_p, \
|
||||
long*: shmem_long_p, \
|
||||
long long*: shmem_longlong_p, \
|
||||
float*: shmem_float_p, \
|
||||
double*: shmem_double_p, \
|
||||
long double*: shmem_longdouble_p)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Block data put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmem_char_put(char *target, const char *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_short_put(short *target, const short *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_int_put(int* target, const int* source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_put(long *target, const long *source, size_t len, int pe);
|
||||
@ -168,21 +184,53 @@ OSHMEM_DECLSPEC void shmem_float_put(float *target, const float *source, size_t
|
||||
OSHMEM_DECLSPEC void shmem_double_put(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_put(long long *target, const long long *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_put(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_put(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_put, \
|
||||
short*: shmem_short_put, \
|
||||
int*: shmem_int_put, \
|
||||
long*: shmem_long_put, \
|
||||
long long*: shmem_longlong_put, \
|
||||
float*: shmem_float_put, \
|
||||
double*: shmem_double_put, \
|
||||
long double*: shmem_longdouble_put)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_put8(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put16(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put32(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put64(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put128(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_putmem(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
|
||||
/*
|
||||
* Strided put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmem_char_iput(char* target, const char* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_short_iput(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_int_iput(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_iput(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_float_iput(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_double_iput(double* target, const double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_iput(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_iput(long double* target, const long double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_iput(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_iput(dst, src, tst, sst, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_iput, \
|
||||
short*: shmem_short_iput, \
|
||||
int*: shmem_int_iput, \
|
||||
long*: shmem_long_iput, \
|
||||
long long*: shmem_longlong_iput, \
|
||||
float*: shmem_float_iput, \
|
||||
double*: shmem_double_iput, \
|
||||
long double*: shmem_longdouble_iput)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_iput8(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iput32(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iput64(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iput128(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
@ -190,7 +238,6 @@ OSHMEM_DECLSPEC void shmem_iput128(void* target, const void* source, ptrdiff_t t
|
||||
/*
|
||||
* Nonblocking put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmem_putmem_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_char_put_nbi(char *target, const char *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_short_put_nbi(short *target, const short *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_int_put_nbi(int* target, const int* source, size_t len, int pe);
|
||||
@ -199,11 +246,25 @@ OSHMEM_DECLSPEC void shmem_longlong_put_nbi(long long *target, const long long
|
||||
OSHMEM_DECLSPEC void shmem_float_put_nbi(float *target, const float *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_double_put_nbi(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_put_nbi(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_put_nbi(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_put_nbi, \
|
||||
short*: shmem_short_put_nbi, \
|
||||
int*: shmem_int_put_nbi, \
|
||||
long*: shmem_long_put_nbi, \
|
||||
long long*: shmem_longlong_put_nbi, \
|
||||
float*: shmem_float_put_nbi, \
|
||||
double*: shmem_double_put_nbi, \
|
||||
long double*: shmem_longdouble_put_nbi)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_put8_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put16_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put32_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put64_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_put128_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_putmem_nbi(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Elemental get routines
|
||||
@ -216,10 +277,23 @@ OSHMEM_DECLSPEC float shmem_float_g(const float* addr, int pe);
|
||||
OSHMEM_DECLSPEC double shmem_double_g(const double* addr, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_g(const long long* addr, int pe);
|
||||
OSHMEM_DECLSPEC long double shmem_longdouble_g(const long double* addr, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_g(addr, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_g, \
|
||||
short*: shmem_short_g, \
|
||||
int*: shmem_int_g, \
|
||||
long*: shmem_long_g, \
|
||||
long long*: shmem_longlong_g, \
|
||||
float*: shmem_float_g, \
|
||||
double*: shmem_double_g, \
|
||||
long double*: shmem_longdouble_g)(addr, val, pe)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Block data get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmem_char_get(char *target, const char *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_short_get(short *target, const short *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_int_get(int *target, const int *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_get(long *target, const long *source, size_t len, int pe);
|
||||
@ -227,6 +301,21 @@ OSHMEM_DECLSPEC void shmem_float_get(float *target, const float *source, size_t
|
||||
OSHMEM_DECLSPEC void shmem_double_get(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_get(long long *target, const long long *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_get(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_get(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_get, \
|
||||
short*: shmem_short_get, \
|
||||
int*: shmem_int_get, \
|
||||
long*: shmem_long_get, \
|
||||
long long*: shmem_longlong_get, \
|
||||
float*: shmem_float_get, \
|
||||
double*: shmem_double_get, \
|
||||
long double*: shmem_longdouble_get)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_get8(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get16(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get32(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get64(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get128(void *target, const void *source, size_t len, int pe);
|
||||
@ -235,6 +324,7 @@ OSHMEM_DECLSPEC void shmem_getmem(void *target, const void *source, size_t len,
|
||||
/*
|
||||
* Strided get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmem_char_iget(char* target, const char* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_short_iget(short* target, const short* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_int_iget(int* target, const int* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_float_iget(float* target, const float* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
@ -242,6 +332,21 @@ OSHMEM_DECLSPEC void shmem_double_iget(double* target, const double* source, ptr
|
||||
OSHMEM_DECLSPEC void shmem_longlong_iget(long long* target, const long long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_iget(long double* target, const long double* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_iget(long* target, const long* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_iget(dst, src, tst, sst, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_iget, \
|
||||
short*: shmem_short_iget, \
|
||||
int*: shmem_int_iget, \
|
||||
long*: shmem_long_iget, \
|
||||
long long*: shmem_longlong_iget, \
|
||||
float*: shmem_float_iget, \
|
||||
double*: shmem_double_iget, \
|
||||
long double*: shmem_longdouble_iget)(dst, src, tst, sst, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_iget8(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iget32(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iget64(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_iget128(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
@ -258,6 +363,19 @@ OSHMEM_DECLSPEC void shmem_longlong_get_nbi(long long *target, const long long
|
||||
OSHMEM_DECLSPEC void shmem_float_get_nbi(float *target, const float *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_double_get_nbi(double *target, const double *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longdouble_get_nbi(long double *target, const long double *source, size_t len, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_get_nbi(dst, src, len, pe) \
|
||||
_Generic(&*(dst), \
|
||||
char*: shmem_char_get_nbi, \
|
||||
short*: shmem_short_get_nbi, \
|
||||
int*: shmem_int_get_nbi, \
|
||||
long*: shmem_long_get_nbi, \
|
||||
long long*: shmem_longlong_get_nbi, \
|
||||
float*: shmem_float_get_nbi, \
|
||||
double*: shmem_double_get_nbi, \
|
||||
long double*: shmem_longdouble_get_nbi)(dst, src, len, pe)
|
||||
#endif
|
||||
|
||||
OSHMEM_DECLSPEC void shmem_get8_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get16_nbi(void *target, const void *source, size_t len, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_get32_nbi(void *target, const void *source, size_t len, int pe);
|
||||
@ -268,12 +386,20 @@ OSHMEM_DECLSPEC void shmem_get128_nbi(void *target, const void *source, size_t
|
||||
* Atomic operations
|
||||
*/
|
||||
/* Atomic swap */
|
||||
OSHMEM_DECLSPEC long shmem_swap(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC double shmem_double_swap(double *target, double value, int pe);
|
||||
OSHMEM_DECLSPEC float shmem_float_swap(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC int shmem_int_swap(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC long shmem_long_swap(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_swap(long long*target, long long value, int pe);
|
||||
OSHMEM_DECLSPEC float shmem_float_swap(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC double shmem_double_swap(double *target, double value, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_swap(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_swap, \
|
||||
long*: shmem_long_swap, \
|
||||
long long*: shmem_longlong_swap, \
|
||||
float*: shmem_float_swap, \
|
||||
double*: shmem_double_swap)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic set */
|
||||
OSHMEM_DECLSPEC void shmem_int_set(int *target, int value, int pe);
|
||||
@ -281,16 +407,40 @@ OSHMEM_DECLSPEC void shmem_long_set(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_set(long long*target, long long value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_float_set(float *target, float value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_double_set(double *target, double value, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_set(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_set, \
|
||||
long*: shmem_long_set, \
|
||||
long long*: shmem_longlong_set, \
|
||||
float*: shmem_float_set, \
|
||||
double*: shmem_double_set)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic conditional swap */
|
||||
OSHMEM_DECLSPEC int shmem_int_cswap(int *target, int cond, int value, int pe);
|
||||
OSHMEM_DECLSPEC long shmem_long_cswap(long *target, long cond, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_cswap(long long *target, long long cond, long long value, int pe);
|
||||
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_cswap(dst, cond, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_cswap, \
|
||||
long*: shmem_long_cswap, \
|
||||
long long*: shmem_longlong_cswap)(dst, cond, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch&Add */
|
||||
OSHMEM_DECLSPEC int shmem_int_fadd(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC long shmem_long_fadd(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_fadd(long long *target, long long value, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_fadd(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_fadd, \
|
||||
long*: shmem_long_fadd, \
|
||||
long long*: shmem_longlong_fadd)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch */
|
||||
OSHMEM_DECLSPEC int shmem_int_fetch(const int *target, int pe);
|
||||
@ -298,21 +448,52 @@ OSHMEM_DECLSPEC long shmem_long_fetch(const long *target, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_fetch(const long long *target, int pe);
|
||||
OSHMEM_DECLSPEC float shmem_float_fetch(const float *target, int pe);
|
||||
OSHMEM_DECLSPEC double shmem_double_fetch(const double *target, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_fetch(dst, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_fetch, \
|
||||
long*: shmem_long_fetch, \
|
||||
long long*: shmem_longlong_fetch, \
|
||||
float*: shmem_float_fetch, \
|
||||
double*: shmem_double_fetch)(dst, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Fetch&Inc */
|
||||
OSHMEM_DECLSPEC int shmem_int_finc(int *target, int pe);
|
||||
OSHMEM_DECLSPEC long shmem_long_finc(long *target, int pe);
|
||||
OSHMEM_DECLSPEC long long shmem_longlong_finc(long long *target, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_finc(dst, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_finc, \
|
||||
long*: shmem_long_finc, \
|
||||
long long*: shmem_longlong_finc)(dst, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Add*/
|
||||
OSHMEM_DECLSPEC void shmem_int_add(int *target, int value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_add(long *target, long value, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_add(long long *target, long long value, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_add(dst, val, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_add, \
|
||||
long*: shmem_long_add, \
|
||||
long long*: shmem_longlong_add)(dst, val, pe)
|
||||
#endif
|
||||
|
||||
/* Atomic Inc */
|
||||
OSHMEM_DECLSPEC void shmem_int_inc(int *target, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_long_inc(long *target, int pe);
|
||||
OSHMEM_DECLSPEC void shmem_longlong_inc(long long *target, int pe);
|
||||
#if OSHMEM_HAVE_C11
|
||||
#define shmem_inc(dst, pe) \
|
||||
_Generic(&*(dst), \
|
||||
int*: shmem_int_inc, \
|
||||
long*: shmem_long_inc, \
|
||||
long long*: shmem_longlong_inc)(dst, pe)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Lock functions
|
||||
|
@ -35,12 +35,10 @@ OSHMEM_DECLSPEC void shmemx_int64_p(int64_t* addr, int64_t value, int pe);
|
||||
/*
|
||||
* Block data put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmemx_put16(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Strided put routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmemx_iput16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Elemental get routines
|
||||
@ -52,12 +50,10 @@ OSHMEM_DECLSPEC int64_t shmemx_int64_g(const int64_t* addr, int pe);
|
||||
/*
|
||||
* Block data get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmemx_get16(void *target, const void *source, size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Strided get routines
|
||||
*/
|
||||
OSHMEM_DECLSPEC void shmemx_iget16(void* target, const void* source, ptrdiff_t tst, ptrdiff_t sst,size_t len, int pe);
|
||||
|
||||
/*
|
||||
* Atomic operations
|
||||
@ -141,16 +137,10 @@ OSHMEM_DECLSPEC void shmemx_int64_prod_to_all(int64_t *target, const int64_t *so
|
||||
#define shmem_int32_p shmemx_int32_p
|
||||
#define shmem_int64_p shmemx_int64_p
|
||||
|
||||
#define shmem_put16 shmemx_put16
|
||||
#define shmem_iput16 shmemx_iput16
|
||||
|
||||
#define shmem_int16_g shmemx_int16_g
|
||||
#define shmem_int32_g shmemx_int32_g
|
||||
#define shmem_int64_g shmemx_int64_g
|
||||
|
||||
#define shmem_get16 shmemx_get16
|
||||
#define shmem_iget16 shmemx_iget16
|
||||
|
||||
#define shmem_int32_swap shmemx_int32_swap
|
||||
#define shmem_int64_swap shmemx_int64_swap
|
||||
|
||||
|
@ -86,7 +86,9 @@
|
||||
#define shmem_double_put pshmem_double_put
|
||||
#define shmem_longlong_put pshmem_longlong_put
|
||||
#define shmem_longdouble_put pshmem_longdouble_put
|
||||
#define shmemx_put16 pshmemx_put16
|
||||
|
||||
#define shmem_put8 pshmem_put8
|
||||
#define shmem_put16 pshmem_put16
|
||||
#define shmem_put32 pshmem_put32
|
||||
#define shmem_put64 pshmem_put64
|
||||
#define shmem_put128 pshmem_put128
|
||||
@ -95,14 +97,17 @@
|
||||
/*
|
||||
* Strided put routines
|
||||
*/
|
||||
#define shmem_int_iput pshmem_int_iput
|
||||
#define shmem_char_iput pshmem_char_iput
|
||||
#define shmem_short_iput pshmem_short_iput
|
||||
#define shmem_int_iput pshmem_int_iput
|
||||
#define shmem_float_iput pshmem_float_iput
|
||||
#define shmem_double_iput pshmem_double_iput
|
||||
#define shmem_longlong_iput pshmem_longlong_iput
|
||||
#define shmem_longdouble_iput pshmem_longdouble_iput
|
||||
#define shmem_long_iput pshmem_long_iput
|
||||
#define shmemx_iput16 pshmemx_iput16
|
||||
|
||||
#define shmem_iput8 pshmem_iput8
|
||||
#define shmem_iput16 pshmem_iput16
|
||||
#define shmem_iput32 pshmem_iput32
|
||||
#define shmem_iput64 pshmem_iput64
|
||||
#define shmem_iput128 pshmem_iput128
|
||||
@ -151,7 +156,9 @@
|
||||
#define shmem_double_get pshmem_double_get
|
||||
#define shmem_longlong_get pshmem_longlong_get
|
||||
#define shmem_longdouble_get pshmem_longdouble_get
|
||||
#define shmemx_get16 pshmemx_get16
|
||||
|
||||
#define shmem_get8 pshmem_get8
|
||||
#define shmem_get16 pshmem_get16
|
||||
#define shmem_get32 pshmem_get32
|
||||
#define shmem_get64 pshmem_get64
|
||||
#define shmem_get128 pshmem_get128
|
||||
@ -160,14 +167,17 @@
|
||||
/*
|
||||
* Strided get routines
|
||||
*/
|
||||
#define shmem_int_iget pshmem_int_iget
|
||||
#define shmem_char_iget pshmem_char_iget
|
||||
#define shmem_short_iget pshmem_short_iget
|
||||
#define shmem_int_iget pshmem_int_iget
|
||||
#define shmem_float_iget pshmem_float_iget
|
||||
#define shmem_double_iget pshmem_double_iget
|
||||
#define shmem_longlong_iget pshmem_longlong_iget
|
||||
#define shmem_longdouble_iget pshmem_longdouble_iget
|
||||
#define shmem_long_iget pshmem_long_iget
|
||||
#define shmemx_iget16 pshmemx_iget16
|
||||
|
||||
#define shmem_iget8 pshmem_iget8
|
||||
#define shmem_iget16 pshmem_iget16
|
||||
#define shmem_iget32 pshmem_iget32
|
||||
#define shmem_iget64 pshmem_iget64
|
||||
#define shmem_iget128 pshmem_iget128
|
||||
@ -194,7 +204,6 @@
|
||||
* Atomic operations
|
||||
*/
|
||||
/* Atomic swap */
|
||||
#define shmem_swap pshmem_swap
|
||||
#define shmem_double_swap pshmem_double_swap
|
||||
#define shmem_float_swap pshmem_float_swap
|
||||
#define shmem_int_swap pshmem_int_swap
|
||||
|
@ -54,7 +54,8 @@
|
||||
#pragma weak shmem_double_get = pshmem_double_get
|
||||
#pragma weak shmem_longdouble_get = pshmem_longdouble_get
|
||||
#pragma weak shmem_getmem = pshmem_getmem
|
||||
#pragma weak shmemx_get16 = pshmemx_get16
|
||||
#pragma weak shmem_get8 = pshmem_get8
|
||||
#pragma weak shmem_get16 = pshmem_get16
|
||||
#pragma weak shmem_get32 = pshmem_get32
|
||||
#pragma weak shmem_get64 = pshmem_get64
|
||||
#pragma weak shmem_get128 = pshmem_get128
|
||||
@ -92,9 +93,9 @@ SHMEM_TYPE_GET(_longdouble, long double)
|
||||
}
|
||||
|
||||
SHMEM_TYPE_GETMEM(_getmem, 1, shmem)
|
||||
SHMEM_TYPE_GETMEM(_get16, 2, shmemx)
|
||||
SHMEM_TYPE_GETMEM(_get8, 1, shmem)
|
||||
SHMEM_TYPE_GETMEM(_get16, 2, shmem)
|
||||
SHMEM_TYPE_GETMEM(_get32, 4, shmem)
|
||||
SHMEM_TYPE_GETMEM(_get64, 8, shmem)
|
||||
SHMEM_TYPE_GETMEM(_get128, 16, shmem)
|
||||
|
||||
SHMEM_TYPE_GETMEM(_get, sizeof(long), shmem)
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
#if OSHMEM_PROFILING
|
||||
#include "oshmem/include/pshmem.h"
|
||||
#pragma weak shmem_char_iget = pshmem_char_iget
|
||||
#pragma weak shmem_short_iget = pshmem_short_iget
|
||||
#pragma weak shmem_int_iget = pshmem_int_iget
|
||||
#pragma weak shmem_long_iget = pshmem_long_iget
|
||||
@ -57,13 +58,15 @@
|
||||
#pragma weak shmem_float_iget = pshmem_float_iget
|
||||
#pragma weak shmem_double_iget = pshmem_double_iget
|
||||
#pragma weak shmem_longdouble_iget = pshmem_longdouble_iget
|
||||
#pragma weak shmemx_iget16 = pshmemx_iget16
|
||||
#pragma weak shmem_iget8 = pshmem_iget8
|
||||
#pragma weak shmem_iget16 = pshmem_iget16
|
||||
#pragma weak shmem_iget32 = pshmem_iget32
|
||||
#pragma weak shmem_iget64 = pshmem_iget64
|
||||
#pragma weak shmem_iget128 = pshmem_iget128
|
||||
#include "oshmem/shmem/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
SHMEM_TYPE_IGET(_char, char)
|
||||
SHMEM_TYPE_IGET(_short, short)
|
||||
SHMEM_TYPE_IGET(_int, int)
|
||||
SHMEM_TYPE_IGET(_long, long)
|
||||
@ -95,7 +98,9 @@ SHMEM_TYPE_IGET(_longdouble, long double)
|
||||
return ; \
|
||||
}
|
||||
|
||||
SHMEM_TYPE_IGETMEM(_iget16, 2, shmemx)
|
||||
SHMEM_TYPE_IGETMEM(_iget8, 1, shmem)
|
||||
SHMEM_TYPE_IGETMEM(_iget16, 2, shmem)
|
||||
SHMEM_TYPE_IGETMEM(_iget32, 4, shmem)
|
||||
SHMEM_TYPE_IGETMEM(_iget64, 8, shmem)
|
||||
SHMEM_TYPE_IGETMEM(_iget128, 16, shmem)
|
||||
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
#if OSHMEM_PROFILING
|
||||
#include "oshmem/include/pshmem.h"
|
||||
#pragma weak shmem_char_iput = pshmem_char_iput
|
||||
#pragma weak shmem_short_iput = pshmem_short_iput
|
||||
#pragma weak shmem_int_iput = pshmem_int_iput
|
||||
#pragma weak shmem_long_iput = pshmem_long_iput
|
||||
@ -57,13 +58,15 @@
|
||||
#pragma weak shmem_float_iput = pshmem_float_iput
|
||||
#pragma weak shmem_double_iput = pshmem_double_iput
|
||||
#pragma weak shmem_longdouble_iput = pshmem_longdouble_iput
|
||||
#pragma weak shmemx_iput16 = pshmemx_iput16
|
||||
#pragma weak shmemx_iput8 = pshmem_iput8
|
||||
#pragma weak shmemx_iput16 = pshmem_iput16
|
||||
#pragma weak shmem_iput32 = pshmem_iput32
|
||||
#pragma weak shmem_iput64 = pshmem_iput64
|
||||
#pragma weak shmem_iput128 = pshmem_iput128
|
||||
#include "oshmem/shmem/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
SHMEM_TYPE_IPUT(_char, char)
|
||||
SHMEM_TYPE_IPUT(_short, short)
|
||||
SHMEM_TYPE_IPUT(_int, int)
|
||||
SHMEM_TYPE_IPUT(_long, long)
|
||||
@ -95,7 +98,8 @@ SHMEM_TYPE_IPUT(_longdouble, long double)
|
||||
return ; \
|
||||
}
|
||||
|
||||
SHMEM_TYPE_IPUTMEM(_iput16, 2, shmemx)
|
||||
SHMEM_TYPE_IPUTMEM(_iput8, 1, shmem)
|
||||
SHMEM_TYPE_IPUTMEM(_iput16, 2, shmem)
|
||||
SHMEM_TYPE_IPUTMEM(_iput32, 4, shmem)
|
||||
SHMEM_TYPE_IPUTMEM(_iput64, 8, shmem)
|
||||
SHMEM_TYPE_IPUTMEM(_iput128, 16, shmem)
|
||||
|
@ -251,11 +251,11 @@ static int extract_second_word(void *lock, int lock_size, int *two)
|
||||
return extract_2_words(lock, lock_size, &one, two);
|
||||
}
|
||||
|
||||
static uint64_t shmem_cswap(void *target,
|
||||
int target_size,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
int pe)
|
||||
static uint64_t shmem_lock_cswap(void *target,
|
||||
int target_size,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
int pe)
|
||||
{
|
||||
uint64_t prev_value = 0;
|
||||
|
||||
@ -274,10 +274,10 @@ static uint64_t shmem_cswap(void *target,
|
||||
return prev_value;
|
||||
}
|
||||
|
||||
static uint64_t shmem_fadd(void *target,
|
||||
int target_size,
|
||||
uint64_t value,
|
||||
int pe)
|
||||
static uint64_t shmem_lock_fadd(void *target,
|
||||
int target_size,
|
||||
uint64_t value,
|
||||
int pe)
|
||||
{
|
||||
uint64_t prev_value = 0;
|
||||
|
||||
@ -316,11 +316,11 @@ static int pack_first_word(void *lock,
|
||||
extract_second_word(&lock_value, lock_size, &two);
|
||||
pack_2_words(&new_long_value, lock_size, one, &two);
|
||||
while (lock_value
|
||||
!= (temp = shmem_cswap(lock,
|
||||
lock_size,
|
||||
lock_value,
|
||||
new_long_value,
|
||||
my_pe))) {
|
||||
!= (temp = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
lock_value,
|
||||
new_long_value,
|
||||
my_pe))) {
|
||||
lock_value = temp;
|
||||
extract_second_word(&lock_value, lock_size, &two);
|
||||
pack_2_words(&new_long_value, lock_size, one, &two);
|
||||
@ -367,11 +367,11 @@ static int pack_second_word(void *lock,
|
||||
extract_first_word(&lock_value, lock_size, &one);
|
||||
pack_2_words(&new_long_value, lock_size, &one, two);
|
||||
while (lock_value
|
||||
!= (temp = shmem_cswap(lock,
|
||||
lock_size,
|
||||
lock_value,
|
||||
new_long_value,
|
||||
my_pe))) {
|
||||
!= (temp = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
lock_value,
|
||||
new_long_value,
|
||||
my_pe))) {
|
||||
lock_value = temp;
|
||||
extract_first_word(&lock_value, lock_size, &one);
|
||||
pack_2_words(&new_long_value, lock_size, &one, two);
|
||||
@ -691,11 +691,11 @@ static int shmem_lock_wait_for_ticket(void *lock,
|
||||
new_server_lock = server_lock = temp;
|
||||
lock_pack_pe_last(&new_server_lock, lock_size, &my_pe, 0);
|
||||
} while (server_lock
|
||||
!= (temp = shmem_cswap(lock,
|
||||
lock_size,
|
||||
server_lock,
|
||||
new_server_lock,
|
||||
server_pe)));
|
||||
!= (temp = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
server_lock,
|
||||
new_server_lock,
|
||||
server_pe)));
|
||||
lock_extract_pe_last(&server_lock, lock_size, pe_last);
|
||||
if (*pe_last == -1) {
|
||||
/* we are first in queue for the lock */
|
||||
@ -724,7 +724,7 @@ static int shmem_lock_subscribe_for_informing(void *lock,
|
||||
int remote_prev_pe_next = 0;
|
||||
uint64_t prev_remote_value = 1;
|
||||
|
||||
prev_remote_value = shmem_fadd(lock, lock_size, my_pe + 1, pe_last);
|
||||
prev_remote_value = shmem_lock_fadd(lock, lock_size, my_pe + 1, pe_last);
|
||||
if (my_pe == server_pe) {
|
||||
lock_save_prev_pe(lock, pe_last);
|
||||
}
|
||||
@ -751,11 +751,11 @@ static int shmem_lock_subscribe_for_informing(void *lock,
|
||||
prev_remote_value += my_pe + 1;
|
||||
|
||||
while (prev_remote_value
|
||||
!= (temp_value = shmem_cswap(lock,
|
||||
lock_size,
|
||||
prev_remote_value,
|
||||
new_remote_value,
|
||||
pe_last))) {
|
||||
!= (temp_value = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
prev_remote_value,
|
||||
new_remote_value,
|
||||
pe_last))) {
|
||||
prev_remote_value = temp_value;
|
||||
lock_extract_counter(&prev_remote_value,
|
||||
lock_size,
|
||||
@ -849,11 +849,11 @@ static int shmem_lock_inform_next(void *lock, int lock_size, int pe_next)
|
||||
| (((uint64_t) 1) << (lock_bitwise_size - 1));
|
||||
|
||||
while (remote_value
|
||||
!= (temp_value = shmem_cswap(lock,
|
||||
lock_size,
|
||||
remote_value,
|
||||
new_remote_value,
|
||||
pe_next))) {
|
||||
!= (temp_value = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
remote_value,
|
||||
new_remote_value,
|
||||
pe_next))) {
|
||||
remote_value = temp_value;
|
||||
new_remote_value = remote_value
|
||||
| (((uint64_t) 1) << (lock_bitwise_size - 1));
|
||||
@ -938,7 +938,7 @@ static int shmem_lock_try_inform_server(void *lock, int lock_size)
|
||||
&incorrect_pe,
|
||||
&my_pe);
|
||||
return !(remote_value
|
||||
== shmem_cswap(lock, lock_size, remote_value, zero, server_pe));
|
||||
== shmem_lock_cswap(lock, lock_size, remote_value, zero, server_pe));
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
@ -987,11 +987,11 @@ int _shmem_test_lock(void *lock, int lock_size)
|
||||
goto FreeMemory;
|
||||
}
|
||||
|
||||
prev_lock_value = shmem_cswap(lock,
|
||||
lock_size,
|
||||
0,
|
||||
new_lock_value,
|
||||
server_pe);
|
||||
prev_lock_value = shmem_lock_cswap(lock,
|
||||
lock_size,
|
||||
0,
|
||||
new_lock_value,
|
||||
server_pe);
|
||||
}
|
||||
|
||||
if (0 == prev_lock_value || my_lock) {
|
||||
|
@ -57,7 +57,8 @@
|
||||
#pragma weak shmem_double_put = pshmem_double_put
|
||||
#pragma weak shmem_longdouble_put = pshmem_longdouble_put
|
||||
#pragma weak shmem_putmem = pshmem_putmem
|
||||
#pragma weak shmemx_put16 = pshmemx_put16
|
||||
#pragma weak shmem_put8 = pshmem_put8
|
||||
#pragma weak shmem_put16 = pshmem_put16
|
||||
#pragma weak shmem_put32 = pshmem_put32
|
||||
#pragma weak shmem_put64 = pshmem_put64
|
||||
#pragma weak shmem_put128 = pshmem_put128
|
||||
@ -95,9 +96,9 @@ SHMEM_TYPE_PUT(_longdouble, long double)
|
||||
}
|
||||
|
||||
SHMEM_TYPE_PUTMEM(_putmem, 1, shmem)
|
||||
SHMEM_TYPE_PUTMEM(_put16, 2, shmemx)
|
||||
SHMEM_TYPE_PUTMEM(_put8, 1, shmem)
|
||||
SHMEM_TYPE_PUTMEM(_put16, 2, shmem)
|
||||
SHMEM_TYPE_PUTMEM(_put32, 4, shmem)
|
||||
SHMEM_TYPE_PUTMEM(_put64, 8, shmem)
|
||||
SHMEM_TYPE_PUTMEM(_put128, 16, shmem)
|
||||
|
||||
SHMEM_TYPE_PUTMEM(_put, sizeof(long), shmem)
|
||||
|
@ -48,7 +48,6 @@
|
||||
|
||||
#if OSHMEM_PROFILING
|
||||
#include "oshmem/include/pshmem.h"
|
||||
#pragma weak shmem_swap = pshmem_swap
|
||||
#pragma weak shmem_int_swap = pshmem_int_swap
|
||||
#pragma weak shmem_long_swap = pshmem_long_swap
|
||||
#pragma weak shmem_longlong_swap = pshmem_longlong_swap
|
||||
@ -59,7 +58,6 @@
|
||||
#include "oshmem/shmem/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
SHMEM_TYPE_SWAP(, long, shmem)
|
||||
SHMEM_TYPE_SWAP(_int, int, shmem)
|
||||
SHMEM_TYPE_SWAP(_long, long, shmem)
|
||||
SHMEM_TYPE_SWAP(_longlong, long long, shmem)
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user