std::isnan is problematic for some NVCC versions
Problem description
In FieldComparisons.h, we check for NaN in equality comparison. Nathan wanted this for better behavior.
However, it appears that some versions of NVCC do not support this. Notably, prism fails to compile ExprLib when CUDA builds are active.
Machine | nvcc Version | Comments |
---|---|---|
prism | 6.0.1 | fails to compile std::isnan |
aurora | 6.5.12 | compiles without problem |
Sample compiler error
Here is a sample compiler error (from building ExprLib on prism):
/scratch/local/prism_fast/jcs/ExprLib/buildCuda/so/include/spatialops/structured/FieldComparisons.h(156): error: expected an identifier
detected during instantiation of "__nv_bool SpatialOps::field_equal(const FieldT &, const FieldT &, double) [with FieldT=FieldT]"
/scratch/local/prism_fast/jcs/ExprLib/buildCuda/test/FieldMgr/main.cpp.cu(40): here
Possible workaround
One possible solution is to pull in the NVCC compiler version when compiling SpatialOps and then only performing the isnan
checks if the compiler version is high enough.