
    Ǆg                         d dl mZ 	 d dlmZ g dZd Zd Zd Z	d	 Z
ed
        Zy# e$ r  G d d      Z e       ZY 1w xY w)    )contextmanager)_ittc                   8    e Zd Zed        Zed        ZeZeZeZy)_ITTStubc                      t        d      )Nz?ITT functions not installed. Are you sure you have a ITT build?)RuntimeError)argskwargss     Z/home/mcse/projects/flask_80/flask-venv/lib/python3.12/site-packages/torch/profiler/itt.py_failz_ITTStub._fail
   s    Q     c                       y)NF r   r   r   is_availablez_ITTStub.is_available   s    r   N)	__name__
__module____qualname__staticmethodr   r   	rangePushrangePopmarkr   r   r   r   r   	   s9    		 
	
 
	 
	 	r   r   )r   
range_push	range_popr   rangec                  *    t        j                         S )z2
    Check if ITT feature is available or not
    )r   r   r   r   r   r   r      s     r   c                 ,    t        j                  |       S )z
    Pushes a range onto a stack of nested range span.  Returns zero-based
    depth of the range that is started.

    Arguments:
        msg (str): ASCII message to associate with range
    )r   r   msgs    r   r   r   %   s     >>#r   c                  *    t        j                         S )zy
    Pops a range off of a stack of nested range spans. Returns the
    zero-based depth of the range that is ended.
    )r   r   r   r   r   r   r   0   s    
 ==?r   c                 ,    t        j                  |       S )z
    Describe an instantaneous event that occurred at some point.

    Arguments:
        msg (str): ASCII message to associate with the event.
    )r   r   r   s    r   r   r   8   s     99S>r   c              /   ~   K   t         | j                  |i |       	 d t                y# t                w xY ww)a  
    Context manager / decorator that pushes an ITT range at the beginning
    of its scope, and pops it at the end. If extra arguments are given,
    they are passed as arguments to msg.format().

    Args:
        msg (str): message to associate with the range
    N)r   formatr   )r   r	   r
   s      r   r   r   B   s2      zszz4*6*+	s   =. =:=N)
contextlibr   torch._Cr   ImportErrorr   __all__r   r   r   r   r   r   r   r   <module>r'      se    %* G  y    :D#s   ' A A 