PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

"array accessed with too many dimensions"

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
ashay



Joined: 15 Mar 2012
Posts: 3

PostPosted: Thu Mar 15, 2012 4:48 pm    Post subject: "array accessed with too many dimensions" Reply with quote

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:

Code:

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):

Code:

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!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6141
Location: The Portland Group Inc.

PostPosted: Fri Mar 16, 2012 10:49 am    Post subject: Reply with quote

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:
Quote:
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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group