Issues with std::pow in Nebo for GPU
Dav de St. Germain (dav@sci.utah.edu) reported this issue when building Wasatch.
Description
It appears that in include/spatialops/NeboOperators.h
there are 4 (ish) locations where pow()
is used with an integer as the 2nd argument.
I believe that NVCC will replace the std::pow(double, double)
with its own version (device version), but it will not do the same with pow( double, int )
.
Current workaround
The work-around I am currently using is to cast the 2nd argument of the pow()
calls in NeboOperators.h
to double
s. I believe that this makes the pow call "much slower" (then raising to an integer power). What I don't know is how this issues should be fixed (or who is the CUDA expert that could do so), or where to fix it. Also, it is possible that the pow()
is not called very often which means that fixing may not even really be necessary.
Post-commit action
The wasatch3p build script currently hacks NeboOperators.h
to get it compiling with CUDA on newer architectures (e.g., Titan). We should remove that once this issue is completed.