Ë
    Q/æj“  ã                   ó    — d dl Z  G d„ d«      Zy)é    Nc                   ó<   — e Zd ZdZd
d„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)ÚEventaA  Wrapper around an MPS event.

    MPS events are synchronization markers that can be used to monitor the
    device's progress, to accurately measure timing, and to synchronize MPS streams.

    Args:
        enable_timing (bool, optional): indicates if the event should measure time
            (default: ``False``)
    c                 óL   — t         j                  j                  |«      | _        y )N)ÚtorchÚ_CÚ_mps_acquireEventÚ_Event__eventId)ÚselfÚenable_timings     úR/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/torch/mps/event.pyÚ__init__zEvent.__init__   s   € ÜŸ™×3Ñ3°MÓBˆ�ó    c                 ó¬   — t        t        j                  d«      r:| j                  dkD  r*t        j                  j	                  | j                  «       y y y )NÚ_mps_releaseEventr   )Úhasattrr   r   r	   r   ©r
   s    r   Ú__del__zEvent.__del__   s;   € ä”5—8‘8Ð0Ô1°d·n±nÀqÒ6HÜ�H‰H×&Ñ& t§~¡~Õ6ð 7IÐ1r   c                 óV   — t         j                  j                  | j                  «       y)z(Records the event in the default stream.N)r   r   Ú_mps_recordEventr	   r   s    r   ÚrecordzEvent.record   s   € ä�‰×!Ñ! $§.¡.Õ1r   c                 óV   — t         j                  j                  | j                  «       y)zJMakes all future work submitted to the default stream wait for this event.N)r   r   Ú_mps_waitForEventr	   r   s    r   Úwaitz
Event.wait   s   € ä�‰×"Ñ" 4§>¡>Õ2r   c                 óT   — t         j                  j                  | j                  «      S )zCReturns True if all work currently captured by event has completed.)r   r   Ú_mps_queryEventr	   r   s    r   ÚqueryzEvent.query    s   € ä�x‰x×'Ñ'¨¯©Ó7Ð7r   c                 óV   — t         j                  j                  | j                  «       y)z¡Waits until the completion of all work currently captured in this event.
        This prevents the CPU thread from proceeding until the event completes.
        N)r   r   Ú_mps_synchronizeEventr	   r   s    r   ÚsynchronizezEvent.synchronize$   s   € ô 	�‰×&Ñ& t§~¡~Õ6r   c                 ój   — t         j                  j                  | j                  |j                  «      S )z}Returns the time elapsed in milliseconds after the event was
        recorded and before the end_event was recorded.
        )r   r   Ú_mps_elapsedTimeOfEventsr	   )r
   Ú	end_events     r   Úelapsed_timezEvent.elapsed_time*   s%   € ô �x‰x×0Ñ0°·±À×ATÑATÓUÐUr   N)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r#   © r   r   r   r      s,   „ ñóCò7ò
2ò3ò8ò7óVr   r   )r   r   r(   r   r   ú<module>r)      s   ðã ÷)Vò )Vr   