o
    iA
                     @   sx   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 deZedZG dd	 d	e	jZG d
d dejZdS )    N)threadsafe_cached_property)TargetDescriptor)utilstyping
dispatchercpuc                   @   sB   e Zd ZejZedd Zedd Ze	dd Z
e	dd Zd	S )
	CPUTargetc                 C   s   t | j| jS N)r   
CPUContexttyping_context_target_nameself r   P/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/numba/core/registry.py_toplevel_target_context   s   z"CPUTarget._toplevel_target_contextc                 C   s   t  S r	   )r   Contextr   r   r   r   _toplevel_typing_context   s   z"CPUTarget._toplevel_typing_contextc                 C      | j S )z5
        The target context for CPU targets.
        )r   r   r   r   r   target_context      zCPUTarget.target_contextc                 C   r   )z5
        The typing context for CPU targets.
        )r   r   r   r   r   r       r   zCPUTarget.typing_contextN)__name__
__module____qualname__r   CPUTargetOptionsoptionscached_propertyr   r   propertyr   r   r   r   r   r   r      s    


r   r   c                   @   s   e Zd ZeZdS )CPUDispatcherN)r   r   r   
cpu_targettargetdescrr   r   r   r   r   ,   s    r   c                       s8   e Zd ZdZ fddZ fddZ fddZ  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                    sN   t  | _|dd | _|dd | _| jp| j| _tt| j	|i | d S )Nkey_type
value_type)
r   
UniqueDictondemandpopr"   r#   _type_checksuperr!   __init__)r   argskws	__class__r   r   r)   <   s
   
zDelayedRegistry.__init__c                    s2   || j v r| j |  | |< | j |= tt| |S r	   )r%   r(   r!   __getitem__)r   itemr,   r   r   r.   C   s   
zDelayedRegistry.__getitem__c                    sL   | j rdd }| jd ur||| j | jd ur||| j tt| ||S )Nc                 S   s>   t |tr|| jv sJ | |fd S t | |sJ | |fd S r	   )
isinstancetype__mro__)xty_xr   r   r   checkK   s   
z*DelayedRegistry.__setitem__.<locals>.check)r'   r"   r#   r(   r!   __setitem__)r   keyvaluer5   r,   r   r   r6   I   s   

zDelayedRegistry.__setitem__)r   r   r   __doc__r)   r.   r6   __classcell__r   r   r,   r   r!   0   s
    r!   )
contextlibnumba.core.utilsr   r   numba.core.descriptorsr   
numba.corer   r   r   r   r   r   
Dispatcherr   r$   r!   r   r   r   r   <module>   s    