1- # This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_context.pyx
2-
3- from __future__ import annotations
1+ # This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_context.pyx
42
53from collections .abc import Sequence
64from dataclasses import dataclass
@@ -10,32 +8,24 @@ from cuda.core._device_resources import (DeviceResources, SMResource,
108 WorkqueueResource )
119from cuda .core ._stream import Stream
1210
11+ __all__ = ['Context' , 'ContextOptions' ]
12+ DeviceResourcesType = Sequence [SMResource | WorkqueueResource ]
1313
1414class Context :
1515 """CUDA context wrapper.
1616
1717 Context objects represent CUDA contexts and cannot be instantiated directly.
1818 Use Device or Stream APIs to obtain context objects.
1919 """
20-
21- def close (self ):
22- """Release this context wrapper's underlying CUDA handles."""
23-
24- def __init__ (self , * args , ** kwargs ) -> None :
25- ...
26-
20+ def __init__ (self , * args , ** kwargs ) -> None : ...
2721 @property
2822 def handle (self ) -> cuda .bindings .driver .CUcontext | None :
2923 """Return the underlying CUcontext handle."""
30-
3124 @property
32- def _handle (self ) -> cuda .bindings .driver .CUcontext | None :
33- ...
34-
25+ def _handle (self ) -> cuda .bindings .driver .CUcontext | None : ...
3526 @property
3627 def is_green (self ) -> bool :
3728 """True if this context was created from device resources."""
38-
3929 @property
4030 def resources (self ) -> DeviceResources :
4131 """Query the hardware resources provisioned for this context.
@@ -46,8 +36,7 @@ class Context:
4636
4737 Raises :class:`RuntimeError` if the context has been closed.
4838 """
49-
50- def create_stream (self , options : object = None ) -> Stream :
39+ def create_stream (self , options : object | None = None ) -> Stream :
5140 """Create a new stream bound to this green context.
5241
5342 This method is only available on green contexts. For primary
@@ -63,15 +52,11 @@ class Context:
6352 :obj:`~_stream.Stream`
6453 Newly created stream object.
6554 """
66-
67- def __eq__ (self , other : object ) -> bool :
68- ...
69-
70- def __hash__ (self ) -> int :
71- ...
72-
73- def __repr__ (self ) -> str :
74- ...
55+ def close (self ):
56+ """Release this context wrapper's underlying CUDA handles."""
57+ def __eq__ (self , other : object ) -> bool : ...
58+ def __hash__ (self ) -> int : ...
59+ def __repr__ (self ) -> str : ...
7560
7661@dataclass
7762class ContextOptions :
@@ -83,5 +68,3 @@ class ContextOptions:
8368 Device resources used to create a green context.
8469 """
8570 resources : DeviceResourcesType
86- __all__ = ['Context' , 'ContextOptions' ]
87- DeviceResourcesType = Sequence [SMResource | WorkqueueResource ]
0 commit comments