I am new to Cuda, I have the following function:
__global__ void square(float *myArrayGPU)
{
myArrayGPU[threadIdx.x] = sqrt(threadIdx.x);
}
I want to use the cuda math library, I tried to #include "math.h"
but I still get the error
error: calling a __host__ function("__sqrt") from a __global__ function("square") is not allowed
Any idea what library should I include to use the sqrt
?