I’m trying to make a CUDA program that does not use the CPU except for initialisation, to avoid overhead between CPU and GPU. I’m an absolute beginner, so stick with me.
I’ve been looking at the particles example, and it confused me somewhat. For one, the particlesystem.h file said “// CUDA BodySystem: runs on the GPU”, referring to the class below it.
I thought it was impossible to use C++ (and hence classes) on device code. How is it possible that this class somehow runs on the gpu anyway?
When looking at the main display function, I notice it calls functions on this class, of which some are defined in the header file, and others in a cu file. But none of them are kernels. So does this mean the CPU does all the work? And who has all the data? CPU or GPU?
I’m really confused as my original intention was to make a particle system using VBO’s to store the position of the particles, and render them with openGL. Isn’t this the appropriate way of rendering particles while avoiding cpu/gpu overhead?
thx in advance