libgupc/
[official-gcc.git] / libgupc / include / upc_collective.h
blob469da9f31a6955f073c6636ca636d1f564f06fb9
1 /* Copyright (c) 2009, 2010, 2011, 2012
2 Free Software Foundation, Inc.
3 This file is part of the UPC runtime library.
4 Written by Gary Funck <gary@intrepid.com>
5 and Nenad Vukicevic <nenad@intrepid.com>
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
29 #ifndef _UPC_COLLECTIVE_H_
30 #define _UPC_COLLECTIVE_H_
32 #include <upc_types.h>
34 /* Per the UPC collectives library specification, the following
35 operations are defined in addition to those defined in upc_types.h.
36 Values below 2^16 are reserved. */
37 #define UPC_FUNC (1UL<<16)
38 #define UPC_NONCOMM_FUNC (1UL<<17)
39 #define UPC_MAX_COLL_OP UPC_NONCOMM_FUNC
41 /* Function codes for error checking */
43 #define UPC_BRDCST 0
44 #define UPC_SCAT 1
45 #define UPC_GATH 2
46 #define UPC_GATH_ALL 3
47 #define UPC_EXCH 4
48 #define UPC_PERM 5
49 #define UPC_RED 6
50 #define UPC_PRED 7
51 #define UPC_SORT 8
53 extern void upc_all_broadcast (shared void *dst,
54 shared const void *src,
55 size_t nbytes, upc_flag_t sync_mode);
57 extern void upc_coll_err (shared void *dst, shared const void *src,
58 shared const int *perm,
59 size_t nbytes,
60 upc_flag_t sync_mode,
61 size_t blk_size,
62 size_t nelems, upc_op_t op, upc_flag_t upc_coll_op);
64 extern void upc_all_exchange (shared void *dst, shared const void *src,
65 size_t nbytes, upc_flag_t sync_mode);
67 extern void upc_all_gather_all (shared void *dst,
68 shared const void *src,
69 size_t nbytes, upc_flag_t sync_mode);
71 extern void upc_all_gather (shared void *dst, shared const void *src,
72 size_t nbytes, upc_flag_t sync_mode);
74 extern void upc_coll_init (void);
76 extern void upc_all_permute (shared void *dst, shared const void *src,
77 shared const int *perm, size_t nbytes,
78 upc_flag_t sync_mode);
80 extern void upc_all_prefix_reduceC (shared void *dst, shared const void *src,
81 upc_op_t op, size_t nelems,
82 size_t blk_size,
83 signed char (*func) (signed char,
84 signed char),
85 upc_flag_t sync_mode);
87 extern void upc_all_prefix_reduceUC (shared void *dst,
88 shared const void *src, upc_op_t op,
89 size_t nelems, size_t blk_size,
90 unsigned char (*func) (unsigned char,
91 unsigned char),
92 upc_flag_t sync_mode);
94 extern void upc_all_prefix_reduceS (shared void *dst, shared const void *src,
95 upc_op_t op, size_t nelems,
96 size_t blk_size,
97 signed short (*func) (signed short,
98 signed short),
99 upc_flag_t sync_mode);
101 extern void upc_all_prefix_reduceUS (shared void *dst,
102 shared const void *src, upc_op_t op,
103 size_t nelems, size_t blk_size,
104 unsigned short (*func) (unsigned short,
105 unsigned short),
106 upc_flag_t sync_mode);
108 extern void upc_all_prefix_reduceI (shared void *dst, shared const void *src,
109 upc_op_t op, size_t nelems,
110 size_t blk_size,
111 signed int (*func) (signed int,
112 signed int),
113 upc_flag_t sync_mode);
115 extern void upc_all_prefix_reduceUI (shared void *dst,
116 shared const void *src, upc_op_t op,
117 size_t nelems, size_t blk_size,
118 unsigned int (*func) (unsigned int,
119 unsigned int),
120 upc_flag_t sync_mode);
122 extern void upc_all_prefix_reduceL (shared void *dst, shared const void *src,
123 upc_op_t op, size_t nelems,
124 size_t blk_size,
125 signed long (*func) (signed long,
126 signed long),
127 upc_flag_t sync_mode);
129 extern void upc_all_prefix_reduceUL (shared void *dst,
130 shared const void *src, upc_op_t op,
131 size_t nelems, size_t blk_size,
132 unsigned long (*func) (unsigned long,
133 unsigned long),
134 upc_flag_t sync_mode);
136 extern void upc_all_prefix_reduceF (shared void *dst, shared const void *src,
137 upc_op_t op, size_t nelems,
138 size_t blk_size, float (*func) (float,
139 float),
140 upc_flag_t sync_mode);
142 extern void upc_all_prefix_reduceD (shared void *dst, shared const void *src,
143 upc_op_t op, size_t nelems,
144 size_t blk_size, double (*func) (double,
145 double),
146 upc_flag_t sync_mode);
148 extern void upc_all_prefix_reduceLD (shared void *dst, shared const void *src,
149 upc_op_t op, size_t nelems,
150 size_t blk_size, long double (*func) (long double,
151 long double),
152 upc_flag_t sync_mode);
154 extern void upc_all_reduceC (shared void *dst, shared const void *src,
155 upc_op_t op, size_t nelems, size_t blk_size,
156 signed char (*func) (signed char, signed char),
157 upc_flag_t sync_mode);
159 extern void upc_all_reduceUC (shared void *dst, shared const void *src,
160 upc_op_t op, size_t nelems, size_t blk_size,
161 unsigned char (*func) (unsigned char,
162 unsigned char),
163 upc_flag_t sync_mode);
165 extern void upc_all_reduceS (shared void *dst, shared const void *src,
166 upc_op_t op, size_t nelems, size_t blk_size,
167 signed short (*func) (signed short,
168 signed short),
169 upc_flag_t sync_mode);
171 extern void upc_all_reduceUS (shared void *dst, shared const void *src,
172 upc_op_t op, size_t nelems, size_t blk_size,
173 unsigned short (*func) (unsigned short,
174 unsigned short),
175 upc_flag_t sync_mode);
177 extern void upc_all_reduceI (shared void *dst, shared const void *src,
178 upc_op_t op, size_t nelems, size_t blk_size,
179 signed int (*func) (signed int, signed int),
180 upc_flag_t sync_mode);
182 extern void upc_all_reduceUI (shared void *dst, shared const void *src,
183 upc_op_t op, size_t nelems, size_t blk_size,
184 unsigned int (*func) (unsigned int,
185 unsigned int),
186 upc_flag_t sync_mode);
188 extern void upc_all_reduceL (shared void *dst, shared const void *src,
189 upc_op_t op, size_t nelems, size_t blk_size,
190 signed long (*func) (signed long, signed long),
191 upc_flag_t sync_mode);
193 extern void upc_all_reduceUL (shared void *dst, shared const void *src,
194 upc_op_t op, size_t nelems, size_t blk_size,
195 unsigned long (*func) (unsigned long,
196 unsigned long),
197 upc_flag_t sync_mode);
199 extern void upc_all_reduceF (shared void *dst, shared const void *src,
200 upc_op_t op, size_t nelems, size_t blk_size,
201 float (*func) (float, float),
202 upc_flag_t sync_mode);
204 extern void upc_all_reduceD (shared void *dst, shared const void *src,
205 upc_op_t op, size_t nelems, size_t blk_size,
206 double (*func) (double, double),
207 upc_flag_t sync_mode);
209 extern void upc_all_reduceLD (shared void *dst, shared const void *src,
210 upc_op_t op, size_t nelems, size_t blk_size,
211 long double (*func) (long double, long double),
212 upc_flag_t sync_mode);
214 extern void upc_all_scatter (shared void *dst, shared const void *src,
215 size_t nbytes, upc_flag_t sync_mode);
217 extern void upc_all_sort (shared void *A, size_t elem_size,
218 size_t nelems, size_t blk_size,
219 int (*func) (shared void *, shared void *),
220 upc_flag_t sync_mode);
222 #endif /* !_UPC_COLLECTIVE_H_ */