You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add explicit green context model: ctx.create_stream and ctx.resources
Switch from the v1.0 push model (dev.set_current + dev.create_stream)
to the v1.1 explicit model (ctx.create_stream + ctx.resources) as the
primary way to use green contexts.
Context.create_stream(options):
- Only supported on green contexts (raises on primary contexts).
- Delegates to Stream._init, which calls create_stream_handle in C++.
- C++ create_stream_handle auto-dispatches: checks get_context_green_ctx
and calls cuGreenCtxStreamCreate for green contexts, or
cuStreamCreateWithPriority for primary. Single function, no duplication.
Context.resources:
- Returns a DeviceResources namespace querying this context's resources
(cuCtxGetDevResource / cuGreenCtxGetDevResource), not the full device.
dev.set_current(green_ctx) still works but is not the recommended path.
Tests rewritten to use the explicit model throughout. Push-model
set_current kept as regression tests with _use_green_ctx helper.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments