32 int** int_offload_array) {
33 *offload_array = NULL;
34 *int_offload_array = NULL;
50 int** int_offload_array) {
52 free(*int_offload_array);
53 *offload_array = NULL;
54 *int_offload_array = NULL;
79 size_t pack_length,
int** int_offload_array,
80 int* int_pack_array,
size_t int_pack_length) {
83 if( pack_length > 0 ) {
85 real* new_array = (
real*) malloc(new_length *
sizeof(
real));
88 memcpy(new_array, *offload_array,
93 pack_length*
sizeof(
real));
97 *offload_array = new_array;
102 if( int_pack_length > 0 ) {
104 int* int_new_array = (
int*) malloc(int_new_length *
sizeof(
int));
107 memcpy(int_new_array, *int_offload_array,
112 int_pack_length*
sizeof(
int));
114 free(*int_offload_array);
116 *int_offload_array = int_new_array;
138 size_t pack_length,
int* int_offload_array,
139 size_t int_pack_length,
real** ptr,
int** intptr) {
Main header file for ASCOT5.
void offload_free_offload(offload_package *o, real **offload_array, int **int_offload_array)
Free offload array and set offload_package to clean state.
void offload_unpack(offload_package *o, real *offload_array, size_t pack_length, int *int_offload_array, size_t int_pack_length, real **ptr, int **intptr)
Unpack offload array from the package.
void offload_init_offload(offload_package *o, real **offload_array, int **int_offload_array)
Initialize offload package.
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)
Pack an offload array to package array.
Header file for offload.h.
Struct to keep track of the offload array length and unpack status.
size_t int_offload_array_length
size_t offload_array_length