Newbie question: Devices Whether a thread can switch devices

Suppose a host thread calls [font=“Courier”]cudaSetDevice[/font] and does some processing. Later it frees all the resources that have been allocated. Can it then call [font=“Courier”]cudaSetDevice[/font] again, with a different device index, and start to use the new device?

Thanks.

No, you can’t switch devices in a single host thread

I’m not sure this is true with the new thread migration API, but I haven’t investigated thoroughly.