acc routine, unsupported NUKMOD operation

I’d like to compile the following function using the acc “routine” directive:

#pragma acc routine seq
double rn(unsigned long * seed)
{ 
  double ret;
  unsigned long n1;
  unsigned long a = 16807;
  unsigned long m = 2147483647;
  n1 = ( a * (*seed) ) % m;
  *seed = n1;
  ret = (double) n1 / m;
  return ret;
}

However, I get the following error:
17, Accelerator restriction: unsupported operation: NUKMOD

Line 17 is the statement

n1 = ( a * (*seed) ) % m;

.

What is the NUKMOD operation? And in this case, what are some alternatives?

Hi Ron,

“NUKMOD” is the mod operation for the unsigned long. Looks like we missed this case. I’ve added TPR#21000 to see if we can add it.

The work around would be to use “long” or “unsigned int” instead of “unsigned long”.

Thanks,
Mat

TPR 21000 - OpenACC: Using “usigned long” varaible in a MOD op gives “unsupported operation: NUKMOD”

has been corrected in the current 15.9 release.

dave