1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  *
5  * DO NOT EDIT: AUTOMATICALLY GENERATED FILE !!
6  */
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <wchar.h>
11 #include "yaksi.h"
12 #include "yaksu.h"
13 #include "yaksuri_cudai.h"
14 #include "yaksuri_cudai_populate_pupfns.h"
15 #include "yaksuri_cudai_pup.h"
16 
yaksuri_cudai_populate_pupfns_resized_contig(yaksi_type_s * type)17 int yaksuri_cudai_populate_pupfns_resized_contig(yaksi_type_s * type)
18 {
19     int rc = YAKSA_SUCCESS;
20     yaksuri_cudai_type_s *cuda = (yaksuri_cudai_type_s *) type->backend.cuda.priv;
21 
22     char *str = getenv("YAKSA_ENV_MAX_NESTING_LEVEL");
23     int max_nesting_level;
24     if (str) {
25         max_nesting_level = atoi(str);
26     } else {
27         max_nesting_level = YAKSI_ENV_DEFAULT_NESTING_LEVEL;
28     }
29 
30     switch (type->u.resized.child->u.contig.child->kind) {
31         case YAKSI_TYPE_KIND__HVECTOR:
32         switch (type->u.resized.child->u.contig.child->u.hvector.child->kind) {
33             case YAKSI_TYPE_KIND__BUILTIN:
34             switch (type->u.resized.child->u.contig.child->u.hvector.child->u.builtin.handle) {
35                 case YAKSA_TYPE___BOOL:
36                 if (max_nesting_level >= 3) {
37                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector__Bool;
38                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector__Bool;
39                 }
40                 break;
41                 case YAKSA_TYPE__CHAR:
42                 if (max_nesting_level >= 3) {
43                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_char;
44                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_char;
45                 }
46                 break;
47                 case YAKSA_TYPE__WCHAR_T:
48                 if (max_nesting_level >= 3) {
49                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_wchar_t;
50                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_wchar_t;
51                 }
52                 break;
53                 case YAKSA_TYPE__INT8_T:
54                 if (max_nesting_level >= 3) {
55                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_int8_t;
56                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_int8_t;
57                 }
58                 break;
59                 case YAKSA_TYPE__INT16_T:
60                 if (max_nesting_level >= 3) {
61                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_int16_t;
62                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_int16_t;
63                 }
64                 break;
65                 case YAKSA_TYPE__INT32_T:
66                 if (max_nesting_level >= 3) {
67                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_int32_t;
68                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_int32_t;
69                 }
70                 break;
71                 case YAKSA_TYPE__INT64_T:
72                 if (max_nesting_level >= 3) {
73                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_int64_t;
74                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_int64_t;
75                 }
76                 break;
77                 case YAKSA_TYPE__FLOAT:
78                 if (max_nesting_level >= 3) {
79                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_float;
80                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_float;
81                 }
82                 break;
83                 case YAKSA_TYPE__DOUBLE:
84                 if (max_nesting_level >= 3) {
85                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_double;
86                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_double;
87                 }
88                 break;
89                 case YAKSA_TYPE__LONG_DOUBLE:
90                 if (max_nesting_level >= 3) {
91                     cuda->pack = yaksuri_cudai_pack_resized_contig_hvector_double;
92                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hvector_double;
93                 }
94                 break;
95                 default:
96                     break;
97             }
98             break;
99             default:
100                 break;
101         }
102         break;
103         case YAKSI_TYPE_KIND__BLKHINDX:
104         switch (type->u.resized.child->u.contig.child->u.blkhindx.child->kind) {
105             case YAKSI_TYPE_KIND__BUILTIN:
106             switch (type->u.resized.child->u.contig.child->u.blkhindx.child->u.builtin.handle) {
107                 case YAKSA_TYPE___BOOL:
108                 if (max_nesting_level >= 3) {
109                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx__Bool;
110                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx__Bool;
111                 }
112                 break;
113                 case YAKSA_TYPE__CHAR:
114                 if (max_nesting_level >= 3) {
115                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_char;
116                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_char;
117                 }
118                 break;
119                 case YAKSA_TYPE__WCHAR_T:
120                 if (max_nesting_level >= 3) {
121                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_wchar_t;
122                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_wchar_t;
123                 }
124                 break;
125                 case YAKSA_TYPE__INT8_T:
126                 if (max_nesting_level >= 3) {
127                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_int8_t;
128                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_int8_t;
129                 }
130                 break;
131                 case YAKSA_TYPE__INT16_T:
132                 if (max_nesting_level >= 3) {
133                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_int16_t;
134                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_int16_t;
135                 }
136                 break;
137                 case YAKSA_TYPE__INT32_T:
138                 if (max_nesting_level >= 3) {
139                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_int32_t;
140                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_int32_t;
141                 }
142                 break;
143                 case YAKSA_TYPE__INT64_T:
144                 if (max_nesting_level >= 3) {
145                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_int64_t;
146                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_int64_t;
147                 }
148                 break;
149                 case YAKSA_TYPE__FLOAT:
150                 if (max_nesting_level >= 3) {
151                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_float;
152                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_float;
153                 }
154                 break;
155                 case YAKSA_TYPE__DOUBLE:
156                 if (max_nesting_level >= 3) {
157                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_double;
158                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_double;
159                 }
160                 break;
161                 case YAKSA_TYPE__LONG_DOUBLE:
162                 if (max_nesting_level >= 3) {
163                     cuda->pack = yaksuri_cudai_pack_resized_contig_blkhindx_double;
164                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_blkhindx_double;
165                 }
166                 break;
167                 default:
168                     break;
169             }
170             break;
171             default:
172                 break;
173         }
174         break;
175         case YAKSI_TYPE_KIND__HINDEXED:
176         switch (type->u.resized.child->u.contig.child->u.hindexed.child->kind) {
177             case YAKSI_TYPE_KIND__BUILTIN:
178             switch (type->u.resized.child->u.contig.child->u.hindexed.child->u.builtin.handle) {
179                 case YAKSA_TYPE___BOOL:
180                 if (max_nesting_level >= 3) {
181                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed__Bool;
182                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed__Bool;
183                 }
184                 break;
185                 case YAKSA_TYPE__CHAR:
186                 if (max_nesting_level >= 3) {
187                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_char;
188                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_char;
189                 }
190                 break;
191                 case YAKSA_TYPE__WCHAR_T:
192                 if (max_nesting_level >= 3) {
193                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_wchar_t;
194                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_wchar_t;
195                 }
196                 break;
197                 case YAKSA_TYPE__INT8_T:
198                 if (max_nesting_level >= 3) {
199                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_int8_t;
200                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_int8_t;
201                 }
202                 break;
203                 case YAKSA_TYPE__INT16_T:
204                 if (max_nesting_level >= 3) {
205                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_int16_t;
206                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_int16_t;
207                 }
208                 break;
209                 case YAKSA_TYPE__INT32_T:
210                 if (max_nesting_level >= 3) {
211                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_int32_t;
212                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_int32_t;
213                 }
214                 break;
215                 case YAKSA_TYPE__INT64_T:
216                 if (max_nesting_level >= 3) {
217                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_int64_t;
218                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_int64_t;
219                 }
220                 break;
221                 case YAKSA_TYPE__FLOAT:
222                 if (max_nesting_level >= 3) {
223                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_float;
224                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_float;
225                 }
226                 break;
227                 case YAKSA_TYPE__DOUBLE:
228                 if (max_nesting_level >= 3) {
229                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_double;
230                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_double;
231                 }
232                 break;
233                 case YAKSA_TYPE__LONG_DOUBLE:
234                 if (max_nesting_level >= 3) {
235                     cuda->pack = yaksuri_cudai_pack_resized_contig_hindexed_double;
236                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_hindexed_double;
237                 }
238                 break;
239                 default:
240                     break;
241             }
242             break;
243             default:
244                 break;
245         }
246         break;
247         case YAKSI_TYPE_KIND__CONTIG:
248         switch (type->u.resized.child->u.contig.child->u.contig.child->kind) {
249             case YAKSI_TYPE_KIND__BUILTIN:
250             switch (type->u.resized.child->u.contig.child->u.contig.child->u.builtin.handle) {
251                 case YAKSA_TYPE___BOOL:
252                 if (max_nesting_level >= 3) {
253                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig__Bool;
254                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig__Bool;
255                 }
256                 break;
257                 case YAKSA_TYPE__CHAR:
258                 if (max_nesting_level >= 3) {
259                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_char;
260                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_char;
261                 }
262                 break;
263                 case YAKSA_TYPE__WCHAR_T:
264                 if (max_nesting_level >= 3) {
265                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_wchar_t;
266                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_wchar_t;
267                 }
268                 break;
269                 case YAKSA_TYPE__INT8_T:
270                 if (max_nesting_level >= 3) {
271                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_int8_t;
272                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_int8_t;
273                 }
274                 break;
275                 case YAKSA_TYPE__INT16_T:
276                 if (max_nesting_level >= 3) {
277                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_int16_t;
278                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_int16_t;
279                 }
280                 break;
281                 case YAKSA_TYPE__INT32_T:
282                 if (max_nesting_level >= 3) {
283                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_int32_t;
284                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_int32_t;
285                 }
286                 break;
287                 case YAKSA_TYPE__INT64_T:
288                 if (max_nesting_level >= 3) {
289                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_int64_t;
290                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_int64_t;
291                 }
292                 break;
293                 case YAKSA_TYPE__FLOAT:
294                 if (max_nesting_level >= 3) {
295                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_float;
296                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_float;
297                 }
298                 break;
299                 case YAKSA_TYPE__DOUBLE:
300                 if (max_nesting_level >= 3) {
301                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_double;
302                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_double;
303                 }
304                 break;
305                 case YAKSA_TYPE__LONG_DOUBLE:
306                 if (max_nesting_level >= 3) {
307                     cuda->pack = yaksuri_cudai_pack_resized_contig_contig_double;
308                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_contig_double;
309                 }
310                 break;
311                 default:
312                     break;
313             }
314             break;
315             default:
316                 break;
317         }
318         break;
319         case YAKSI_TYPE_KIND__RESIZED:
320         switch (type->u.resized.child->u.contig.child->u.resized.child->kind) {
321             case YAKSI_TYPE_KIND__BUILTIN:
322             switch (type->u.resized.child->u.contig.child->u.resized.child->u.builtin.handle) {
323                 case YAKSA_TYPE___BOOL:
324                 if (max_nesting_level >= 3) {
325                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized__Bool;
326                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized__Bool;
327                 }
328                 break;
329                 case YAKSA_TYPE__CHAR:
330                 if (max_nesting_level >= 3) {
331                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_char;
332                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_char;
333                 }
334                 break;
335                 case YAKSA_TYPE__WCHAR_T:
336                 if (max_nesting_level >= 3) {
337                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_wchar_t;
338                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_wchar_t;
339                 }
340                 break;
341                 case YAKSA_TYPE__INT8_T:
342                 if (max_nesting_level >= 3) {
343                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_int8_t;
344                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_int8_t;
345                 }
346                 break;
347                 case YAKSA_TYPE__INT16_T:
348                 if (max_nesting_level >= 3) {
349                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_int16_t;
350                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_int16_t;
351                 }
352                 break;
353                 case YAKSA_TYPE__INT32_T:
354                 if (max_nesting_level >= 3) {
355                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_int32_t;
356                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_int32_t;
357                 }
358                 break;
359                 case YAKSA_TYPE__INT64_T:
360                 if (max_nesting_level >= 3) {
361                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_int64_t;
362                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_int64_t;
363                 }
364                 break;
365                 case YAKSA_TYPE__FLOAT:
366                 if (max_nesting_level >= 3) {
367                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_float;
368                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_float;
369                 }
370                 break;
371                 case YAKSA_TYPE__DOUBLE:
372                 if (max_nesting_level >= 3) {
373                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_double;
374                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_double;
375                 }
376                 break;
377                 case YAKSA_TYPE__LONG_DOUBLE:
378                 if (max_nesting_level >= 3) {
379                     cuda->pack = yaksuri_cudai_pack_resized_contig_resized_double;
380                     cuda->unpack = yaksuri_cudai_unpack_resized_contig_resized_double;
381                 }
382                 break;
383                 default:
384                     break;
385             }
386             break;
387             default:
388                 break;
389         }
390         break;
391         case YAKSI_TYPE_KIND__BUILTIN:
392         switch (type->u.resized.child->u.contig.child->u.builtin.handle) {
393             case YAKSA_TYPE___BOOL:
394             if (max_nesting_level >= 2) {
395                 cuda->pack = yaksuri_cudai_pack_resized_contig__Bool;
396                 cuda->unpack = yaksuri_cudai_unpack_resized_contig__Bool;
397             }
398             break;
399             case YAKSA_TYPE__CHAR:
400             if (max_nesting_level >= 2) {
401                 cuda->pack = yaksuri_cudai_pack_resized_contig_char;
402                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_char;
403             }
404             break;
405             case YAKSA_TYPE__WCHAR_T:
406             if (max_nesting_level >= 2) {
407                 cuda->pack = yaksuri_cudai_pack_resized_contig_wchar_t;
408                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_wchar_t;
409             }
410             break;
411             case YAKSA_TYPE__INT8_T:
412             if (max_nesting_level >= 2) {
413                 cuda->pack = yaksuri_cudai_pack_resized_contig_int8_t;
414                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_int8_t;
415             }
416             break;
417             case YAKSA_TYPE__INT16_T:
418             if (max_nesting_level >= 2) {
419                 cuda->pack = yaksuri_cudai_pack_resized_contig_int16_t;
420                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_int16_t;
421             }
422             break;
423             case YAKSA_TYPE__INT32_T:
424             if (max_nesting_level >= 2) {
425                 cuda->pack = yaksuri_cudai_pack_resized_contig_int32_t;
426                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_int32_t;
427             }
428             break;
429             case YAKSA_TYPE__INT64_T:
430             if (max_nesting_level >= 2) {
431                 cuda->pack = yaksuri_cudai_pack_resized_contig_int64_t;
432                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_int64_t;
433             }
434             break;
435             case YAKSA_TYPE__FLOAT:
436             if (max_nesting_level >= 2) {
437                 cuda->pack = yaksuri_cudai_pack_resized_contig_float;
438                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_float;
439             }
440             break;
441             case YAKSA_TYPE__DOUBLE:
442             if (max_nesting_level >= 2) {
443                 cuda->pack = yaksuri_cudai_pack_resized_contig_double;
444                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_double;
445             }
446             break;
447             case YAKSA_TYPE__LONG_DOUBLE:
448             if (max_nesting_level >= 2) {
449                 cuda->pack = yaksuri_cudai_pack_resized_contig_double;
450                 cuda->unpack = yaksuri_cudai_unpack_resized_contig_double;
451             }
452             break;
453             default:
454                 break;
455         }
456         break;
457         default:
458             break;
459     }
460 
461     return rc;
462 }
463