root/oshmem/include/shmemx.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* oshmem/include/shmemx.h. This file contains vendor extension functions  */
   2 /*
   3  * Copyright (c) 2014-2015 Mellanox Technologies, Inc.
   4  *                         All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #ifndef OSHMEM_SHMEMX_H
  13 #define OSHMEM_SHMEMX_H
  14 
  15 #include <shmem.h>
  16 
  17 #if defined(c_plusplus) || defined(__cplusplus)
  18 extern "C" {
  19 #endif
  20 
  21 enum {
  22     SHMEM_HINT_NONE           = 0,
  23     SHMEM_HINT_LOW_LAT_MEM    = 1 << 0,
  24     SHMEM_HINT_HIGH_BW_MEM    = 1 << 1,
  25     SHMEM_HINT_NEAR_NIC_MEM   = 1 << 2,
  26     SHMEM_HINT_DEVICE_GPU_MEM = 1 << 3,
  27     SHMEM_HINT_DEVICE_NIC_MEM = 1 << 4,
  28 
  29     SHMEM_HINT_PSYNC          = 1 << 16,
  30     SHMEM_HINT_PWORK          = 1 << 17,
  31     SHMEM_HINT_ATOMICS        = 1 << 18
  32 };
  33 
  34 /*
  35  * All OpenSHMEM extension APIs that are not part of this specification must be defined in the shmemx.h include
  36  * file. These extensions shall use the shmemx_ prefix for all routine, variable, and constant names.
  37  */
  38 
  39 /*
  40  * Symmetric heap routines
  41  */
  42 OSHMEM_DECLSPEC  void* shmemx_malloc_with_hint(size_t size, long hint);
  43 
  44 /*
  45  * Elemental put routines
  46  */
  47 OSHMEM_DECLSPEC  void shmemx_int16_p(int16_t* addr, int16_t value, int pe);
  48 OSHMEM_DECLSPEC  void shmemx_int32_p(int32_t* addr, int32_t value, int pe);
  49 OSHMEM_DECLSPEC  void shmemx_int64_p(int64_t* addr, int64_t value, int pe);
  50 
  51 /*
  52  * Elemental put routines
  53  */
  54 
  55 /*
  56  * Block data put routines
  57  */
  58 
  59 /*
  60  * Strided put routines
  61  */
  62 
  63 /*
  64  * Elemental get routines
  65  */
  66 OSHMEM_DECLSPEC  int16_t shmemx_int16_g(const int16_t* addr, int pe);
  67 OSHMEM_DECLSPEC  int32_t shmemx_int32_g(const int32_t* addr, int pe);
  68 OSHMEM_DECLSPEC  int64_t shmemx_int64_g(const int64_t* addr, int pe);
  69 
  70 /*
  71  * Block data get routines
  72  */
  73 
  74 /*
  75  * Strided get routines
  76  */
  77 
  78 /*
  79  * Atomic operations
  80  */
  81 /* Atomic swap */
  82 OSHMEM_DECLSPEC int32_t shmemx_int32_swap(int32_t *target, int32_t value, int pe);
  83 OSHMEM_DECLSPEC int64_t shmemx_int64_swap(int64_t *target, int64_t value, int pe);
  84 
  85 /* Atomic set */
  86 OSHMEM_DECLSPEC void shmemx_int32_set(int32_t *target, int32_t value, int pe);
  87 OSHMEM_DECLSPEC void shmemx_int64_set(int64_t *target, int64_t value, int pe);
  88 
  89 /* Atomic conditional swap */
  90 OSHMEM_DECLSPEC int32_t shmemx_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
  91 OSHMEM_DECLSPEC int64_t shmemx_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
  92 
  93 /* Atomic Fetch&Add */
  94 OSHMEM_DECLSPEC int32_t shmemx_int32_fadd(int32_t *target, int32_t value, int pe);
  95 OSHMEM_DECLSPEC int64_t shmemx_int64_fadd(int64_t *target, int64_t value, int pe);
  96 
  97 /* Atomic Fetch&And */
  98 OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_and(int32_t *target, int32_t value, int pe);
  99 OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_and(int64_t *target, int64_t value, int pe);
 100 OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_and(uint32_t *target, uint32_t value, int pe);
 101 OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_and(uint64_t *target, uint64_t value, int pe);
 102 
 103 /* Atomic Fetch&Or */
 104 OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_or(int32_t *target, int32_t value, int pe);
 105 OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_or(int64_t *target, int64_t value, int pe);
 106 OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_or(uint32_t *target, uint32_t value, int pe);
 107 OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_or(uint64_t *target, uint64_t value, int pe);
 108 
 109 /* Atomic Fetch&Xor */
 110 OSHMEM_DECLSPEC int32_t shmemx_int32_atomic_fetch_xor(int32_t *target, int32_t value, int pe);
 111 OSHMEM_DECLSPEC int64_t shmemx_int64_atomic_fetch_xor(int64_t *target, int64_t value, int pe);
 112 OSHMEM_DECLSPEC uint32_t shmemx_uint32_atomic_fetch_xor(uint32_t *target, uint32_t value, int pe);
 113 OSHMEM_DECLSPEC uint64_t shmemx_uint64_atomic_fetch_xor(uint64_t *target, uint64_t value, int pe);
 114 
 115 /* Atomic Fetch */
 116 OSHMEM_DECLSPEC int32_t shmemx_int32_fetch(const int32_t *target, int pe);
 117 OSHMEM_DECLSPEC int64_t shmemx_int64_fetch(const int64_t *target, int pe);
 118 
 119 /* Atomic Fetch&Inc */
 120 OSHMEM_DECLSPEC int32_t shmemx_int32_finc(int32_t *target, int pe);
 121 OSHMEM_DECLSPEC int64_t shmemx_int64_finc(int64_t *target, int pe);
 122 
 123 /* Atomic Add */
 124 OSHMEM_DECLSPEC void shmemx_int32_add(int32_t *target, int32_t value, int pe);
 125 OSHMEM_DECLSPEC void shmemx_int64_add(int64_t *target, int64_t value, int pe);
 126 
 127 /* Atomic And */
 128 OSHMEM_DECLSPEC void shmemx_int32_atomic_and(int32_t *target, int32_t value, int pe);
 129 OSHMEM_DECLSPEC void shmemx_int64_atomic_and(int64_t *target, int64_t value, int pe);
 130 OSHMEM_DECLSPEC void shmemx_uint32_atomic_and(uint32_t *target, uint32_t value, int pe);
 131 OSHMEM_DECLSPEC void shmemx_uint64_atomic_and(uint64_t *target, uint64_t value, int pe);
 132 
 133 /* Atomic Or */
 134 OSHMEM_DECLSPEC void shmemx_int32_atomic_or(int32_t *target, int32_t value, int pe);
 135 OSHMEM_DECLSPEC void shmemx_int64_atomic_or(int64_t *target, int64_t value, int pe);
 136 OSHMEM_DECLSPEC void shmemx_uint32_atomic_or(uint32_t *target, uint32_t value, int pe);
 137 OSHMEM_DECLSPEC void shmemx_uint64_atomic_or(uint64_t *target, uint64_t value, int pe);
 138 
 139 /* Atomic Xor */
 140 OSHMEM_DECLSPEC void shmemx_int32_atomic_xor(int32_t *target, int32_t value, int pe);
 141 OSHMEM_DECLSPEC void shmemx_int64_atomic_xor(int64_t *target, int64_t value, int pe);
 142 OSHMEM_DECLSPEC void shmemx_uint32_atomic_xor(uint32_t *target, uint32_t value, int pe);
 143 OSHMEM_DECLSPEC void shmemx_uint64_atomic_xor(uint64_t *target, uint64_t value, int pe);
 144 
 145 /* Atomic Inc */
 146 OSHMEM_DECLSPEC void shmemx_int32_inc(int32_t *target, int pe);
 147 OSHMEM_DECLSPEC void shmemx_int64_inc(int64_t *target, int pe);
 148 
 149 /*
 150  * P2P sync routines
 151  */
 152 OSHMEM_DECLSPEC  void shmemx_int32_wait(int32_t *addr, int32_t value);
 153 OSHMEM_DECLSPEC  void shmemx_int64_wait(int64_t *addr, int64_t value);
 154 
 155 OSHMEM_DECLSPEC  void shmemx_int32_wait_until(int32_t *addr, int cmp, int32_t value);
 156 OSHMEM_DECLSPEC  void shmemx_int64_wait_until(int64_t *addr, int cmp, int64_t value);
 157 
 158 /*
 159  * Reduction routines
 160  */
 161 OSHMEM_DECLSPEC void shmemx_int16_and_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 162 OSHMEM_DECLSPEC void shmemx_int32_and_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 163 OSHMEM_DECLSPEC void shmemx_int64_and_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 164 
 165 OSHMEM_DECLSPEC void shmemx_int16_or_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 166 OSHMEM_DECLSPEC void shmemx_int32_or_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 167 OSHMEM_DECLSPEC void shmemx_int64_or_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 168 
 169 OSHMEM_DECLSPEC void shmemx_int16_xor_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 170 OSHMEM_DECLSPEC void shmemx_int32_xor_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 171 OSHMEM_DECLSPEC void shmemx_int64_xor_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 172 
 173 OSHMEM_DECLSPEC void shmemx_int16_max_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 174 OSHMEM_DECLSPEC void shmemx_int32_max_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 175 OSHMEM_DECLSPEC void shmemx_int64_max_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 176 
 177 OSHMEM_DECLSPEC void shmemx_int16_min_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 178 OSHMEM_DECLSPEC void shmemx_int32_min_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 179 OSHMEM_DECLSPEC void shmemx_int64_min_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 180 
 181 OSHMEM_DECLSPEC void shmemx_int16_sum_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 182 OSHMEM_DECLSPEC void shmemx_int32_sum_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 183 OSHMEM_DECLSPEC void shmemx_int64_sum_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 184 
 185 OSHMEM_DECLSPEC void shmemx_int16_prod_to_all(int16_t *target, const int16_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int16_t *pWrk, long *pSync);
 186 OSHMEM_DECLSPEC void shmemx_int32_prod_to_all(int32_t *target, const int32_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int32_t *pWrk, long *pSync);
 187 OSHMEM_DECLSPEC void shmemx_int64_prod_to_all(int64_t *target, const int64_t *source, int nreduce, int PE_start, int logPE_stride, int PE_size, int64_t *pWrk, long *pSync);
 188 
 189 /* shmemx_alltoall_global_nb is a nonblocking collective routine, where each PE
 190  * exchanges “size” bytes of data with all other PEs in the OpenSHMEM job.
 191 
 192  *  @param dest        A symmetric data object that is large enough to receive
 193  *                     “size” bytes of data from each PE in the OpenSHMEM job.
 194  *  @param source      A symmetric data object that contains “size” bytes of data
 195  *                     for each PE in the OpenSHMEM job.
 196  *  @param size        The number of bytes to be sent to each PE in the job.
 197  *  @param counter     A symmetric data object to be atomically incremented after
 198  *                     the target buffer is updated.
 199  *
 200  *  @return            OSHMEM_SUCCESS or failure status.
 201  */
 202 OSHMEM_DECLSPEC void shmemx_alltoall_global_nb(void *dest, const void *source, size_t size, long *counter);
 203 
 204 /*
 205  * Backward compatibility section
 206  */
 207 #define shmem_int32_swap            shmemx_int32_swap
 208 #define shmem_int64_swap            shmemx_int64_swap
 209 
 210 #define shmem_int32_set             shmemx_int32_set
 211 #define shmem_int64_set             shmemx_int64_set
 212 
 213 #define shmem_int32_cswap           shmemx_int32_cswap
 214 #define shmem_int64_cswap           shmemx_int64_cswap
 215 
 216 #define shmem_int32_fadd            shmemx_int32_fadd
 217 #define shmem_int64_fadd            shmemx_int64_fadd
 218 
 219 #define shmem_int32_fetch           shmemx_int32_fetch
 220 #define shmem_int64_fetch           shmemx_int64_fetch
 221 
 222 #define shmem_int32_finc            shmemx_int32_finc
 223 #define shmem_int64_finc            shmemx_int64_finc
 224 
 225 #define shmem_int32_add             shmemx_int32_add
 226 #define shmem_int64_add             shmemx_int64_add
 227 #define shmem_int32_inc             shmemx_int32_inc
 228 #define shmem_int64_inc             shmemx_int64_inc
 229 
 230 #define shmem_int32_wait            shmemx_int32_wait
 231 #define shmem_int64_wait            shmemx_int64_wait
 232 
 233 #define shmem_int16_and_to_all      shmemx_int16_and_to_all
 234 #define shmem_int32_and_to_all      shmemx_int32_and_to_all
 235 #define shmem_int64_and_to_all      shmemx_int64_and_to_all
 236 
 237 #define shmem_int16_or_to_all       shmemx_int16_or_to_all
 238 #define shmem_int32_or_to_all       shmemx_int32_or_to_all
 239 #define shmem_int64_or_to_all       shmemx_int64_or_to_all
 240 
 241 #define shmem_int16_xor_to_all      shmemx_int16_xor_to_all
 242 #define shmem_int32_xor_to_all      shmemx_int32_xor_to_all
 243 #define shmem_int64_xor_to_all      shmemx_int64_xor_to_all
 244 
 245 #define shmem_int16_max_to_all      shmemx_int16_max_to_all
 246 #define shmem_int32_max_to_all      shmemx_int32_max_to_all
 247 #define shmem_int64_max_to_all      shmemx_int64_max_to_all
 248 
 249 #define shmem_int16_min_to_all      shmemx_int16_min_to_all
 250 #define shmem_int32_min_to_all      shmemx_int32_min_to_all
 251 #define shmem_int64_min_to_all      shmemx_int64_min_to_all
 252 
 253 #define shmem_int16_sum_to_all      shmemx_int16_sum_to_all
 254 #define shmem_int32_sum_to_all      shmemx_int32_sum_to_all
 255 #define shmem_int64_sum_to_all      shmemx_int64_sum_to_all
 256 
 257 #define shmem_int16_prod_to_all     shmemx_int16_prod_to_all
 258 #define shmem_int32_prod_to_all     shmemx_int32_prod_to_all
 259 #define shmem_int64_prod_to_all     shmemx_int64_prod_to_all
 260 
 261 #if defined(c_plusplus) || defined(__cplusplus)
 262 }
 263 #endif
 264 
 265 #endif /* OSHMEM_SHMEMX_H */

/* [<][>][^][v][top][bottom][index][help] */