Function rcudnn_sys::cudaSetValidDevices[][src]

pub unsafe extern "C" fn cudaSetValidDevices(
    device_arr: *mut c_int,
    len: c_int
) -> cudaError_t
Expand description

\brief Set a list of devices that can be used for CUDA

Sets a list of devices for CUDA execution in priority order using \p device_arr. The parameter \p len specifies the number of elements in the list. CUDA will try devices from the list sequentially until it finds one that works. If this function is not called, or if it is called with a \p len of 0, then CUDA will go back to its default behavior of trying devices sequentially from a default list containing all of the available CUDA devices in the system. If a specified device ID in the list does not exist, this function will return ::cudaErrorInvalidDevice. If \p len is not 0 and \p device_arr is NULL or if \p len exceeds the number of devices in the system, then ::cudaErrorInvalidValue is returned.

\param device_arr - List of devices to try \param len - Number of devices in specified list

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorInvalidDevice \notefnerr \note_init_rt \note_callback

\sa ::cudaGetDeviceCount, ::cudaSetDevice, ::cudaGetDeviceProperties, ::cudaSetDeviceFlags, ::cudaChooseDevice