how to communicate with Cg and CUDA? things like how to communicate with Cg and CUDA.

it is known that you can share things btwn OGL and CUDA. But some people claimed that you can exchange data between shading language (such as Cg) and CUDA.
I’m wondering whether it is the case or not?
Thank you!

I’ve never used Cg, but surely its like HLSL or GLSL, in that it doesn’t really stand alone and rather gets used by an application using a graphics API such as OGL or DX as a replacement for fixed function steps? In this case you just decide to use Cg as the shading language for your respective graphic API, and set it up accordingly. Then you can let CUDA write to the vertex buffers or whatever, set the vertices to come from that specific buffer. The Cg shader doesn’t know and doesn’t care where he gets the vertices from.

But this example is just based on my assumption that Cg’s usage is similar to that of GLSL and HLSL

Thank you very much! Does anyone can give me some example code fragment?