Ë
    Ûéñi…  ã            	      óæ   — d dl mZ d dlmZ d dlmZ d dlmZmZ d dl	m
Z
mZmZmZmZ d dlmZ  e
d«      Zdd	gZ G d
„ de«      Z G d„ dee   «      Z	 dddddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)é    )Úannotations)Ú	ASTSource)ÚLanguage)ÚJITFunctionÚconstexpr_function)ÚTypeVarÚOptionalÚCallableÚIterableÚUnion)ÚirÚTr   Újitc                  ó(   ‡ — e Zd Zddˆ fd„Zd„ Zˆ xZS )ÚGluonASTSourcec                ób   •— t         ‰| �  ||||«       t        j                  | _        d| _        y )NÚttgir)ÚsuperÚ__init__r   ÚGLUONÚlanguageÚext)ÚselfÚfnÚ	signatureÚ
constexprsÚattrsÚ	__class__s        €úd/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/triton/experimental/gluon/_runtime.pyr   zGluonASTSource.__init__   s(   ø€ Ü‰Ñ˜˜Y¨
°EÔ:Ü Ÿ™ˆŒØˆ�ó    c           	     ó   — ddl m} ddlm} t	        j
                  |«      }|j                  «       }	 ||«      }
|
j                  |«      }|	j                  d|j                  |«      «       |	j                  d|j                  |j                  «      «       |	j                  d|j                  |j                  «      «       |	j                  d|j                  |j                  «      «       |j                  dk(  }|r7|j                  �+|	j                  d	|j                  |j                  «      «        || j                   | |||||	¬
«      }	|	S )Nr   )Úmake_backend)Úast_to_ttirz
ttg.targetzttg.num-warpszttg.num-ctaszttg.threads-per-warpÚcudazttg.maxnreg)ÚcontextÚoptionsÚcodegen_fnsÚ
module_mapÚmodule)Útriton.compiler.compilerr"   Útriton.compiler.code_generatorr#   r   ÚbuilderÚcreate_moduleÚget_target_nameÚset_attrÚget_string_attrÚget_int32_attrÚ	num_warpsÚnum_ctasÚ	warp_sizeÚbackend_nameÚmaxnregr   )r   Útargetr&   r'   r(   r%   r"   r#   r,   r)   ÚbackendÚis_cudas               r   Úmake_irzGluonASTSource.make_ir   s  € Ý9Ý>ä—*‘*˜WÓ%ˆØ×&Ñ&Ó(ˆñ ˜vÓ&ˆØ×(Ñ(¨Ó1ˆà�‰˜ g×&=Ñ&=¸fÓ&EÔFØ�‰˜¨×)?Ñ)?À×@QÑ@QÓ)RÔSØ�‰˜¨×(>Ñ(>¸w×?OÑ?OÓ(PÔQØ�‰Ð.°×0FÑ0FÀw×GXÑGXÓ0YÔZà×&Ñ&¨&Ñ0ˆÙ�w—‘Ð2Ø�O‰O˜M¨7×+AÑ+AÀ'Ç/Á/Ó+RÔSá˜TŸW™W d°GÀWÐZeØ(2¸6ôCˆàˆr    )NN)ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__r   r:   Ú__classcell__©r   s   @r   r   r      s   ø„ öö
r    r   c                  ó$   ‡ — e Zd Zˆ fd„Zd„ Zˆ xZS )ÚGluonJITFunctionc                ó:   •— t         ‰| �  «       }t        | _        |S ©N)r   Úcreate_binderr   r   )r   Úresultr   s     €r   rF   zGluonJITFunction.create_binder/   s   ø€ Ü‘Ñ&Ó(ˆÜ'ˆŒØˆr    c                 ó   — y)NT© )r   s    r   Úis_gluonzGluonJITFunction.is_gluon4   s   € Ør    )r=   r>   r?   rF   rJ   r@   rA   s   @r   rC   rC   -   s   ø„ ôö
r    rC   N)ÚversionÚreprÚlaunch_metadataÚdo_not_specializeÚdo_not_specialize_on_alignmentÚdebugÚnoinlinec               ó@   ‡‡‡‡‡‡‡— dˆˆˆˆˆˆˆfd„}| � || «      S |S )a<  
    Decorator for JIT-compiling a function using the Triton compiler.

    :note: When a jit'd function is called, arguments are
        implicitly converted to pointers if they have a :code:`.data_ptr()` method
        and a `.dtype` attribute.

    :note: This function will be compiled and run on the GPU. It will only have access to:

           * python primitives,
           * builtins within the triton package,
           * arguments to this function,
           * other jit'd functions

    :param fn: the function to be jit-compiled
    :type fn: Callable
    c           
     óD   •— t        | «      sJ ‚t        | ‰‰‰‰‰‰‰¬«      S )N)rK   rN   rO   rP   rQ   rL   rM   )ÚcallablerC   )r   rP   rN   rO   rM   rQ   rL   rK   s    €€€€€€€r   Ú	decoratorzjit.<locals>.decoratorU   s4   ø€ Ü˜Œ|Ðˆ|ÜØØØ/Ø+IØØØØ+ô	
ð 		
r    )r   r   r;   zJITFunction[T]rI   )	r   rK   rL   rM   rN   rO   rP   rQ   rU   s	    ``````` r   r   r   8   s&   þ€ ÷:
ó 
ð 
€~Ù˜‹}Ðð Ðr    rE   )r   zOptional[T]rL   úOptional[Callable]rM   rV   rN   úOptional[Iterable[int | str]]rO   rW   rP   úOptional[bool]rQ   rX   r;   z9Union[GluonJITFunction[T], Callable[[T], JITFunction[T]]])Ú
__future__r   r*   r   Útriton.backends.compilerr   Útriton.runtime.jitr   r   Útypingr   r	   r
   r   r   Útriton._C.libtritonr   r   Ú__all__r   rC   r   rI   r    r   ú<module>r_      s¿   ðÝ "Ý .Ý -ß >ß ?Õ ?Ý "áˆCƒL€à Ð
'€ô�Yô ô@�{ 1‘~ô ð ð.ð Ø#Ø*.Ø7;ØDHØ Ø#ñ.Øð.ð ð	.ð
 (ð.ð 5ð.ð %Bð.ð ð.ð ð.ð ?ô.r    