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_contig_int32_t(const void * inbuf,void * outbuf,uintptr_t count,yaksi_type_s * type)13 int yaksuri_seqi_pack_contig_int32_t(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.contig.count;
21 intptr_t stride1 = type->u.contig.child->extent;
22 uintptr_t extent1 ATTRIBUTE((unused)) = type->extent;
23
24 uintptr_t idx = 0;
25 for (int i = 0; i < count; i++) {
26 for (int j1 = 0; j1 < count1; j1++) {
27 *((int32_t *) (void *) (dbuf + idx)) = *((const int32_t *) (const void *) (sbuf + i * extent + j1 * stride1));
28 idx += sizeof(int32_t);
29 }
30 }
31
32 return rc;
33 }
34
yaksuri_seqi_unpack_contig_int32_t(const void * inbuf,void * outbuf,uintptr_t count,yaksi_type_s * type)35 int yaksuri_seqi_unpack_contig_int32_t(const void *inbuf, void *outbuf, uintptr_t count, yaksi_type_s * type)
36 {
37 int rc = YAKSA_SUCCESS;
38 const char *restrict sbuf = (const char *) inbuf;
39 char *restrict dbuf = (char *) outbuf;
40 uintptr_t extent ATTRIBUTE((unused)) = type->extent;
41
42 int count1 = type->u.contig.count;
43 intptr_t stride1 = type->u.contig.child->extent;
44 uintptr_t extent1 ATTRIBUTE((unused)) = type->extent;
45
46 uintptr_t idx = 0;
47 for (int i = 0; i < count; i++) {
48 for (int j1 = 0; j1 < count1; j1++) {
49 *((int32_t *) (void *) (dbuf + i * extent + j1 * stride1)) = *((const int32_t *) (const void *) (sbuf + idx));
50 idx += sizeof(int32_t);
51 }
52 }
53
54 return rc;
55 }
56
57