错误一:
julia_gpu.cu(42): error: calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
julia_gpu.cu(47): error: calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
julia_gpu.cu(47): error: calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
解决办法:
这个原因是在原著中提供的代码有问题,原著中结构体中的代码为:
cuComplex(float a, float b) : r(a), i(b) {}
将其改为:
__device__ cuComplex(float a, float b) : r(a), i(b) {}
错误二:无法打开文件“glut32.lib”
把glut32.lib 以及glut64.lib拷贝到C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib
把glut32.dll以及glut64.dll拷贝到C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin