cuda::experimental::stf::register_stream#

inline decorated_stream cuda::experimental::stf::register_stream(
async_resources_handle &async_resources,
cudaStream_t user_stream,
)#

Registers a user-provided CUDA stream with asynchronous resources.

This optimization records a CUDA stream in the provided asynchronous resources handle, creating a decorated_stream object that encapsulates:

  • The original stream handle

  • A unique identifier for stream tracking

  • The associated device ID

Note

This registration is an optimization to avoid repeated stream metadata lookups in performance-critical code paths

Parameters:
  • async_resources[inout] Handle to asynchronous resources manager

  • user_stream[in] Raw CUDA stream to register. Must be a valid stream.

Returns:

decorated_stream Object containing:

  • Original stream handle

  • Unique ID from async_resources

  • Device ID associated with the stream

Pre:

user_stream must be a valid CUDA stream created with cudaStreamCreate or equivalent