emulation mode thread switching


i am using CUDA in visual studio 2008 and running the code in emulation mode.
i have implemented needleman algorithm which is a dynamic programming algo. so i need to get data which is calculated by other threads.

so i started a while loop so a thread will remain in while until the desired location is calculated.but as soon as say thread 0,1 enters the while loop no switching is done and thus the location to be calculated by say 1,0 is not calculating for thread 0,1 to come out of the loop .

i have implement the same algorithm with same partitioning policy with openmp on multicore and it works alright.

please do help and provide suggestions.

Akhshay Gandhi

Sorry to criticize your English but I’m not so much understanding this. Please try to rewrite it if you can, thanks!

If you’re doing a while loop which is waiting on other threads, this is usually a bad idea. Instead, have the waiting thread recalculate the value required (incrementally checking if the other thread calculates it first). Alternately, try multiple kernel invocations. Unlike CPU code, where starting threads is expensive, it is relatively cheap with CUDA.