"array accessed with too many dimensions"

I am trying to compile the MILC code [http://physics.indiana.edu/~sg/milc.html] using OpenACC directives. The code under consideration is a for loop such that each of its iterations are independent and hence they can be executed in parallel. Inserting the OpenACC directive: “#pragma acc for vector” produces the following errors:

PGC-W-0155-Accelerator region ignored; see -Minfo messages  (sample.c: 12)
scalar_mult_add_lathwvec_proj:
     12, Accelerator region ignored
     13, Accelerator restriction: : array accessed with too many dimensions, possibly due to inlining: *(f).h.c.imag
         Accelerator restriction: : array accessed with too many dimensions, possibly due to inlining: *(b).h.c.real
         Accelerator restriction: array accessed with too many dimensions, possibly due to inlining
PGC/x86-64 Linux 12.3-0: compilation completed with warnings

The error can be replicated using the following code (which is just a minified version of the original function body):

typedef struct { float real; float imag; } cplex;
typedef struct { cplex c[3]; } fsu3_vector;
typedef struct { fsu3_vector h[2]; } vec;

void scalar_mult_add_lathwvec_proj(vec *back, vec *forw)
{
  int i;
  vec *b, *f;
  double tmp=0;

  #pragma acc region for vector
void scalar_mult_add_lathwvec_proj(vec *back, vec *forw)
{
  int i;
  vec *b, *f;
  double tmp=0;

  #pragma acc region for vector
  for(i = 0; i<1024; i++, b++, f++)
  {
    b=back+i;
    f=forw+i;

    tmp += b->h[0].c[0].real * f->h[0].c[0].imag;
  }
}

I am using PGI 12.3-2 on RHEL5 (2.6.18) and the code is compiled using the following command line:
pgcc -c -O3 -g -Minfo -ta=nvidia sample.c

Any help is appreciated! Thanks!

Hi Ashay,

Unfortunately only structs with fundamental data types as members are currently allowed with accelerator regions.

From the Limitations section of the PGI Accelerator Programming Guide:

Loops that compute on structs can be offloaded, but those that operate on nested structs cannot. This is a limitation of the current release of the compiler, not a limitation of the programming model.

Sorry,
Mat