
    ܙd                         d dl Z d dlmZ d dlmZ d dlmZmZmZm	Z	  G d de
          Z G d de          Z ed	          Z G d
 dej                  Z G d dej                  ZdS )    N)cached_property)TargetDescriptor)utilstyping
dispatchercpuc                   6    e Zd ZdZdZej        d             ZdS )_NestedContextNc              #      K   | j         | j        f}	 || _         || _        d V  |\  | _         | _        d S # |\  | _         | _        w xY wN)_typing_context_target_context)selftyping_contexttarget_context
old_nesteds       3lib/python3.11/site-packages/numba/core/registry.pynestedz_NestedContext.nested   sg      )4+??
	D#1D #1D EEE9C6D $"6"6"66D $"6CCCCs	   5 A)__name__
__module____qualname__r   r   
contextlibcontextmanagerr        r   r
   r
   
   s@        OOD D D D Dr   r
   c                       e Zd Zej        Z e            Zed             Z	ed             Z
ed             Zed             Zd ZdS )	CPUTargetc                 @    t          j        | j        | j                  S r   )r   
CPUContextr   _target_namer   s    r   _toplevel_target_contextz"CPUTarget._toplevel_target_context   s     ~d143DEEEr   c                 (    t          j                    S r   )r   Contextr!   s    r   _toplevel_typing_contextz"CPUTarget._toplevel_typing_context"   s     ~r   c                 0    | j         j        }||S | j        S )z5
        The target context for CPU targets.
        )_nestedr   r"   r   r   s     r   r   zCPUTarget.target_context'   "    
 -M00r   c                 0    | j         j        }||S | j        S )z5
        The typing context for CPU targets.
        )r'   r   r%   r(   s     r   r   zCPUTarget.typing_context2   r)   r   c                 8    | j                             ||          S )z
        A context manager temporarily replacing the contexts with the
        given ones, for the current thread of execution.
        )r'   r   )r   r   r   s      r   nested_contextzCPUTarget.nested_context=   s    
 |"">>BBBr   N)r   r   r   r   CPUTargetOptionsoptionsr
   r'   r   r"   r%   propertyr   r   r,   r   r   r   r   r      s        "GnGF F _F     _  1 1 X1 1 1 X1C C C C Cr   r   r   c                       e Zd ZeZdS )CPUDispatcherN)r   r   r   
cpu_targettargetdescrr   r   r   r1   r1   I   s        KKKr   r1   c                   6     e Zd ZdZ fdZ fdZ fdZ xZS )DelayedRegistrya#  
    A unique dictionary but with deferred initialisation of the values.

    Attributes
    ----------
    ondemand:

        A dictionary of key -> value, where value is executed
        the first time it is is used.  It is used for part of a deferred
        initialization strategy.
    c                 
   t          j                    | _        |                    dd           | _        |                    dd           | _        | j        p| j        | _         t          t          |           j	        |i | d S )Nkey_type
value_type)
r   
UniqueDictondemandpopr7   r8   _type_checksuperr5   __init__)r   argskws	__class__s      r   r>   zDelayedRegistry.__init__Y   sv    (**
D11'',55=;DO-ot$$-t;s;;;;;r   c                     || j         v r  | j         |                     | |<   | j         |= t          t          |                               |          S r   )r:   r=   r5   __getitem__)r   itemrA   s     r   rC   zDelayedRegistry.__getitem__`   sP    4=  ,t,..DJd#_d++77===r   c                     | j         r3d }| j         ||| j                   | j         ||| j                   t          t          |                               ||          S )Nc                     t          |t                    r|| j        v sJ | |f            d S t          | |          sJ | |f            d S r   )
isinstancetype__mro__)xty_xs     r   checkz*DelayedRegistry.__setitem__.<locals>.checkh   sa    dD)) :19,,,q$i,,,,,%a..99D	99999r   )r<   r7   r8   r=   r5   __setitem__)r   keyvaluerL   rA   s       r   rM   zDelayedRegistry.__setitem__f   sw     		.: : :
 }(c4=)))*eT_---_d++77UCCCr   )r   r   r   __doc__r>   rC   rM   __classcell__)rA   s   @r   r5   r5   M   s}        
 
< < < < <> > > > >D D D D D D D D Dr   r5   )r   	functoolsr   numba.core.descriptorsr   
numba.corer   r   r   r   objectr
   r   r2   
Dispatcherr1   r9   r5   r   r   r   <module>rW      s>       % % % % % % 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5
D D D D DV D D D)C )C )C )C )C  )C )C )CZ Yu
    J)   $D $D $D $D $De& $D $D $D $D $Dr   