
    Vh                    :   d dl mZ d dlmZmZ d dlZ	 d dlZedd 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 	 d dlmZ 	 d dlmZ 	 d dlmZ e
j4                  j2                  Ze
j6                  Z	 d dlm Z  n>d"dZ! G d de      Z G d d
e      Ze"Ze"Ze"ZdZdZe!Z dZdZ G d d      Z G d d      Z
d#dZ#	 ejH                  jJ                  Z&g dZ(y# e$ r dZY w xY w# e$ r  G d	 d
e      ZY w xY w# e$ r dZY w xY w# e$ r 	 	 	 	 	 	 	 	 d dZY w xY w# e$ r  ee
j4                  d      rJ ee
j4                  j:                  d      r-e
j4                  j:                  j2                  Ze
j6                  Znk ee
j4                  d      rJ ee
j4                  j<                  d      r-e
j4                  j<                  j2                  Ze
j6                  Zne
j6                  Ze
ZY }w xY w# e$ r d!dZ Y Gw xY w# e'$ r  G d d      Z&Y Bw xY w)$    )annotations)AnyUnionN)Config)CompiledKernel)OutOfResources)KernelInterface)
PTXASErrorc                      e Zd Zyr
   N__name__
__module____qualname__     U/home/dcms/DCMS/lib/python3.12/site-packages/torch/_inductor/runtime/triton_compat.pyr
   r
      s    r   r
   )	ASTSource)	GPUTargetc                H    t         j                  j                  r| ||gS | |fS N)torchversionhip)backendarch	warp_sizes      r   r   r   %   s(    
 }}  y11T?"r   )	libdevicecudar   intel)_log2c                    t         r   )NotImplementedError)xs    r   r!   r!   D   s    %%r   c                     t        d      )Nztriton package is not installed)RuntimeErrorargskwargss     r   _raise_errorr*   I   s    <==r   c                      e Zd Zy)r   Nr   r   r   r   r   r   L       r   r   c                      e Zd Zyr   r   r   r   r   r
   r
   O   r,   r   c                      e Zd Zedd       Zy)tritonc                     t         S r   )r*   r'   s     r   jitz
triton.jit\   s    r   Nr(   r   r)   r   returnr   )r   r   r   staticmethodr1   r   r   r   r/   r/   [   s    		  
	 r   r/   c                  &    e Zd Zedd       ZeZeZy)tlc                    | S r   r   )vals    r   	constexprztl.constexpra   s    Jr   N)r8   r   r3   r   )r   r   r   r4   r9   r   tensordtyper   r   r   r6   r6   `   s     		 
	 r   r6   c                b    t         j                  j                  rt        |       }d|v sd|v ryyy)Ngfx10gfx11    @   )r   r   r   str)cccc_strs     r   cc_warp_sizerD   i   s0    }}Rf6 1r   c                      e Zd ZdZy)autograd_profilerFN)r   r   r   _is_profiler_enabledr   r   r   rF   rF   x   s    $r   rF   )r   r   r   r	   r
   r   r   r6   r!   r   mathr/   rD   )r   rA   r   zUnion[int, str]r   intr3   r   )r$   r   r3   r   r2   )rB   zUnion[str, int]r3   rI   ))
__future__r   typingr   r   r   r/   ImportErrortriton.languagelanguager6   r   triton.compilerr   triton.runtime.autotunerr   triton.runtime.jitr	   r
   	Exceptiontriton.compiler.compilerr   triton.backends.compilerr   triton.language.extrar   extrarH   hasattrr   r    triton.language.standardr!   r*   objectrD   autogradprofilerrF   AttributeError__all__r   r   r   <module>r^      s/   "  
 
 .7276#63HH&&	ww&2> Y  FNOIIEID   
 %//e  F  	 	  	
  	#	#	#!	# 	# 		#	#$  	288V$)L//I77DRXXw'GBHHNNK,P00I77DID	  &	&&h  %% %%s}   C C)  C? D (D# 7G7 H C&%C&)C<;C<?D	D	D D #CG43G47	HHHH