Using CUDA math functions in a __global__ function - Nsight Eclipse Edition

后端 未结 1 925
遥遥无期
遥遥无期 2020-12-21 01:55

I am trying to use a math function (pow) in a __global__ function but I get this error :

 calling a __host__ function(\"std::pow \") fro         


        
相关标签:
1条回答
  • 2020-12-21 02:34

    You need to read the error message more carefully. The key piece of information is

    std::pow<float, double>
    

    Note: <float,double>. You have a call to pow with a double precision and a single precision argument. The CUDA math library is implemented by template overloading of selected standard library functions, but the arguments you have don't have a matching overload. Fix you code to have either all double precision or all single precision arguments, and the error will disappear.

    0 讨论(0)
提交回复
热议问题