I’m currently implementing a parallel raytracer. I’ve implemented the serial code and it works fine. To make my life easier I’m using the following macro on all my classes (Vector class, Camera class, and so on):
#ifdef __CUDACC__ #define CUDA_HOSTDEV __host__ __device__ #else #define CUDA_HOSTDEV #endif
For certain classes(in this case Vector class and Matrix class), i can create objects of that class in my device code. However for other classes(camera , ray and so on), I get the following error:
nvlink error : Undefined reference to '_ZNK4_4626Camera16get_aspect_ratioEv'
I’m not sure why this is happening and I don’t know even know where to start debugging. I first looked at my CMakeLists.txt which seems to be correct since the serial version works.