variables from HOST code to DEVICE code

Dear all,

maybe the question is stupid but I read the documentation twice and I am not sure about this point.

Let’s assume that I open a ACC region and I parallelize a DO loop. Within this DO loop I access an array by using two indexes: X and Y. Y, the inner index just after the “!$acc do”, is distributed across parallel workers byt the runtime. X, index of an outer loop outside the ACC region, may vary between 1 and 3 (sometimes 5).

Do I have to specify in the ACC data region clause “copyin(X)”?

Hi fspiga,

Do I have to specify in the ACC data region clause “copyin(X)”?

Nope. The compiler will create a private variable for each thread and initialize it to the value of X, or pass in X as an argument to the kernel.

  • Mat