PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Character limit on directives?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
BeachHut



Joined: 14 Mar 2010
Posts: 11

PostPosted: Fri Mar 26, 2010 7:25 pm    Post subject: Character limit on directives? Reply with quote

There appears to be a limit of about 200 characters on the length of compiler directives. Going over this limit produces the error messages:

Quote:
Syntax error: Recovery attempted by deleting <nl>
Syntax error: Recovery attempted by inserting <nl> before '{'


Is there a way to get around this? I have a lot of variables to specify in a data region directive. Splitting over multiple lines using a backslash doesn't seem to have any effect.

Thanks
Back to top
View user's profile
BeachHut



Joined: 14 Mar 2010
Posts: 11

PostPosted: Sun Mar 28, 2010 10:37 am    Post subject: Reply with quote

Here's what I want:

Code:
#pragma acc data region local(z[flox:fhix][floy:fhiy], d[flox:fhix][floy:fhiy], q[flox:fhix][floy:fhiy], r[flox:fhix][floy:fhiy]), copy(x[flox:fhix][floy:fhiy]), copyin(b[flox:fhix][floy:fhiy], aW[flox:fhix][floy:fhiy], aS[flox:fhix][floy:fhiy], pC[flox:fhix][floy:fhiy], pS[flox:fhix][floy:fhiy], pW[flox:fhix][floy:fhiy])
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 29, 2010 4:40 pm    Post subject: Reply with quote

Hi BeachHut,

I think something else is wrong since you should be able to go well beyond 200 characters. Can you post a small example or send on to PGI Customer Service (trs@pgroup.com)?

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



Joined: 14 Mar 2010
Posts: 11

PostPosted: Mon Mar 29, 2010 5:37 pm    Post subject: Reply with quote

Hi Mat,

Looking at it again I see that it would actually be significantly longer than 200 characters since flox, fhix, etc. are replaced by quite long expressions by the pre-processor. I'd still like to know if there is a way around this without altering my code so that the replaced expressions are shorter (which I admit wouldn't be difficult to do).

Here is a minimal code for demonstration:
Compile with -DLONG to generate the error.

Code:

/* Minimal example of compiler directive length problem */

#define ARRAYSTART 0

#define sx 128
#define sy 128
#define OLx 1
#define OLy 1

#define lox (ARRAYSTART + OLx)
#define hix (lox + sx - 1)
#define loy (ARRAYSTART + OLy)
#define hiy (loy + sy - 1)


#ifdef LONG

#define flox (lox - OLx)
#define fhix (hix + OLx)
#define floy (loy - OLy)
#define fhiy (hiy + OLy)

#else

#define flox 0
#define fhix 100
#define floy 0
#define fhiy 100

#endif


int
main (void)
{

  int i, j;
  double z[fhix][fhiy];
  double d[fhix][fhiy];
  double q[fhix][fhiy];
  double r[fhix][fhiy];
  double x[fhix][fhiy];
  double b[fhix][fhiy];
  double aW[fhix][fhiy];
  double aS[fhix][fhiy];
  double pC[fhix][fhiy];
  double pS[fhix][fhiy];
  double pW[fhix][fhiy];

  for (i = flox; i < fhix; i++)
    {
      for (j = floy; j < fhiy; j++)
   {
     x[i][j] = 1.0;
     b[i][j] = 1.0;
     aW[i][j] = 1.0;
     aS[i][j] = 1.0;
     pC[i][j] = 1.0;
     pS[i][j] = 1.0;
     pW[i][j] = 1.0;
   }
    }

#pragma acc data region local(z[flox:fhix][floy:fhiy], d[flox:fhix][floy:fhiy], q[flox:fhix][floy:fhiy], r[flox:fhix][floy:fhiy]), copy(x[flox:fhix][floy:fhiy]), copyin(b[flox:fhix][floy:fhiy], aW[flox:fhix][floy:fhiy], aS[flox:fhix][floy:fhiy], pC[flox:fhix][floy:fhiy], pS[flox:fhix][floy:fhiy], pW[flox:fhix][floy:fhiy])
  {

#pragma acc region
    {

      for (i = flox; i < fhix; i++)
   {
     for (j = floy; j < fhiy; j++)
       {

         z[i][j] = 1.0;
         d[i][j] = 1.0;
         q[i][j] = 1.0;
         r[i][j] = 1.0;

         x[i][j] = z[i][j] + d[i][j] + q[i][j] + r[i][j]
      + x[i][j]
      + b[i][j] + aW[i][j] + aS[i][j]
      + pC[i][j] + pS[i][j] + pW[i][j];
       }
   }

    }

  }


  for (i = flox; i < fhix; i++)
    {
      for (j = floy; j < fhiy; j++)
   {
     printf ("%f ", x[i][j]);
   }
      printf ("\n");
    }

}
Back to top
View user's profile
BeachHut



Joined: 14 Mar 2010
Posts: 11

PostPosted: Mon Mar 29, 2010 5:47 pm    Post subject: Reply with quote

Ha, I implemented a quick fix for the above problem (just created new const ints that were equal to the macro values flox, etc.) but now I get another error:
Quote:
Source file too large to compile at this optimization level


It's just a plain Conjugate Gradient code and the file in question only has 286 lines... Surely this shouldn't be pushing the boundaries?
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  Next
Page 1 of 3

 
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