PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Getting rid of " size of the GPU copy of an array depe
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
luiceur



Joined: 17 Apr 2011
Posts: 12

PostPosted: Wed Jul 27, 2011 1:57 am    Post subject: Getting rid of " size of the GPU copy of an array depe Reply with quote

I think I have a straight forward parallel loop, however the compiler keeps telling me :

Accelerator region ignored
48, Accelerator restriction: size of the GPU copy of an array depends on values computed in this loop
49, Accelerator restriction: size of the GPU copy of 'myVar' is unknown
Accelerator restriction: loop contains unsupported statement type
Accelerator restriction: one or more arrays have unknown size
61, Accelerator restriction: unsupported statement type

where myVar is an array used for calculation.
#pragma acc region copyin (bepB[0:MAX-1], mVar[0:MAX-1], Beam[0:MAX-1]) \
copyout (dose[0:MAX-1])
for ( in = 0; in < total; in++){
current = 0;
ptr=0;

for (int i = 0; i < Nb; i++){
for (int j = 0; j < bepB[i]; j++){

current = j+ptr;
calculate(dose, mVar[in], Beam[current] );
}
}
}

Arrays are global but I don't think that might cause a problem. What am I doing wrong? Why the compiler can not see the size of myVar even if I've declared them with *rectrict?
Pleaee, any help would be much appreciated.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jul 27, 2011 8:20 am    Post subject: Reply with quote

Hi luiceur,

The basic problem here is that by default the compiler will try to accelerate your inner loops. It's failing since the j loop bounds is not known and Beam's index is calculated. I'm not sure why it's complaining about mVar, but the "unsupported statement type" is most likely pointer arithmetic.

What I'd try doing is have the compiler just accelerate the "in" loop. Something like:
Code:
#pragma acc region copyin (bepB[0:MAX-1], mVar[0:MAX-1], Beam[0:MAX-1]) \
copyout (dose[0:MAX-1])
{
#pragma acc for kernel independent
for ( in = 0; in < total; in++){
...

Though, it's difficult to tell exactly what's going on with just a code snipit. If this doesn't work, if you could post a complete example I would appreciate it.

- Mat
Back to top
View user's profile
luiceur



Joined: 17 Apr 2011
Posts: 12

PostPosted: Wed Jul 27, 2011 8:59 am    Post subject: Getting rid of " size of the GPU copy of an array depe Reply with quote

No I am getting:

36, Accelerator region ignored
45, Accelerator restriction: invalid loop
48, Accelerator restriction: invalid loop


Here is the complete parallel region:

Code:
#pragma acc region copyin (beamletOffAngleArray[0:Nbeamlets-1], \
pSource[0:params.Nbeams-1], pBody[0:TotVoxel-1], \
beamletsPerBeam[0:params.Nbeams-1], pBeamlet[0:Nbeamlets-1],\
inputPointsArray[0:Nbeamlets-1], beamletFluence[0:Nbeamlets-1], \
accumulateDepth1D[0:fSize-1], accumulate_n_DepthArray[0:Nbeamlets-1], \
inputFittingParams[0:params.NPar_depth-1], inputA[0: Asize-1],\
structure[0:TotVoxel-1] ) copyout(dose[0:TotVoxel-1])   
    {
#pragma acc for kernel independent private (currentBeamlet)
        for ( ivoxel = 0; ivoxel < TotVoxel; ivoxel++){
            currentBeamlet = 0;
            ptr=0;
            for (int i = 0; i < params.Nbeams; i++) {
                for (int j = 0; j <beamletsPerBeam; j++){

                    currentBeamlet = j+ptr;                             
 
                    if(dis_p_foot <= thres) {

                          dose[ivoxel] =dose[ivoxel] + calculation;

                    }//if(dis_p_foot <= thres)

                }// end of for j

                ptr = ptr + beamletsPerBeam[i];

            } //end of for i
           
        }//end of for ivoxels
       
    }//end of #pragma region



Why am I getting those errors?
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jul 27, 2011 1:06 pm    Post subject: Reply with quote

I'm not sure. Can you please either post or send to a trs@pgroup.com a complete example?

Thanks,
Mat
Back to top
View user's profile
luiceur



Joined: 17 Apr 2011
Posts: 12

PostPosted: Wed Jul 27, 2011 1:38 pm    Post subject: Getting rid of " size of the GPU copy of an array depe Reply with quote

Done! I have found quite a lot of internal errors compiling with the latest version.
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
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
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