Skip to main content

cudaStreamGetDevice

Function cudaStreamGetDevice 

Source
pub unsafe extern "C" fn cudaStreamGetDevice(
    hStream: cudaStream_t,
    device: *mut c_int,
) -> cudaError_t
Expand description

Query the device of a stream.

Returns in *device the device of the stream.

Note: This function uses standard default stream semantics.

Note that this function may also return error codes from previous, asynchronous launches.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • hStream: Handle to the stream to be queried.
  • device: Returns the device to which the stream belongs.

§Return value

See also: cudaSetDevice, cudaGetDevice, cudaStreamCreate, cudaStreamGetPriority, cudaStreamGetFlags, cuStreamGetId.