I have a project with many source files (examples: main.cu, a.cu, b.cu, c.cu, d.cu). Each with functions and kernel calls (global and device).
In a header (cpu.h) all the structures to be used in the host side.
Another header (gpu.h) all the structures to be used in the device side.
-
If I call kernel functions from main.cu, declared in a.cu. How do I #include those kernel functions declared in a.cu to use in main.cu, without doing the not recommended #include “a.cu”?
-
Do I create a header a.h with forward declaration of the kernel function in a.cu? Example:
extern “C” void functionA(type);
Where can I find some examples?
I mention Nsight Eclipse because I am having lots of trouble with it and multiple sources.