
    nVh                     \    d dl mZmZ d dlmZmZ ddlmZmZ dZ	 G d d      Z
dd	Zdd
Zy)   )enter_state
exit_state)enter_scope
exit_scope    )CompiledKernelLazyDict__proton_launch_metadatac                       e Zd Zg dZeD  cg c]  }d| 	 c}} dgz   dgz   Zededdfd       Zededdfd       Zyc c}} w )	
TritonHook)          @   flopsbytes	lazy_dictreturnNc                     t        t               | j                         }t                t        j
                  D ci c]  }||v s|||    }}t        |d   d|       y c c}w )NnameT)	triton_opmetrics)r   COMPUTE_METADATA_SCOPE_NAMEgetr   r   r   r   )r   metadatak
fn_metricss       D/home/dcms/DCMS/lib/python3.12/site-packages/triton/profiler/hook.pyenterzTritonHook.enter   sY    /0==?.8.@.@RAMa!nR
RHV$jI Ss   	A"A"c                     t        d       y )NT)r   )r   )r   s    r   exitzTritonHook.exit   s
    T"    )	__name__
__module____qualname__flops_widthr   staticmethodr	   r   r!   ).0widths   00r   r   r      sv    !K,785ug8G9DyPGJ Jd J J # #T # # 9s   Ar   Nc                      t         j                  3t        j                  t         _        t        j                  t         _        y y N)r   launch_enter_hookr   r   r!   launch_exit_hook r"   r   register_triton_hookr/      s-    ''/+5+;+;(*4//' 0r"   c                  t    t         j                  t        j                  k(  rd t         _        d t         _        y y r+   )r   r,   r   r   r-   r.   r"   r   unregister_triton_hookr1      s+    '':+;+;;+/(*.' <r"   )r   N)stater   r   scoper   r   triton.compilerr   r	   r   r   r/   r1   r.   r"   r   <module>r5      s(    * * 48 # #":/r"   