I have been looking for templated math function in cuda and I can't seem to find one. In normal c++ if I call std::sqrt it is templated and will execute a different version based on if the argument is a float or double.
I want something like this for CUDA device code. My kernels have the real type passed as a template parameter and right now I have to choose between using sqrtf for float and sqrt for double. I thought thrust might have this feature but it only does for complex numbers.