Skip to main content

cudaStreamDestroy

Function cudaStreamDestroy 

Source
pub unsafe extern "C" fn cudaStreamDestroy(
    stream: cudaStream_t,
) -> cudaError_t
Expand description

Destroys and cleans up an asynchronous stream.

Destroys and cleans up the asynchronous stream specified by stream.

In case the device is still doing work in the stream stream when cudaStreamDestroy is called, the function will return immediately and the resources associated with stream will be released automatically once the device has completed all work in 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.

Note: Use of the handle after this call is undefined behavior.

§Parameters

  • stream: Stream identifier

§Return value

See also: cudaStreamCreate, cudaStreamCreateWithFlags, cudaStreamQuery, cudaStreamWaitEvent, cudaStreamSynchronize, cudaStreamAddCallback, cuStreamDestroy.