
    
9j                    >    S SK Jr  S SKrS SKJr  S r " S S5      rg)    )annotationsN)_corec                    [        U S5      (       a  U R                  R                  $ [        R                  " [	        U 5      5      R                  $ )Ndtype)hasattrr   charnumpytype)args    T/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_functional/vectorize.py_get_input_typer      s6    sGyy~~{{49%***    c                  <    \ rS rSrSr  SS jr\S 5       rS rSr	g)		vectorize   zCGeneralized function class.

.. seealso:: :class:`numpy.vectorize`
Nc                V   Xl         U=(       d    UR                  U l        X@l        XPl        X`l        0 U l        SU l        UbE  SR                  U Vs/ s H#  n[        R                  " U5      R                  PM%     sn5      U l        Ub  [        S5      eUb  [        S5      egs  snf )a"  
Args:
    pyfunc (callable): The target python function.
    otypes (str or list of dtypes, optional): The output data type.
    doc (str or None): The docstring for the function.
    excluded: Currently not supported.
    cache: Currently Ignored.
    signature: Currently not supported.
N z<cupy.vectorize does not support `excluded` option currently.z=cupy.vectorize does not support `signature` option currently.)pyfunc__doc__excludedcache	signature_kernel_cacheotypesjoinr	   r   r   NotImplementedError)selfr   r   docr   r   r   ts           r   __init__vectorize.__init__   s     ,fnn 
"''"G15;;q>#6#6"GHDK%NP P  %%& & ! #Hs   *B&c                    SSK Jn  [        XR                  5      (       a  U R                  /nSU S3nO[        XR
                  5      (       av  / nSU S3n[        U R                  5       HT  u  pV[        XbR                  5      (       d  [        SU  35      eUR                  UR                  5        USU S	U S
3-  nMV     O[        SU  35      e[        U5       VVs/ s H  u  pWU SU 3PM     nnnSR                  U5      U4$ s  snnf )Nr   _cuda_typeszout0 = ;zauto out = z;
zInvalid return type: outz = STD::get<z>(out);
z out, )	cupyx.jitr$   
isinstanceScalarr   Tuple	enumeratetypes	TypeErrorappendr   )	return_typecallr$   dtypescodeir   r   
out_paramss	            r   	_get_bodyvectorize._get_body6   s   )k#5#566!''(FTF!$D%6%677F c*D!+"3"34!!%7%788#&;K=$IJJagg&#aSQCy99 5 3K=ABB8A&8IJ8IHAtA3'8I
Jyy$d** Ks   !D
c           	        SSK Jn  SSK Jn  SR                  U Vs/ s H  n[	        U5      PM     sn5      nU R
                  R                  US 5      nUGc  U Vs/ s H  osR                  U5      PM     nnS n	U R                  b  [        eUR                  U R                  SSS9n
U
R                  X5      nSR                  S	 [        U5       5       5      nSR                  [        [        U5      5       Vs/ s H  nS
U 3PM
     sn5      nUR                    SU S3nU R#                  UR$                  U5      u  nn[&        R(                  " UUUSUR*                  SS9nX`R
                  U'   U" U6 $ s  snf s  snf s  snf )Nr   )
_interfacer#   r   r	   T)devicer'   c              3  H   #    U  H  u  pUR                    S U 3v   M     g7f)z inN)r   ).0r4   r   s      r   	<genexpr>%vectorize.__call__.<locals>.<genexpr>Z   s&      "D/Btq177)3qc"/Bs    "in()cupy_vectorize)z-DCUPY_JIT_MODEz--std=c++17)preambleoptions)r(   r9   r$   r   r   r   getr*   r   r   _CudaFunctionr   _emit_code_from_typesr,   rangelen	func_namer6   r0   r   ElementwiseKernelr3   )r   argsr9   r$   xitypeskernr   in_typesret_typefuncresult	in_paramsr4   in_argsr1   r5   bodys                     r   __call__vectorize.__call__K   sy   ()d;d/!,d;<!!%%fd3<7=>v!**1-vH>H{{&))++DKK+ND//CF		 "D/8/B"D DIii5X3G H3Ga2aS3G HIG&&'q	3D#~~f.@.@$GJ **:t-=:D
 *.v&T{7 < ? !Is   E8E=;F)r   r   r   r   r   r   r   )NNNFN)
__name__
__module____qualname____firstlineno__r   r    staticmethodr6   rW   __static_attributes__ r   r   r   r      s.     ;?#'&B + +(r   r   )
__future__r   r	   cupyr   r   r   r_   r   r   <module>rb      s    "  +Z Zr   