Suppose I have a big program coding in C++, I know the main cost of this program is a big for loop, I want to compute the for loop on GPU, but don’t change other source files. How can I do it?
I use visual 2005 with CUDA integrated in. Is there anyway I can realize my goal? Or If I have to develop the whole project in CUDA and rewrite all the source file?
The answer is most likely “yes”.
However, you should have asked the question “How can the computation part of C++ project be transfered to CUDA code witout changing other part code in original project?” if you had wanted to know more. ;)
Only small changes to your main program may be required, for example a call into an external function that provides the same functionality as your for() loop, but based on CUDA. One relevant SDK sample is the cppintegration sample
Christian