Today, I try to understand device , host from “CUDA by example”
In chapter 4. Have you ever compile “Julia_gpu.cu” and be able to run ?
I got :
C:\cuda_by_example\chapter04>nvcc julia_gpu.cu
julia_gpu.cu
julia_gpu.cu(42): error: calling a host function("cuComplex::cuComplex") from a
__device__/__global__ function("julia") is not allowed
julia_gpu.cu(43): 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
4 errors detected in the compilation of "C:/Users/7-64/AppData/Local/Temp/tmpxft
_000010bc_00000000-6_julia_gpu.cpp1.ii".
C:\cuda_by_example\chapter04>
Looks like the operator overload function is not declared as device.
You can check the source file in which cuComplex is defined and add in the device keyword to the operator overload functions.