CUDA C
分配内存
cudaMalloc((void**)&dev_c,sizeof(int));
释放内存
cudaFree(dev_c);
在设备代码中使用设备指针以及调用
cudaMemcpy( &c, dev_c, sizeof(int), cudaMemcpyDeviceToHost);
查询设备
cudaGetDeviceCount(&count);
查询设备属性
cudaGetDeviceProperties(&prop.i);
在运行julia程序时提示报错
julia_gpu.cu(42): error: calling a __host__ function("cuComplex::cuComplex") from a __device__ function("julia") is not allowed
julia_gpu.cu(43): error: calling a __host__ function("cuComplex::cuComplex") from a __device__ function("julia") is not allowed
julia_gpu.cu(47): error: calling a __host__ function("cuComplex::cuComplex") from a __device__ function("julia") is not allowed
julia_gpu.cu(47): error: calling a __host__ function("cuComplex::cuComplex") from a __device__ function("julia") is not allowed
4 errors detected in the compilation of "/tmp/tmpxft_00003288_00000000-6_julia_gpu.cpp1.ii".