a
    .;bm                     @   s   d Z ddlmZ ddlZddlZddlmZ ddlZddl	m
Z
mZ ddlmZmZ ddlmZ ddlmZ d	d
 Zdd Zdd ZG dd deZdd ZG dd de
ZG dd de
Zdd Zdd Zdd Zdd ZG dd  d eZG d!d" d"eZ G d#d$ d$eZ!G d%d& d&eZ"dS )'zA
Implements custom ufunc dispatch mechanism for non-CPU devices.
    )OrderedDictN)reduce)_BaseUFuncBuilderparse_identity)typessigutils)	signatureparse_signaturec                 C   s8   | |kr| S | dkr|S |dkr$| S t d| |dS )=
    Raises
    ------
    ValueError if broadcast fails
       zfailed to broadcast {0} and {1}N)
ValueErrorformat)ab r   9lib/python3.9/site-packages/numba/np/ufunc/deviceufunc.py_broadcast_axis   s    r   c                 C   s^   t t| |g\} }t| t|k r,d|  } qt| t|krFd| }q,tdd t| |D S )r   r   c                 s   s   | ]\}}t ||V  qd S N)r   ).0r   r   r   r   r   	<genexpr>0       z&_pairwise_broadcast.<locals>.<genexpr>)maptuplelenzip)Zshape1Zshape2r   r   r   _pairwise_broadcast"   s    

r   c                  G   sj   | sJ | d }| dd }z$t |ddD ]\}}t||}q*W n  ty`   td|Y n0 |S dS )r   r   r   N)startz!failed to broadcast argument #{0})	enumerater   r   r   )	shapelistresultZothersiZeachr   r   r   _multi_broadcast3   s    r#   c                   @   s   e Zd ZdZdZdZdd Zdd Zdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zedd Zdd Zd d! Zd"d# Zd$d% ZdS )&UFuncMechanismz0
    Prepare ufunc arguments for vectorize.
    NFc                 C   s>   || _ || _t| j}dg| | _g | _d| _dg| | _dS )zFNever used directly by user. Invoke by UFuncMechanism.call().
        N)typemapargsr   argtypes	scalarposr   arrays)selfr%   r&   nargsr   r   r   __init__M   s    
zUFuncMechanism.__init__c                 C   sf   t | jD ]V\}}| |r.| || j|< q
t|tttt	j
frP| j| q
t	|| j|< q
dS )z1
        Get all arguments in array form
        N)r   r&   is_device_arrayas_device_arrayr)   
isinstanceintfloatcomplexnpZnumberr(   appendasarray)r*   r"   argr   r   r   _fill_arraysX   s    
zUFuncMechanism._fill_arraysc                 C   s2   t | jD ]"\}}|dur
t|j| j|< q
dS )z
        Get dtypes
        N)r   r)   r3   r5   dtyper'   )r*   r"   aryr   r   r   _fill_argtypese   s    zUFuncMechanism._fill_argtypesc                 C   s   g }| j rr| jD ]`}g }tt|| jD ]4\}\}}|du rNt| j| j}|	||k q(t
|r|	| q|sg }| jD ],}t
dd t|| jD }|r|	| q|stdt|dkrtd|d | _dS )z<Resolve signature.
        May have ambiguous case.
        Nc                 s   s"   | ]\}}|d u p||kV  qd S r   r   )r   formalactualr   r   r   r      s   z4UFuncMechanism._resolve_signature.<locals>.<genexpr>zNo matching version.  GPU ufunc requires array arguments to have the exact types.  This behaves like regular ufunc with casting='no'.r   zqFailed to resolve ufunc due to ambiguous signature. Too many untyped scalars. Use numpy dtype object to type tag.r   )r(   r%   r   r   r'   r3   r5   r&   r8   r4   all	TypeErrorr   )r*   ZmatchesZ	formaltysZ	match_mapr"   r;   r<   Zall_matchesr   r   r   _resolve_signaturem   s2    


z!UFuncMechanism._resolve_signaturec                 C   s4   | j D ]&}tj| j| g| j| d| j|< q| jS )zPReturn the actual arguments
        Casts scalar arguments to np.array.
        r8   )r(   r3   Zarrayr&   r'   r)   )r*   r"   r   r   r   _get_actual_args   s    
$zUFuncMechanism._get_actual_argsc           	         s   dd |D }t | t|D ]\}  jkr2q|  rN|  ||< q fddttD }tt j }dg| t j }|D ]}d||< qt	j
jj |d}| |||< q|S )z)Perform numpy ufunc broadcasting
        c                 S   s   g | ]
}|j qS r   shaper   r   r   r   r   
<listcomp>   r   z-UFuncMechanism._broadcast.<locals>.<listcomp>c                    s,   g | ]$}| j ks$ j| | kr|qS r   )ndimrC   )r   axr9   rC   r   r   rE      s   
r   )rC   strides)r#   r   rC   r-   broadcast_deviceranger   listrI   r3   libZstride_tricksZ
as_stridedforce_array_layout)	r*   arysr    r"   Z
ax_differsZ
missingdimrI   rG   Zstridedr   rH   r   
_broadcast   s$    



zUFuncMechanism._broadcastc                 C   s*   |    |   |   |  }| |S )z[Prepare and return the arguments for the ufunc.
        Does not call to_device().
        )r7   r:   r?   rA   rP   )r*   rO   r   r   r   get_arguments   s
    zUFuncMechanism.get_argumentsc                 C   s   | j | j S )z)Returns (result_dtype, function)
        )r%   r'   r*   r   r   r   get_function   s    zUFuncMechanism.get_functionc                 C   s   dS )zBIs the `obj` a device array?
        Override in subclass
        Fr   r*   objr   r   r   r-      s    zUFuncMechanism.is_device_arrayc                 C   s   |S )zConvert the `obj` to a device array
        Override in subclass

        Default implementation is an identity function
        r   rT   r   r   r   r.      s    zUFuncMechanism.as_device_arrayc                 C   s   t ddS )zTHandles ondevice broadcasting

        Override in subclass to add support.
        z'broadcasting on device is not supportedNNotImplementedErrorr*   r9   rC   r   r   r   rJ      s    zUFuncMechanism.broadcast_devicec                 C   s   |S )zSEnsures array layout met device requirement.

        Override in sublcass
        r   )r*   r9   r   r   r   rN      s    z!UFuncMechanism.force_array_layoutc                    s  | d| j| dd}|r2tdd|  | || } \}}|d j}|durv|rv	|}fdd |d j
d	kr fd
d|D }g }d}	|D ]6}
|
r||
 d}	qj|
d}|| q|d j}|du rLj||d}||g ||d | |	r<||S | |S n|r|j
d	krl |}|}||g ||d | ||S |j|ksJ |j|ksJ j||d}||g ||d | |j|d|S dS )z1Perform the entire ufunc call mechanism.
        streamoutNzunrecognized keywords: %s, r   c                    sZ    j r
tz
|  W S  tyT    | s0 n  |  } | Y S Y n0 d S r   )SUPPORT_DEVICE_SLICINGrW   Zravelr-   to_host	to_device)r   hostary)crrY   r   r   attempt_ravel  s    

z*UFuncMechanism.call.<locals>.attempt_ravelr   c                    s   g | ]} |qS r   r   rD   )ra   r   r   rE     r   z'UFuncMechanism.call.<locals>.<listcomp>FT)rY   )popDEFAULT_STREAMwarningswarnjoinrQ   rS   rC   r-   r.   rF   r4   r^   device_arrayextendlaunchreshapeZcopy_to_hostr8   )clsr%   r&   kwsrZ   ZrestyfuncZoutshapeZdevarysZ
any_devicer   Zdev_arC   Zdevoutr   )ra   r`   rY   r   call   sT    








zUFuncMechanism.callc                 C   s   t dS )zBImplement to device transfer
        Override in subclass
        NrV   )r*   r_   rY   r   r   r   r^   G  s    zUFuncMechanism.to_devicec                 C   s   t dS )z@Implement to host transfer
        Override in subclass
        NrV   )r*   devaryrY   r   r   r   r]   M  s    zUFuncMechanism.to_hostc                 C   s   t dS )zBImplements device allocation
        Override in subclass
        NrV   )r*   rC   r8   rY   r   r   r   rg   S  s    zUFuncMechanism.device_arrayc                 C   s   t dS )zKImplements device function invocation
        Override in subclass
        NrV   )r*   rm   countrY   r&   r   r   r   ri   Y  s    zUFuncMechanism.launch)__name__
__module____qualname____doc__rc   r\   r,   r7   r:   r?   rA   rP   rQ   rS   r-   r.   rJ   rN   classmethodrn   r^   r]   rg   ri   r   r   r   r   r$   F   s*   +	!

Yr$   c                 C   s   t t| S r   r3   r8   str)Ztyr   r   r   to_dtype`  s    rx   c                   @   sZ   e Zd Zddi fddZedd ZdddZd	d
 Zdd Zdd Z	dd Z
dd ZdS )DeviceVectorizeNFc                 C   s`   |rt d|D ]2}|dkr*tdt qd}|d7 }t|| q|| _t|| _t | _	d S )Ncaching is not supportednopythonz+nopython kwarg for cuda target is redundantzUnrecognized options. z3cuda vectorize target does not support option: '%s')
r>   rd   re   RuntimeWarningKeyErrorpy_funcr   identityr   	kernelmap)r*   rm   r   cachetargetoptionsZoptfmtr   r   r   r,   e  s    
zDeviceVectorize.__init__c                 C   s   | j S r   r~   rR   r   r   r   pyfuncu  s    zDeviceVectorize.pyfuncc                 C   s
  |d ur:t dt |d u s J |d u r2t|}n|| }~~t|\}}t|g|R  }| jj}| 	| j
||}| |\}	}| |	}
ttjgdd |D |d d  g R  }t||
 |
d|  }| ||}tdd |jD }t|}||f| jt|< d S )N'Keyword argument argtypes is deprecatedc                 S   s   g | ]}|d d  qS r   r   rD   r   r   r   rE     r   z'DeviceVectorize.add.<locals>.<listcomp>z__vectorized_%sc                 s   s   | ]}t |V  qd S r   )rx   r   tr   r   r   r     r   z&DeviceVectorize.add.<locals>.<genexpr>)rd   re   DeprecationWarningr   r   normalize_signaturer   r   rq   _get_kernel_source_kernel_template_compile_core_get_globalsr   Zvoidexec_compile_kernelr&   rx   r   )r*   sigr'   restyper&   return_typeZdevfnsigfuncnameZkernelsourcecorefnZglblZstagerkernelZ	argdtypesZresdtyper   r   r   addy  s2    

*
zDeviceVectorize.addc                 C   s   t d S r   rV   rR   r   r   r   build_ufunc  s    zDeviceVectorize.build_ufuncc                 C   sL   dd t t|jD }t|d|ddd |D d}|jf i |S )Nc                 S   s   g | ]}d | qS )za%dr   r   r"   r   r   r   rE     r   z6DeviceVectorize._get_kernel_source.<locals>.<listcomp>r[   c                 s   s   | ]}d | V  qdS )z%s[__tid__]Nr   r   r   r   r   r     r   z5DeviceVectorize._get_kernel_source.<locals>.<genexpr>)namer&   argitems)rK   r   r&   dictrf   r   )r*   templater   r   r&   Zfmtsr   r   r   r     s    z"DeviceVectorize._get_kernel_sourcec                 C   s   t d S r   rV   r*   r   r   r   r   r     s    zDeviceVectorize._compile_corec                 C   s   t d S r   rV   )r*   r   r   r   r   r     s    zDeviceVectorize._get_globalsc                 C   s   t d S r   rV   r*   fnobjr   r   r   r   r     s    zDeviceVectorize._compile_kernel)NNN)rq   rr   rs   r,   propertyr   r   r   r   r   r   r   r   r   r   r   ry   d  s   

 ry   c                   @   sB   e Zd Zddi fddZedd ZdddZd	d
 Zdd ZdS )DeviceGUFuncVectorizeNFc                 C   s   |rt d|dds t d|rNddd | D }d}t |||| _t|| _|| _t	| j\| _
| _t| jd	ksJ d
t | _d S )Nrz   r{   Tznopython flag must be Truer[   c                 S   s   g | ]}t |qS r   )reprr   kr   r   r   rE     r   z2DeviceGUFuncVectorize.__init__.<locals>.<listcomp>z3The following target options are not supported: {0}r   zonly support 1 output)r>   rb   rf   keysr   r~   r   r   r   r
   inputsig	outputsigr   r   r   )r*   rm   r   r   r   r   Zoptsr   r   r   r   r,     s    
zDeviceGUFuncVectorize.__init__c                 C   s   | j S r   r   rR   r   r   r   r     s    zDeviceGUFuncVectorize.pyfuncc                 C   s  |d ur:t dt |d u s J |d u r2t|}n|| }~~dd | jD }dd | jD }t|\}}| jj	}t
| j||||}	| |}
t|	|
 |
dj|d }tt||| }| j|t|d}tdd	 |D }|d
 |f| jt|d d
 < d S )Nr   c                 S   s   g | ]}t |qS r   r   r   xr   r   r   rE     r   z-DeviceGUFuncVectorize.add.<locals>.<listcomp>c                 S   s   g | ]}t |qS r   r   r   r   r   r   rE     r   z__gufunc_{name})r   )r   c                 s   s   | ]}t t|jV  qd S r   rv   r   r   r   r   r     r   z,DeviceGUFuncVectorize.add.<locals>.<genexpr>)rd   re   r   r   r   r   r   r   r~   rq   expand_gufunc_templater   r   r   r   rL   _determine_gufunc_outer_typesr   r   )r*   r   r'   r   indimsoutdimsr&   r   r   srcZglblsr   Zoutertysr   Zdtypesr   r   r   r     s0    


zDeviceGUFuncVectorize.addc                 C   s   t d S r   rV   r   r   r   r   r     s    z%DeviceGUFuncVectorize._compile_kernelc                 C   s   t d S r   rV   r   r   r   r   r     s    z"DeviceGUFuncVectorize._get_globals)NNN)	rq   rr   rs   r,   r   r   r   r   r   r   r   r   r   r     s   

 r   c                 c   sZ   t | |D ]J\}}t|tjr2|j|d dV  q
|dkrBtdtj|dddV  q
d S )Nr   )rF   r   z,gufunc signature mismatch: ndim>0 for scalarA)r8   rF   Zlayout)r   r/   r   Arraycopyr   )ZargtysZdimsZatZndr   r   r   r     s    r   c                 C   s   || }dd t t|D }dddd |D }dd t|||D }dd t|t|d ||t|d D }	||	 }
| j|d||d|
d	}|S )
z"Expand gufunc source template
    c                 S   s   g | ]}d  |qS )zarg{0}r   r   r   r   r   rE     r   z*expand_gufunc_template.<locals>.<listcomp>zmin({0})r[   c                 S   s   g | ]}d  |qS )z{0}.shape[0]r   rD   r   r   r   rE     s   c                 S   s   g | ]\}}}t |||qS r   _gen_src_for_indexingr   arefadimsatyper   r   r   rE     s   c                 S   s   g | ]\}}}t |||qS r   r   r   r   r   r   rE      s   N)r   r&   
checkedargr   )rK   r   r   rf   r   )r   r   r   r   r'   ZargdimsZargnamesr   inputsZoutputsr   r   r   r   r   r     s&    

r   c                 C   s   dj | t||dS )Nz{aref}[{sliced}])r   Zsliced)r   _gen_src_index)r   r   r   r   r   r   r   
  s    r   c                 C   sD   | dkrd dgdg|   S t|tjr<|jd | kr<dS dS d S )Nr   ,Z__tid__:r   z__tid__:(__tid__ + 1))rf   r/   r   r   rF   )r   r   r   r   r   r     s
    r   c                   @   s,   e Zd ZdZedd Zdd Zdd ZdS )	GUFuncEnginezZDetermine how to broadcast and execute a gufunc
    base on input shape and signature
    c                 C   s   | t | S r   r	   )rk   r   r   r   r   from_signature   s    zGUFuncEngine.from_signaturec                 C   s(   || _ || _t| j | _t| j| _d S r   )sinsoutr   ninnout)r*   r   r   r   r   r   r,   $  s    zGUFuncEngine.__init__c                 C   s  t || jkrtdi }g }g }tt|| jD ]\}\}}|d7 }t |}t ||k rld}	t|	|f |r|| d  }
|d |  }nd}
|}tt|
|D ]H\}\}}|t |7 }||v r|| |krd}	t|	||f |||< q|| ||
 q2g }| jD ]2}g }|D ]}|||  q|t	| qdd |D }t
|}|| }dg| j }t|D ]H\}}||krv|d	ks|dkrd
||< nd}	t|	|d f qvt| ||||S )Nz invalid number of input argumentr   z%arg #%d: insufficient inner dimensionr   z$arg #%d: shape[%d] mismatch argumentc                 S   s   g | ]}t tj|d qS r   )r   operatormulr   sr   r   r   rE   V  r   z)GUFuncEngine.schedule.<locals>.<listcomp>Fr   Tz!arg #%d: outer dimension mismatch)r   r   r>   r   r   r   r   r4   r   r   r3   ZargmaxGUFuncSchedule)r*   ishapesZ	symbolmapZouter_shapesZinner_shapesZargnrC   ZsymbolsZ
inner_ndimr   Zinner_shapeZouter_shapeZaxisZdimZsymoshapesZoutsigZoshapeZsizesZ	largest_iloopdimspinnedr"   dr   r   r   schedule,  sT    





zGUFuncEngine.scheduleN)rq   rr   rs   rt   ru   r   r,   r   r   r   r   r   r     s
   
r   c                   @   s   e Zd Zdd Zdd ZdS )r   c                    sF   || _ || _|| _ | _ttj d| _|| _ fdd|D | _	d S )Nr   c                    s   g | ]} | qS r   r   r   r   r   r   rE   r  r   z+GUFuncSchedule.__init__.<locals>.<listcomp>)
parentr   r   r   r   r   r   loopnr   output_shapes)r*   r   r   r   r   r   r   r   r   r,   g  s    zGUFuncSchedule.__init__c                    s,   dd l }d} fdd|D }|t|S )Nr   )r   r   r   r   r   c                    s   g | ]}|t  |fqS r   )getattrr   rR   r   r   rE   x  r   z*GUFuncSchedule.__str__.<locals>.<listcomp>)pprintZpformatr   )r*   r   attrsvaluesr   rR   r   __str__t  s    zGUFuncSchedule.__str__N)rq   rr   rs   r,   r   r   r   r   r   r   f  s   r   c                   @   sL   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dS )GenerializedUFuncc                 C   s*   || _ || _d| _| jjdks&J dd S )Ni   @r   zonly support single output)r   engineZmax_blocksizer   )r*   r   r   r   r   r   r,   }  s    zGenerializedUFunc.__init__c           
      O   s   |  | jj| jj||}|  | |j|j\}}}}|| |	|| |
  | ||j|j\}}	|||j||	g  | S r   )Z_call_stepsr   r   r   prepare_inputs	_schedulenorm_inputsoutputadjust_input_typesallocate_outputsprepare_kernel_parametersrP   kernel_parameterskernel_returnvaluelaunch_kernelr   post_process_result)
r*   r&   rl   Z	callstepsindtypesr   outdtyper   	newparams	newretvalr   r   r   __call__  s     
zGenerializedUFunc.__call__c                 C   s   dd |D }| j |}tdd |D }z| j| \}}W n* tyh   | |}| j| \}}Y n0 |d ur|jd |jkrtd||||fS )Nc                 S   s   g | ]
}|j qS r   rB   rD   r   r   r   rE     r   z/GenerializedUFunc._schedule.<locals>.<listcomp>c                 s   s   | ]}|j V  qd S r   r@   r   r   r   r   r     r   z.GenerializedUFunc._schedule.<locals>.<genexpr>r   zoutput shape mismatch)	r   r   r   r   r}   _search_matching_signaturer   rC   r   )r*   r   rZ   Zinput_shapesr   idtypesr   r   r   r   r   r     s    
zGenerializedUFunc._schedulec                 C   s<   | j  D ]$}tdd t||D r
|  S q
tddS )z
        Given the input types in `idtypes`, return a compatible sequence of
        types that is defined in `kernelmap`.

        Note: Ordering is guaranteed by `kernelmap` being a OrderedDict
        c                 s   s   | ]\}}t ||V  qd S r   )r3   Zcan_cast)r   r<   Zdesiredr   r   r   r     s   z?GenerializedUFunc._search_matching_signature.<locals>.<genexpr>zno matching signatureN)r   r   r=   r   r>   )r*   r   r   r   r   r   r     s    
z,GenerializedUFunc._search_matching_signaturec           
      C   s   |j dksJ d|jsdn|j }g }t||jD ]B\}}|s`|jdkr`| ||}|| q2|| ||| q2|j|g|j	d R  }	||	fS )Nr   zzero looping dimensionr   )
r   r   r   r   size_broadcast_scalar_inputr4   _broadcast_arrayrj   r   )
r*   r   paramsretvalZodimr   pZcsro   r   r   r   r   rP     s    zGenerializedUFunc._broadcastc                 C   sf   |f| }|j |kr|S t|j t|k rX|t|j  d  |j ksLJ d| ||S |j| S d S )Nz+cannot add dim and reshape at the same time)rC   r   _broadcast_add_axisrj   )r*   r9   ZnewdimZinnerdimnewshaper   r   r   r     s    

z"GenerializedUFunc._broadcast_arrayc                 C   s   t dd S )Nzcannot add new axisrV   )r*   r9   r   r   r   r   r     s    z%GenerializedUFunc._broadcast_add_axisc                 C   s   t d S r   rV   rX   r   r   r   r     s    z)GenerializedUFunc._broadcast_scalar_inputN)rq   rr   rs   r,   r   r   r   rP   r   r   r   r   r   r   r   r   |  s   r   c                   @   sl   e Zd Zg dZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd Zdd Zdd Zdd ZdS )GUFuncCallSteps)r&   kwargsr   r   r   r   _is_device_array_need_device_conversionc           
         s   |dkrt d| _| _d} jd _ jd urV  j}|rV  j _ fdd jD  _t j o||  _	g }t
 j jD ].\}}|r| | q|t| q|d |  _||d  }	|	r jd urt dn|	\ _d S )Nr   z multiple output is not supportedFrZ   c                    s   g | ]}  |qS r   r-   rD   rR   r   r   rE     r   z,GUFuncCallSteps.__init__.<locals>.<listcomp>z>cannot specify 'out' as both a positional and keyword argument)r   r&   r   getr   r-   r.   r   anyr   r   r4   r3   r5   r   )
r*   r   r   r&   r   Zuser_output_is_devicer   r   isdevZunused_inputsr   rR   r   r,     s2    


zGUFuncCallSteps.__init__c                 C   s\   t t|| jD ]F\}\}}||jkrt|dsFdt|}t|||| j|< qdS )z
        Attempt to cast the inputs to the required types if necessary
        and if they are not device array.

        Side effect: Only affects the element of `norm_inputs` that requires
        a type cast.
        astypezNcompatible signature is possible by casting but {0} does not support .astype()N)	r   r   r   r8   hasattrr   typer>   r   )r*   r   r"   Zityvalmsgr   r   r   r   
  s    

z"GUFuncCallSteps.adjust_input_typesc                 C   s6   | j s| jd u r&| j|jd |d}n| j}|| _d S )Nr   )rC   r8   )r   r   rg   r   r   )r*   r   r   r   r   r   r   r     s    z GUFuncCallSteps.allocate_outputsc                    s`   g }t  j jD ](\}}|r*|| q| | qt fdd|D sVJ | _d S )Nc                 3   s   | ]}  |V  qd S r   r   rD   rR   r   r   r   +  r   z<GUFuncCallSteps.prepare_kernel_parameters.<locals>.<genexpr>)r   r   r   r4   r^   r=   r   )r*   r   Zinpr   r   rR   r   r   $  s    z)GUFuncCallSteps.prepare_kernel_parametersc                 C   s4   | j r| | j| j}n| jd u r*| j}n| j}|S r   )r   r]   r   r   )r*   rZ   r   r   r   r   .  s    
z#GUFuncCallSteps.post_process_resultc                 C   s   d S r   r   rR   r   r   r   r   7  s    zGUFuncCallSteps.prepare_inputsc                 C   s   t d S r   rV   )r*   r   Znelemr&   r   r   r   r   :  s    zGUFuncCallSteps.launch_kernelc                 C   s   t d S r   rV   rT   r   r   r   r-   =  s    zGUFuncCallSteps.is_device_arrayc                 C   s   |S r   r   rT   r   r   r   r.   @  s    zGUFuncCallSteps.as_device_arrayc                 C   s   t d S r   rV   )r*   r_   r   r   r   r^   C  s    zGUFuncCallSteps.to_devicec                 C   s   t d S r   rV   )r*   rC   r8   r   r   r   rg   F  s    zGUFuncCallSteps.device_arrayN)rq   rr   rs   	__slots__r,   r   r   r   r   r   r   r-   r.   r^   rg   r   r   r   r   r     s   !	
	r   )#rt   collectionsr   r   rd   	functoolsr   Znumpyr3   Znumba.np.ufunc.ufuncbuilderr   r   Z
numba.corer   r   Znumba.core.typingr   Znumba.np.ufunc.sigparser
   r   r   r#   objectr$   rx   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   s4     I@
Ka