file A.cpp is compiled with g++ into A.cpp.o
file B.cu is compiled with nvcc into B.cu.o (B has no kernel functions)
Then the two output files are linked with g++ to produce an executable.
A.cpp defines a class and B.cu uses that class by including A.h. My problem is that during linking, g++ reports an “undefined reference” error on every line where B.cu uses the class defined in A.cpp.
Is it possible to do what I’m trying to do? Sorry if this is a terribly basic question, I’m brand new to CUDA.
Sorry, never mind, this seems to be the result of an unrelated bug (feature?) in g++. The functions I was trying to call are defined as inline, and g++ has problems linking against inline functions when they’re defined in the .cpp file.