在学习CUDA时,遇到的第一个绘图的程序就是Julia set , 参考书本的代码难免会遇到问题,在一番查找和排错之后,可以得到完美的图片。
问题1: 无法打开#include "./common/book.h"
#include "./common/cpu_bitmap.h"
解决方案: 由于自己配置CUDA的时候,没有安装对应的库文件,造成此类问题,所以需要下载相应的库文件并放到CUDA的安装目录下,下载路径 http://pan.baidu.com/s/1gfC3zV1, 打开common 压缩包,将里面的所有数据copy到 你的CUDA安装的目录下C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include, 这样就能打开库函数了。
问题2:
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("julia") is not allowed
calling a host function("cuComplex::cuComplex") from a __device__/__global__ function("cuComplex::operator *") is not allowed