I’m trying to use function isnan from math.h but it is not recognized by pgcc. If I run this minimal example.c:
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#include <stdio.h>
#include <omp.h>
int main (int argc, char *argv[]) {
int sizeV = 10;
int range = 10;
double *restrict numbers = malloc(sizeof(double)*sizeV);
double *restrict results = malloc(sizeof(double)*sizeV);
srand(0);
for (int i=0;i < sizeV;i++) {
numbers[i] = (double) rand() * range / (double) RAND_MAX;
#pragma acc kernels
{
for (int i=0;i< sizeV;i++) {
results[i] = isnan(numbers[i]);
}
}
for (int i=0;i < sizeV;i++) {
printf("Results %f\n", results[i]);
}
exit(0);
}
And compile it using:
pgcc -lm -fast -ta=tesla:managed -Minfo=accel example.c -o Test
I get the following error:
26, Accelerator restriction: call to '__isnan' with no acc routine information
So I guess it is a bug, isn’t it? How can I solve it?