
    xKg                     D    d dl mZ d dlmZ  G d d      Z G d d      Zy)    )numpy_support)typesc                       e Zd ZdZd Zd Zy)UfuncLowererBasezHCallable class responsible for lowering calls to a specific gufunc.
    c                 H    || _         || _         ||      | _        g | _        y N)ufuncmake_ufunc_kernel_fnkernellibs)selfr	   make_kernel_fnr
   s       ]/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/np/ufunc/ufunc_base.py__init__zUfuncLowererBase.__init__   s$    
$8!$U+	    c                 V    | j                  ||||| j                  | j                        S r   )r
   r	   r   )r   contextbuildersigargss        r   __call__zUfuncLowererBase.__call__   s,    (('3)-T[[B 	Br   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    Br   r   c                       e Zd Zed        Zed        Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zed	        Zed
        Zed        Zed        Zd ZddZd Zy)	UfuncBasec                 .    | j                   j                  S r   )r	   ninr   s    r   r    zUfuncBase.nin   s    zz~~r   c                 .    | j                   j                  S r   )r	   noutr!   s    r   r#   zUfuncBase.nout   s    zzr   c                 .    | j                   j                  S r   )r	   nargsr!   s    r   r%   zUfuncBase.nargs       zzr   c                 .    | j                   j                  S r   )r	   ntypesr!   s    r   r(   zUfuncBase.ntypes!       zz   r   c                 .    | j                   j                  S r   )r	   r   r!   s    r   r   zUfuncBase.types%   r&   r   c                 .    | j                   j                  S r   )r	   identityr!   s    r   r,   zUfuncBase.identity)       zz"""r   c                 .    | j                   j                  S r   )r	   	signaturer!   s    r   r/   zUfuncBase.signature-   s    zz###r   c                 .    | j                   j                  S r   )r	   
accumulater!   s    r   r1   zUfuncBase.accumulate1   s    zz$$$r   c                 .    | j                   j                  S r   )r	   atr!   s    r   r3   zUfuncBase.at5   s    zz}}r   c                 .    | j                   j                  S r   )r	   outerr!   s    r   r5   zUfuncBase.outer9   r&   r   c                 .    | j                   j                  S r   )r	   reducer!   s    r   r7   zUfuncBase.reduce=   r)   r   c                 .    | j                   j                  S r   )r	   reduceatr!   s    r   r9   zUfuncBase.reduceatA   r-   r   c                 Z    t        | j                  j                        dkD  sJ d| _        y)zI
        Disable the compilation of new signatures at call time.
        r   TN)len_dispatcher	overloads_frozenr!   s    r   disable_compilezUfuncBase.disable_compileE   s*    
 4##--.222r   Nc                    | | j                   j                  j                  }t        j                  }t        j
                  }|f| j                  j                  z  |f| j                  j                  z  z   }|f| j                  j                  z  }|j                  ||fD cg c]  }| j                  | |f c}       yc c}w )a4  
        Install an implementation function for a GUFunc/DUFunc object in the
        given target context.  If no target context is given, then
        _install_cg() installs into the target context of the
        dispatcher object (should be same default context used by
        jit() and njit()).
        N)r<   targetdescrtarget_contextr   AnyArrayr	   r    r#   insert_func_defn	_lower_me)r   	targetctx_any_arrsig0sig1r   s          r   _install_cgzUfuncBase._install_cgM   s     ((44CCIyy{{w'4'DJJOO*CCw'""594LALSdnndC(LA	CAs   #Cc                 2   | j                   rGt        j                  | |      }|yt        |j                  |j
                  z         dt        |       }| j                  j                  j                         D ]  \  }}| j                  ||      s||fc S  y)a  
        Given a tuple of element-wise argument types, find a matching
        signature in the dispatcher.

        Return a 2-tuple containing the matching signature, and
        compilation result.  Will return two None's if no matching
        signature was found.
        N)NN)r>   r   ufunc_find_matching_looptupleinputsoutputsr;   r<   r=   itemsmatch_signature)r   ewise_typesloopr   cress        r   find_ewise_functionzUfuncBase.find_ewise_function_   s     << 99$LD|!dll :;<MS=MNK))3399;IC##K5Dy  < r   r   )r   r   r   propertyr    r#   r%   r(   r   r,   r/   r1   r3   r5   r7   r9   r?   rL   rW   r   r   r   r   r      s            ! !     # # $ $ % %       ! ! # #C$r   r   N)numba.npr   
numba.corer   r   r   r   r   r   <module>r[      s#    " B B^ ^r   