cudaError_t cudaSetDevice ( int  device  ) 

Records device as the device on which the active host thread executes the device code. If the host thread has already initialized the CUDA runtime by calling non-device management runtime functions or if there exists a CUDA driver context active on the host thread, then this call returns cudaErrorSetOnActiveProcess.

Parameters:
device - Device on which the active host thread should execute the device code.
Returns:
cudaSuccess, cudaErrorInvalidDevice, cudaErrorSetOnActiveProcess
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaGetDeviceCount, cudaGetDevice, cudaGetDeviceProperties, cudaChooseDevice


Generated by Doxygen for NVIDIA CUDA Library  NVIDIA