
    JTh                          S SK r  " S S5      rg)    Nc                   v    \ rS rSrSrSS\SS4S jjrSS jrSS jrSS	 jr	S\4S
 jr
SS jrSS S\4S jrSrg)Event   a)  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``)
enable_timingreturnNc                 L    [         R                  R                  U5      U l        g )N)torch_C_mps_acquireEvent_Event__eventId)selfr   s     G/var/www/auris/envauris/lib/python3.13/site-packages/torch/mps/event.py__init__Event.__init__   s    33MB    c                     [        [        R                  S5      (       a;  U R                  S:  a*  [        R                  R	                  U R                  5        g g g )N_mps_releaseEventr   )hasattrr	   r
   r   r   r   s    r   __del__Event.__del__   s>    588011dnnq6HHH&&t~~6 7I1r   c                 V    [         R                  R                  U R                  5        g)z(Records the event in the default stream.N)r	   r
   _mps_recordEventr   r   s    r   recordEvent.record   s    !!$..1r   c                 V    [         R                  R                  U R                  5        g)zJMakes all future work submitted to the default stream wait for this event.N)r	   r
   _mps_waitForEventr   r   s    r   wait
Event.wait   s    ""4>>2r   c                 T    [         R                  R                  U R                  5      $ )zCReturns True if all work currently captured by event has completed.)r	   r
   _mps_queryEventr   r   s    r   queryEvent.query   s    xx''77r   c                 V    [         R                  R                  U R                  5        g)zWaits 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   synchronizeEvent.synchronize#   s     	&&t~~6r   	end_eventc                 j    [         R                  R                  U R                  UR                  5      $ )zmReturns the time elapsed in milliseconds after the event was
recorded and before the end_event was recorded.
)r	   r
   _mps_elapsedTimeOfEventsr   )r   r(   s     r   elapsed_timeEvent.elapsed_time)   s%     xx00ATATUUr   )	__eventId)F)r   N)__name__
__module____qualname____firstlineno____doc__boolr   r   r   r   r"   r&   floatr+   __static_attributes__ r   r   r   r      sS    Cd Ct C7
238t 87Vg V% Vr   r   )r	   r   r6   r   r   <module>r7      s    )V )Vr   