GPUOcelot
Functions

Stream Management

CUDA Driver API
Collaboration diagram for Stream Management:

Functions

CUresult CUDAAPI cuStreamCreate (CUstream *phStream, unsigned int Flags)
 Create a stream.
CUresult CUDAAPI cuStreamWaitEvent (CUstream hStream, CUevent hEvent, unsigned int Flags)
 Make a compute stream wait on an event.
CUresult CUDAAPI cuStreamQuery (CUstream hStream)
 Determine status of a compute stream.
CUresult CUDAAPI cuStreamSynchronize (CUstream hStream)
 Wait until a stream's tasks are completed.
CUresult CUDAAPI cuStreamDestroy (CUstream hStream)
 Destroys a stream.

Detailed Description

This section describes the stream management functions of the low-level CUDA driver application programming interface.


Function Documentation

CUresult CUDAAPI cuStreamCreate ( CUstream phStream,
unsigned int  Flags 
)

Create a stream.

Creates a stream and returns a handle in phStream. Flags is required to be 0.

Parameters:
phStream- Returned newly created stream
Flags- Parameters for stream creation (must be 0)
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY
See also:
cuStreamDestroy, cuStreamWaitEvent, cuStreamQuery, cuStreamSynchronize
CUresult CUDAAPI cuStreamDestroy ( CUstream  hStream)

Destroys a stream.

Destroys the stream specified by hStream.

Parameters:
hStream- Stream to destroy
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE
See also:
cuStreamCreate, cuStreamWaitEvent, cuStreamQuery, cuStreamSynchronize
CUresult CUDAAPI cuStreamQuery ( CUstream  hStream)

Determine status of a compute stream.

Returns CUDA_SUCCESS if all operations in the stream specified by hStream have completed, or CUDA_ERROR_NOT_READY if not.

Parameters:
hStream- Stream to query status of
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE, CUDA_ERROR_NOT_READY
See also:
cuStreamCreate, cuStreamWaitEvent, cuStreamDestroy, cuStreamSynchronize
CUresult CUDAAPI cuStreamSynchronize ( CUstream  hStream)

Wait until a stream's tasks are completed.

Waits until the device has completed all operations in the stream specified by hStream. If the context was created with the CU_CTX_BLOCKING_SYNC flag, the CPU thread will block until the stream is finished with all of its tasks.

Parameters:
hStream- Stream to wait for
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE
See also:
cuStreamCreate, cuStreamDestroy, cuStreamWaitEvent, cuStreamQuery
CUresult CUDAAPI cuStreamWaitEvent ( CUstream  hStream,
CUevent  hEvent,
unsigned int  Flags 
)

Make a compute stream wait on an event.

Makes all future work submitted to hStream wait until hEvent reports completion before beginning execution. This synchronization will be performed efficiently on the device.

The stream hStream will wait only for the completion of the most recent host call to cuEventRecord() on hEvent. Once this call has returned, any functions (including cuEventRecord() and cuEventDestroy()) may be called on hEvent again, and the subsequent calls will not have any effect on hStream.

If hStream is 0 (the NULL stream) any future work submitted in any stream will wait for hEvent to complete before beginning execution. This effectively creates a barrier for all future work submitted to the context.

If cuEventRecord() has not been called on hEvent, this call acts as if the record has already completed, and so is a functional no-op.

Parameters:
hStream- Stream to wait
hEvent- Event to wait on (may not be NULL)
Flags- Parameters for the operation (must be 0)
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE,
See also:
cuStreamCreate, cuEventRecord, cuStreamQuery, cuStreamSynchronize, cuStreamDestroy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines