+
    &j&                         ^ RI t R.t]tRt]! ] P                  R4      '       d   ] P                  P                  tRt ! R R]4      tR# )    NGreenContextF_CUDAGreenContextTc            	          a a ] tR t^t oRt]RRRRRRRR/V3R lR ll4       t]RV3R	 lR
 ll4       tV3R lV 3R lltV3R lV 3R llt	V3R lV 3R llt
RtVtV ;t# )r   zmWrapper around a CUDA green context.

.. warning::
   This API is in beta and may change in future releases.
num_smsNworkqueue_scopeworkqueue_concurrency_limit	device_idc          
      p   < V ^8  d   QhRS[ R,          RS[R,          RS[ R,          RS[ R,          RS[/# )   r   Nr   r   r	   return)intstr_GreenContext)format__classdict__s   "q/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/cuda/green_contexts.py__annotate__GreenContext.__annotate__   sM     "
 "
t"
 t"
 &)4Z	"

 :"
 
"
    c                b    \         '       g   \        R4      h\        P                  VV VVR7      # )a  Create a CUDA green context.

At least one of ``num_sms`` or ``workqueue_scope`` must be specified.
Both can be combined to partition SMs and configure workqueues in the
same green context.

Arguments:
    num_sms (int, optional): The number of SMs to use in the green
        context. When ``None``, SMs are not partitioned.
    workqueue_scope (str, optional): Workqueue sharing scope. One of
        ``"device_ctx"`` (shared across all contexts, default driver
        behaviour) or ``"balanced"`` (non-overlapping workqueues with
        other balanced green contexts). When ``None``, no workqueue
        configuration is applied.
    workqueue_concurrency_limit (int, optional): Maximum number of
        concurrent stream-ordered workloads for the workqueue. Requires
        ``workqueue_scope`` to be set.
    device_id (int, optional): The device index of green context.
        When ``None``, the current device is used.
1PyTorch was not built with Green Context support!)r	   r   r   r   )	SUPPORTEDRuntimeErrorr   create)r   r   r   r	   s   $$$$r   r   GreenContext.create   s9    8 yRSS##+(C	 $ 
 	
r   c                4   < V ^8  d   QhRS[ R,          RS[ /# )r   r	   Nr   )r   )r   r   s   "r   r   r   ?   s#     L LS4Z L3 Lr   c                \    \         '       g   \        R4      h\        P                  V R7      # )a?  Return the maximum workqueue concurrency limit for the device.

This queries the device for the default number of concurrent
stream-ordered workloads supported by workqueue configuration
resources.

Arguments:
    device_id (int, optional): The device index to query. When
        ``None``, the current device is used.
r   r	   )r   r   r   max_workqueue_concurrencyr   s   &r   r   &GreenContext.max_workqueue_concurrency>   s)     yRSS666KKr   c                   < V ^8  d   QhRR/# r   r   N )r   r   s   "r   r   r   P   s     % %T %r   c                    < \         SV `  4       # )z+Make the green context the current context.)superset_contextself	__class__s   &r   r&   GreenContext.set_contextP   s    w"$$r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   T   s     % %T %r   c                    < \         SV `  4       # )zsAssuming the green context is the current context, pop it from the
context stack and restore the previous context.
)r%   pop_contextr'   s   &r   r-   GreenContext.pop_contextT   s     w"$$r   c                   < V ^8  d   QhRR/# )r   r   ztorch.cuda.Streamr#   )r   r   s   "r   r   r   Z   s        +  r   c                    < \         SV `  4       # )z1Return the CUDA Stream used by the green context.)r%   Streamr'   s   &r   r1   GreenContext.StreamZ   s    w~r   r#   )N)__name__
__module____qualname____firstlineno____doc__staticmethodr   r   r&   r-   r1   __static_attributes____classdictcell____classcell__)r)   r   s   @@r   r   r      s      "
""
 '+"
 37	"

 !%"
 "
 "
H L L L"% %% %     r   )	torch__all__objectr   r   hasattr_Cr   r   r#   r   r   <module>rA      sT      	
588())HH..MI
J = J r   