
    9i                         S SK JrJr  S SKJr  S SKJr  S SKJrJ	r	  S SK
Jr  \" SS9 " S S	\5      5       r " S
 S\5      r " S S\S9rg)    )ABCMetaabstractmethod)	dataclass)Enum)DictUnion)
ModuleTypeT)frozenc                   >    \ rS rSr% \\S'   \\\4   \S'   \\S'   Srg)	GPUTarget   backendarch	warp_size N)	__name__
__module____qualname____firstlineno__str__annotations__r   int__static_attributes__r       X/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/triton/backends/compiler.pyr   r      s     L
S/Nr   r   c                        \ rS rSrSrSrSrSrg)Language   z1The input language being compiled by the backend.r      r   N)r   r   r   r   __doc__TRITONGLUONr   r   r   r   r   r      s    ;FEr   r   c                       \ rS rSrS\SS4S jr\\S\4S j5       5       r\S\	4S j5       r
\S\S\4S	 j5       r\S
\S\SS4S j5       r\S 5       r\S\\	\4   4S j5       r\S 5       r\S 5       rSrg)BaseBackend   targetreturnNc                 @    Xl         U R                  U5      (       d   eg N)r&   supports_target)selfr&   s     r   __init__BaseBackend.__init__   s    ##F++++r   c                     [         er)   NotImplementedErrorr&   s    r   r*   BaseBackend.supports_target   
     "!r   c                     [         e)z,Returns a unique identifier for this backendr/   r+   s    r   hashBaseBackend.hash"   r3   r   optionsc                     [         e)z
Converts an `options` dictionary into an arbitrary object and returns it.
This function may contain target-specific heuristics and check the legality of the provided options
r/   )r+   r8   s     r   parse_optionsBaseBackend.parse_options'   s
     "!r   stagesc                     [         e)a  
Populates `stages` dictionary with entries of the form:
ir_name [str] => Function[(src: str, metadata: dict) -> str|bytes]
The value of each entry may populate a `metadata` dictionary.
Stages will be run sequentially (in inseriton order) and can communicate using `metadata`.
All stages are expected to return a `str` object, except for the last stage which returns
a `bytes` object for execution by the launcher.
r/   )r+   r<   r8   s      r   
add_stagesBaseBackend.add_stages/   s
     "!r   c                     [         e)z;
Load additional MLIR dialects into the provided `context`
r/   )r+   contexts     r   load_dialectsBaseBackend.load_dialects;   
    
 "!r   c                     [         e)zL
Return a map of interface modules to their device-specific implementations
r/   r5   s    r   get_module_mapBaseBackend.get_module_mapB   rD   r   c                 T    [        U [        5      (       d   e/ nSU ;   a  USS//-  nU$ )NDztt.divisibility   )
isinstancer   )descrets     r   
parse_attrBaseBackend.parse_attrI   s9    $$$$$$;&+,,C
r   c                     US:X  a!  U S-  S:X  a  UR                  SS5      (       a  gUS:X  a/  U R                  5       S-  S:X  a  UR                  SS5      (       a  gg)	zH
Return a string unique to each possible specialization of the argument
r   rJ   r   alignFrI   tensor )getdata_ptr)argtykwargss      r   get_arg_specialization"BaseBackend.get_arg_specializationQ   sW    
 ;38q=VZZ-G-G>cllnr1Q66::gu;U;Ur   r1   )r   r   r   r   r   r,   staticmethodr   r*   r   r6   dictobjectr:   r>   rB   r   r	   rF   rN   rY   r   r   r   r   r$   r$      s    ,y ,T , "	 "  " "c " " "T "f " " 	" 	" 	"4 	" 	" " " "S*_ 5 " "    r   r$   )	metaclassN)abcr   r   dataclassesr   enumr   typingr   r   typesr	   r]   r   r   r$   r   r   r   <module>rd      sN    ' !    $  t CG Cr   