cudaSetDevice() is speific to the CPU “THREAD” that executes it.
And, note that For a given thread, Only 1 cudaSetDevice() is required. Subsequent calls do NOT have any effect.
If u do a “cudaMalloc” or any RT API calls (Except getDevCount or getProperties) , the RT call will automatically setDevice to default device… and subsequent calls to cudaSetDevie from your application wont b effective. (i.e. essentially a screwed up state :-) ) So, the best thing would be to do a “cudaSetDevice” and then call those RT calls (so that their cudaSetDevices if at all they do – will have no effect)
Bye, Gooooooooood Luck!