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 <string.h>
9 #include <stdint.h>
10 #include <wchar.h>
11 #include "yaksuri_seqi_pup.h"
12
yaksuri_seqi_pack_hindexed_double(const void * inbuf,void * outbuf,uintptr_t count,yaksi_type_s * type)13 int yaksuri_seqi_pack_hindexed_double(const void *inbuf, void *outbuf, uintptr_t count, yaksi_type_s * type)
14 {
15 int rc = YAKSA_SUCCESS;
16 const char *restrict sbuf = (const char *) inbuf;
17 char *restrict dbuf = (char *) outbuf;
18 uintptr_t extent ATTRIBUTE((unused)) = type->extent;
19
20 int count1 = type->u.hindexed.count;
21 int *restrict array_of_blocklengths1 = type->u.hindexed.array_of_blocklengths;
22 intptr_t *restrict array_of_displs1 = type->u.hindexed.array_of_displs;
23 uintptr_t extent1 ATTRIBUTE((unused)) = type->extent;
24
25 uintptr_t idx = 0;
26 for (int i = 0; i < count; i++) {
27 for (int j1 = 0; j1 < count1; j1++) {
28 for (int k1 = 0; k1 < array_of_blocklengths1[j1]; k1++) {
29 *((double *) (void *) (dbuf + idx)) = *((const double *) (const void *) (sbuf + i * extent + array_of_displs1[j1] + k1 * sizeof(double)));
30 idx += sizeof(double);
31 }
32 }
33 }
34
35 return rc;
36 }
37
yaksuri_seqi_unpack_hindexed_double(const void * inbuf,void * outbuf,uintptr_t count,yaksi_type_s * type)38 int yaksuri_seqi_unpack_hindexed_double(const void *inbuf, void *outbuf, uintptr_t count, yaksi_type_s * type)
39 {
40 int rc = YAKSA_SUCCESS;
41 const char *restrict sbuf = (const char *) inbuf;
42 char *restrict dbuf = (char *) outbuf;
43 uintptr_t extent ATTRIBUTE((unused)) = type->extent;
44
45 int count1 = type->u.hindexed.count;
46 int *restrict array_of_blocklengths1 = type->u.hindexed.array_of_blocklengths;
47 intptr_t *restrict array_of_displs1 = type->u.hindexed.array_of_displs;
48 uintptr_t extent1 ATTRIBUTE((unused)) = type->extent;
49
50 uintptr_t idx = 0;
51 for (int i = 0; i < count; i++) {
52 for (int j1 = 0; j1 < count1; j1++) {
53 for (int k1 = 0; k1 < array_of_blocklengths1[j1]; k1++) {
54 *((double *) (void *) (dbuf + i * extent + array_of_displs1[j1] + k1 * sizeof(double))) = *((const double *) (const void *) (sbuf + idx));
55 idx += sizeof(double);
56 }
57 }
58 }
59
60 return rc;
61 }
62
63