o
    DiD                     @   s   d dl mZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ ddlmZ e	edZ	 ed	 hZd
d ZdefddZdefddZdejdejfddZeddejfddZeddejfddZG dd dZdS )    )core)builtin)proton)TritonSemantic)GluonSemantic   )flags)tritongluonr
   c                 C   s*   t | ttstdt|  dt d S )NzUnsupported semantic type: z. Supported semantics are: )
isinstancetuple
_SEMANTICS	TypeErrortype)semantic r   b/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/triton/profiler/language.py_check_supported_semantic   s
   r   semantic_namec                 C      t t|   d S N)r   add_ALL_SEMANTICSr   r   r   r   enable_semantic      r   c                 C   r   r   )r   remover   r   r   r   r   disable_semantic    r   r   is_start
scope_namec                 C   s@   t jsd S t| t| } t|}tt|j| |tj	S r   )
r   instrumentation_onr   tl_unwrap_if_constexprtensortriton_protoncreate_proton_recordbuildervoidr   r   r   r   r   r   record$   s   

r)   Nnamec                 C      t d| |d d S )NTr(   r)   r*   	_semanticr   r   r   enter_scope-      r/   c                 C   r+   )NFr(   r,   r-   r   r   r   
exit_scope2   r0   r1   c                   @   s,   e Zd Zd	defddZdd Zdd ZdS )
scopeNr*   c                 C   s   || _ || _d S r   )r*   r   )selfr*   r.   r   r   r   __init__9   s   
zscope.__init__c                 C      t | j| jd d S N)r.   )r/   r*   r   )r3   r   r   r   	__enter__=      zscope.__enter__c                 C   r5   r6   )r1   r*   r   )r3   exc_type	exc_value	tracebackr   r   r   __exit__@   r8   zscope.__exit__r   )__name__
__module____qualname__strr4   r7   r<   r   r   r   r   r2   7   s    r2   r   )triton.languager   r!   triton.language.corer   triton._C.libtritonr   r$   triton.language.semanticr   ,triton.experimental.gluon.language._semanticr   r   r   r   r   r@   r   r   	constexprr)   r/   r1   r2   r   r   r   r   <module>   s(    
	