Cuda devices

I am new to Cuda. How do I choose several devices? Say not just one but two or more all at the same time? I know that cudaSetDevice() allows you to pick one device. How about the command to pick two or more at the same time? Thanks.

You spawn separate (CPU) threads, and each thread picks its own device.

I’m really sorry. How do you do that?

With your preferred threading library on the CPU. Lots of people use pthreads or boost::thread, but these are hardly the only options.