isnan not working in openacc cpp code

I’m using pgcc 17.4 version which is said to have support for isnan() function, but I’m getting the following error when I compile it :

Command:
pgcc -acc -fast -ta=tesla:nordc -Mlarge_arrays -c solar_feature_generator.c -O2 -fPIC

Error:
PGC-S-1000-Call in OpenACC region to procedure ‘__isnan’ which has no acc routine information (solar_feature_generator.c: 13)
PGC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages) (solar_feature_generator.c: 13)
PGC/x86-64 Linux 17.4-0: compilation completed with severe errors



PGCC Version:

pgcc 17.4-0 64-bit target on x86-64 Linux -tp haswell
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.

Hi Sunitha B,

Try including the “accelmath.h” header file. This header has the device definition for isnan.

#ifdef _OPENACC
#include <accelmath.h>
#endif

Hope this helps,
Mat