ó
    Eñiž  ã                   óŠ   • 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      $ )z­Create 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     ÚV/home/mande/repo/quber/.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¨ð 	8°Mô 	8ó ð	8÷%÷%ð ˜Ÿ™÷  õ  r   r   )r'   Úobjectr   r   ÚhasattrÚ_Cr   r   r   r   r   Ú<module>r-      sF   ðÛ ð €Ø€	á
ˆ5�8‰8Ð(×)Ñ)Ø—H‘H×.Ñ.€MØ€Iô
! �=õ ! r   