Fwd: [gomp4] Questions about "declare target" and "target update" pragmas

Ilya Verbin iverbin@gmail.com
Thu Jan 30 19:17:00 GMT 2014


One more question.  Is it valid to use arr[MAX/2..MAX] on target?

#define MAX 20
void foo ()
{
  int arr[MAX];
  #pragma omp target map(from: arr[0:MAX/2])
    {
      int i;
      for (i = 0; i < MAX; i++)
        arr[i] = i;
    }
}

In this case GOMP_target gets sizes[0]==40 as input.  Due to this,
gomp_map_vars allocates 40 bytes of memory on target for 'arr',
instead of 80 bytes.

  -- Ilya



More information about the Gcc mailing list