PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

"two data clauses for array" warning

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



Joined: 20 Jan 2011
Posts: 1

PostPosted: Fri Mar 23, 2012 10:24 am    Post subject: "two data clauses for array" warning Reply with quote

Hello,

I'm seeing lots of messages like the following:
Code:

PGC-W-0155-two data clauses for array d (blah.c: 140)
PGC-W-0155-Accelerator region ignored; see -Minfo messages  (blah.c: 140)

140, present(d) followed by present(d); present attribute ignored
Accelerator region ignored
142, Accelerator restriction: size of the GPU copy of 'd' is unknown


A common situation in the application looks similar to the following pseudo code:
Code:

// At this point, 'd' is already allocated and initialized one level up in the call stack (via a data region)

#pragma acc kernels present(d[0:n])
for (..) {
}

if (some_test) {
  #pragma acc kernels present(d[0:n])
  for (..) {
  }
}


I'm using the present clauses to tell the compiler the sizes of the arrays and to keep the arrays local to the device. The arrays have already been allocated and initialized via a data region one level up the call chain.

If I've interpreted the compiler messages correctly, it looks like the compiler is getting confused by the consecutive present clauses, then ignores the second present data clause (and associated array sizes), and then ignores the second accelerator region because it ignored the array sizes.

Any ideas?
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Mar 23, 2012 1:48 pm    Post subject: Reply with quote

Hi poznanov,

I looks like a know compiler issue that will be fixed in our 12.4. The work around is to put a data region with the present clause around the two compute regions.
Code:
// At this point, 'd' is already allocated and initialized one level up in the call stack (via a data region)

#pragma data present(d[0:n])
{
#pragma acc kernels
for (..) {
}

if (some_test) {
  #pragma acc kernels
  for (..) {
  }
}
}


Thanks,
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