forked from ascot4fusion/ascot5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
offload.h
38 lines (33 loc) · 1.56 KB
/
offload.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @file offload.h
* @brief Header file for offload.h
*/
#ifndef OFFLOAD_H
#define OFFLOAD_H
/**
* @brief Struct to keep track of the offload array length and unpack status.
*/
typedef struct {
size_t offload_array_length; /**< Total length of the common offload
array */
size_t unpack_pos; /**< Position of the beginning of the next
data pack that will be unpacked */
size_t int_offload_array_length; /**< Total length of the common int
offload array */
size_t int_unpack_pos; /**< Position of the beginning of the next
data pack that will be unpacked in int
array */
} offload_package;
void offload_init_offload(offload_package* o, real** pack_array,
int** int_array);
void offload_free_offload(offload_package* o, real** pack_array,
int** int_array);
void offload_pack(offload_package* o, real** offload_array, real* pack_array,
size_t pack_length, int** int_offload_array,
int* int_pack_array, size_t int_pack_length);
#pragma omp declare target
void offload_unpack(offload_package* o, real* pack_array,
size_t pack_length, int* int_offload_array,
size_t int_pack_length, real** ptr, int** intptr);
#pragma omp end declare target
#endif