
    N j                         S SK r \rSr\" \ R
                  S5      (       a  \ R
                  R                  rSr " S S\5      rg)    NF_CUDAGreenContextTc                      ^  \ rS rSrSr\SS\S\S\4S jj5       rSU 4S jjr	SU 4S jjr
S\R                  4U 4S	 jjrS
rU =r$ )GreenContext   zmWrapper around a CUDA green context.

.. warning::
   This API is in beta and may change in future releases.
num_sms	device_idreturnc                 X    [         (       d  [        S5      e[        R                  X5      $ )zCreate a CUDA green context.

Arguments:
    num_sms (int): The number of SMs to use in the green context.
    device_id (int, optional): The device index of green context.
z1PyTorch was not built with Green Context support!)	SUPPORTEDRuntimeError_GreenContextcreate)r   r   s     j/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/torch/cuda/green_contexts.pyr   GreenContext.create   s&     yRSS##G77    c                     > [         TU ]  5       $ )z+Make the green context the current context.)superset_contextself	__class__s    r   r   GreenContext.set_context#   s    w"$$r   c                     > [         TU ]  5       $ )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_context'   s     w"$$r   c                     > [         TU ]  5       $ )z1Return the CUDA Stream used by the green context.)r   Streamr   s    r   r   GreenContext.Stream-   s    w~r    )r   )r	   N)__name__
__module____qualname____firstlineno____doc__staticmethodintr   r   r   r   torchr   __static_attributes____classcell__)r   s   @r   r   r      sP     	8 	8 	8M 	8 	8%%     r   r   )r'   objectr   r   hasattr_Cr   r   r   r   r   <module>r-      sF     	
588())HH..MI
! = ! r   