How to transfer structure for unloading in Xeon Phi

I have struct Awith several members intand one int *. How can I use this when unloading?

I probably can't do it #pragma offload target(mic: 0) inout(A){}... but what about

#pragma offload target(mic: 0) in(A->firstInt, A->secondInt) inout(A->intPointer:length(A->firstInt*A->secondInt)){}

but when I tried this, I got error: invalid entity for this variable list in offload clausea response when compiling

+4
source share
1 answer

, . , , . -, A . , .

struct S {
   int firstInt;
   int secondInt;
   int *intPointer;
};

, A , .

int first = A.firstInt;
int second = A.secondInt;
int *pointer = A.intPointer;

.

#pragma offload target(mic: 0) in(first, second) 
                               inout(pointer:length(first*second))
{
   /* Use individual variables here. */
}

, pointer.

. ( ) .

#pragma offload target(mic: 0) in(A) inout(pointer:length(A.first*A.second))
+1

Source: https://habr.com/ru/post/1619246/


All Articles