1
2
3
4
5
6
7
8
9
10
11
12 #ifndef PSHMEM_SHMEMX_H
13 #define PSHMEM_SHMEMX_H
14
15 #if defined(c_plusplus) || defined(__cplusplus)
16 extern "C" {
17 #endif
18
19
20
21
22 OSHMEM_DECLSPEC void* pshmemx_malloc_with_hint(size_t size, long hint);
23
24
25
26
27
28
29 OSHMEM_DECLSPEC void pstart_pes(int npes);
30
31 OSHMEM_DECLSPEC int p_num_pes(void);
32 OSHMEM_DECLSPEC int p_my_pe(void);
33
34 OSHMEM_DECLSPEC void* pshmalloc(size_t size);
35 OSHMEM_DECLSPEC void* pshmemalign(size_t align, size_t size);
36 OSHMEM_DECLSPEC void* pshrealloc(void *ptr, size_t size);
37 OSHMEM_DECLSPEC void pshfree(void* ptr);
38
39 OSHMEM_DECLSPEC void pshmem_char_put(char *target, const char *source, size_t len, int pe);
40 OSHMEM_DECLSPEC void pshmem_char_get(char *target, const char *source, size_t len, int pe);
41
42
43
44
45
46
47
48
49
50
51 OSHMEM_DECLSPEC void pshmemx_int16_p(int16_t* addr, int16_t value, int pe);
52 OSHMEM_DECLSPEC void pshmemx_int32_p(int32_t* addr, int32_t value, int pe);
53 OSHMEM_DECLSPEC void pshmemx_int64_p(int64_t* addr, int64_t value, int pe);
54
55
56
57
58
59
60
61
62
63
64
65
66 OSHMEM_DECLSPEC int16_t pshmemx_int16_g(const int16_t* addr, int pe);
67 OSHMEM_DECLSPEC int32_t pshmemx_int32_g(const int32_t* addr, int pe);
68 OSHMEM_DECLSPEC int64_t pshmemx_int64_g(const int64_t* addr, int pe);
69
70
71
72
73
74
75
76
77
78
79
80
81
82 OSHMEM_DECLSPEC int32_t pshmemx_int32_swap(int32_t *target, int32_t value, int pe);
83 OSHMEM_DECLSPEC int64_t pshmemx_int64_swap(int64_t *target, int64_t value, int pe);
84
85
86 OSHMEM_DECLSPEC void pshmemx_int32_set(int32_t *target, int32_t value, int pe);
87 OSHMEM_DECLSPEC void pshmemx_int64_set(int64_t *target, int64_t value, int pe);
88
89
90 OSHMEM_DECLSPEC int32_t pshmemx_int32_cswap(int32_t *target, int32_t cond, int32_t value, int pe);
91 OSHMEM_DECLSPEC int64_t pshmemx_int64_cswap(int64_t *target, int64_t cond, int64_t value, int pe);
92
93
94 OSHMEM_DECLSPEC int32_t pshmemx_int32_fadd(int32_t *target, int32_t value, int pe);
95 OSHMEM_DECLSPEC int64_t pshmemx_int64_fadd(int64_t *target, int64_t value, int pe);
96
97
98 OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_and(int32_t *target, int32_t value, int pe);
99 OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_and(int64_t *target, int64_t value, int pe);
100 OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_and(uint32_t *target, uint32_t value, int pe);
101 OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_and(uint64_t *target, uint64_t value, int pe);
102
103
104 OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_or(int32_t *target, int32_t value, int pe);
105 OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_or(int64_t *target, int64_t value, int pe);
106 OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_or(uint32_t *target, uint32_t value, int pe);
107 OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_or(uint64_t *target, uint64_t value, int pe);
108
109
110 OSHMEM_DECLSPEC int32_t pshmemx_int32_atomic_fetch_xor(int32_t *target, int32_t value, int pe);
111 OSHMEM_DECLSPEC int64_t pshmemx_int64_atomic_fetch_xor(int64_t *target, int64_t value, int pe);
112 OSHMEM_DECLSPEC uint32_t pshmemx_uint32_atomic_fetch_xor(uint32_t *target, uint32_t value, int pe);
113 OSHMEM_DECLSPEC uint64_t pshmemx_uint64_atomic_fetch_xor(uint64_t *target, uint64_t value, int pe);
114
115
116 OSHMEM_DECLSPEC int32_t pshmemx_int32_fetch(const int32_t *target, int pe);
117 OSHMEM_DECLSPEC int64_t pshmemx_int64_fetch(const int64_t *target, int pe);
118
119
120 OSHMEM_DECLSPEC int32_t pshmemx_int32_finc(int32_t *target, int pe);
121 OSHMEM_DECLSPEC int64_t pshmemx_int64_finc(int64_t *target, int pe);
122
123
124 OSHMEM_DECLSPEC void pshmemx_int32_add(int32_t *target, int32_t value, int pe);
125 OSHMEM_DECLSPEC void pshmemx_int64_add(int64_t *target, int64_t value, int pe);
126
127
128 OSHMEM_DECLSPEC void pshmemx_int32_atomic_and(int32_t *target, int32_t value, int pe);
129 OSHMEM_DECLSPEC void pshmemx_int64_atomic_and(int64_t *target, int64_t value, int pe);
130 OSHMEM_DECLSPEC void pshmemx_uint32_atomic_and(uint32_t *target, uint32_t value, int pe);
131 OSHMEM_DECLSPEC void pshmemx_uint64_atomic_and(uint64_t *target, uint64_t value, int pe);
132
133
134 OSHMEM_DECLSPEC void pshmemx_int32_atomic_or(int32_t *target, int32_t value, int pe);
135 OSHMEM_DECLSPEC void pshmemx_int64_atomic_or(int64_t *target, int64_t value, int pe);
136 OSHMEM_DECLSPEC void pshmemx_uint32_atomic_or(uint32_t *target, uint32_t value, int pe);
137 OSHMEM_DECLSPEC void pshmemx_uint64_atomic_or(uint64_t *target, uint64_t value, int pe);
138
139
140 OSHMEM_DECLSPEC void pshmemx_int32_atomic_xor(int32_t *target, int32_t value, int pe);
141 OSHMEM_DECLSPEC void pshmemx_int64_atomic_xor(int64_t *target, int64_t value, int pe);
142 OSHMEM_DECLSPEC void pshmemx_uint32_atomic_xor(uint32_t *target, uint32_t value, int pe);
143 OSHMEM_DECLSPEC void pshmemx_uint64_atomic_xor(uint64_t *target, uint64_t value, int pe);
144
145
146 OSHMEM_DECLSPEC void pshmemx_int32_inc(int32_t *target, int pe);
147 OSHMEM_DECLSPEC void pshmemx_int64_inc(int64_t *target, int pe);
148
149
150
151
152 OSHMEM_DECLSPEC void pshmemx_int32_wait(int32_t *addr, int32_t value);
153 OSHMEM_DECLSPEC void pshmemx_int64_wait(int64_t *addr, int64_t value);
154
155 OSHMEM_DECLSPEC void pshmemx_int32_wait_until(int32_t *addr, int cmp, int32_t value);
156 OSHMEM_DECLSPEC void pshmemx_int64_wait_until(int64_t *addr, int cmp, int64_t value);
157
158
159
160
161 OSHMEM_DECLSPEC void pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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 pshmemx_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
190
191
192 #define pshmem_int32_swap pshmemx_int32_swap
193 #define pshmem_int64_swap pshmemx_int64_swap
194
195 #define pshmem_int32_set pshmemx_int32_set
196 #define pshmem_int64_set pshmemx_int64_set
197
198 #define pshmem_int32_cswap pshmemx_int32_cswap
199 #define pshmem_int64_cswap pshmemx_int64_cswap
200
201 #define pshmem_int32_fadd pshmemx_int32_fadd
202 #define pshmem_int64_fadd pshmemx_int64_fadd
203
204 #define pshmem_int32_fetch pshmemx_int32_fetch
205 #define pshmem_int64_fetch pshmemx_int64_fetch
206
207 #define pshmem_int32_finc pshmemx_int32_finc
208 #define pshmem_int64_finc pshmemx_int64_finc
209
210 #define pshmem_int32_add pshmemx_int32_add
211 #define pshmem_int64_add pshmemx_int64_add
212
213 #define pshmem_int32_inc pshmemx_int32_inc
214 #define pshmem_int64_inc pshmemx_int64_inc
215
216 #define pshmem_int32_wait pshmemx_int32_wait
217 #define pshmem_int64_wait pshmemx_int64_wait
218
219 #define pshmem_int16_and_to_all pshmemx_int16_and_to_all
220 #define pshmem_int32_and_to_all pshmemx_int32_and_to_all
221 #define pshmem_int64_and_to_all pshmemx_int64_and_to_all
222
223 #define pshmem_int16_or_to_all pshmemx_int16_or_to_all
224 #define pshmem_int32_or_to_all pshmemx_int32_or_to_all
225 #define pshmem_int64_or_to_all pshmemx_int64_or_to_all
226
227 #define pshmem_int16_xor_to_all pshmemx_int16_xor_to_all
228 #define pshmem_int32_xor_to_all pshmemx_int32_xor_to_all
229 #define pshmem_int64_xor_to_all pshmemx_int64_xor_to_all
230
231 #define pshmem_int16_max_to_all pshmemx_int16_max_to_all
232 #define pshmem_int32_max_to_all pshmemx_int32_max_to_all
233 #define pshmem_int64_max_to_all pshmemx_int64_max_to_all
234
235 #define pshmem_int16_min_to_all pshmemx_int16_min_to_all
236 #define pshmem_int32_min_to_all pshmemx_int32_min_to_all
237 #define pshmem_int64_min_to_all pshmemx_int64_min_to_all
238
239 #define pshmem_int16_sum_to_all pshmemx_int16_sum_to_all
240 #define pshmem_int32_sum_to_all pshmemx_int32_sum_to_all
241 #define pshmem_int64_sum_to_all pshmemx_int64_sum_to_all
242
243 #define pshmem_int16_prod_to_all pshmemx_int16_prod_to_all
244 #define pshmem_int32_prod_to_all pshmemx_int32_prod_to_all
245 #define pshmem_int64_prod_to_all pshmemx_int64_prod_to_all
246
247 #if defined(c_plusplus) || defined(__cplusplus)
248 }
249 #endif
250
251 #endif