How should I generate CUDA codes in Runtime ? maybe can't

Hi everyone, Now I want to dynamic generate CUDA codes in runtime, then some codes can be runed by GPU instead of CPU, if I use rapidmind or some libraries can do this very easily, so to imporve the performance I think I had better use CUDA directly.

Thanks! :geek: :magic:

Write the code to .cu or .ptx, nvcc or ptxas, then load and use the cubin using driver API. The compilation is really slow, though.

Thank you asadafag ! I will have a try !
I am a fresh guy on CUDA

You could dynamically generate shader programs and load them on the fly and communicate with them via texture memory.