Load data on GPU, work on GPU and receive data from GPU. OPENGL or CUDA?

Hi all,
have a few questions. I wanna do a few time-critical calculations on a graphic card. My first problem is to load data on that GPU. After my calculations I have to load that data back. In addition, I have to decide if i want to do that in OpenGL or in CUDA. I work with C# and don’t know if I can work on CUDA with C#.

Would be fine if you could help me - with descriptions or/and codes.

Thank you,

I warmly suggest you read the awesome series in DrDobbs: http://www.ddj.com/cpp/207200659 . It’ll help you tons :)

As for using OpenGL or CUDA, without knowing what your calculations entail, I believe CUDA is probably your best bet. It’s made for non-graphics programming, whereas OpenGL isn’t.

Good luck!

It depend of what kind of calcul you have to do.

If you want to do time-critical calculation you can used CUDA.

If you want to use also Opengl it could be if you want to display each time (for exemple each frame) the result on screen

For exemple you load data on GPU, you perform calculation (also on GPU) and you can use opengl (or directX) to display directly the result (without data copy back).

for C# I think it possible but google it.

C#, really?

could be c#—> managed c —> CUDA ?

Anyways, seems you should use CUDA for your calculations. There are good CUDA/OpenGL interoperability options, see PG.

I can recommend the programming guide as a good starting ref…