U
    ,d0n                     @   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   >/tmp/pip-unpacked-wheel-eu7e0c37/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   s     z&_pairwise_broadcast.<locals>.<genexpr>)maptuplelenzip)Zshape1Zshape2r   r   r   _pairwise_broadcast"   s    

r   c                  G   sl   | st | d }| dd }z$t|ddD ]\}}t||}q*W n" tk
rb   td|Y nX |S dS )r   r   r   N)startz!failed to broadcast argument #{0})AssertionError	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npnumberr(   appendasarray)r*   r"   argr   r   r   _fill_arraysX   s    
zUFuncMechanism._fill_arraysc                 C   s2   t | jD ]"\}}|dk	r
t|j| j|< q
dS )z
        Get dtypes
        N)r   r)   r3   r6   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k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 k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   r6   r&   r9   r5   all	TypeErrorr   )r*   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.
        r9   )r(   r3   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>   s     z-UFuncMechanism._broadcast.<locals>.<listcomp>c                    s,   g | ]$}| j ks$ j| | kr|qS r   )ndimrF   )r   axr:   rF   r   r   rH      s    
r   )rF   strides)r#   r   rF   r-   broadcast_deviceranger   listrL   r3   libZstride_tricksZ
as_stridedforce_array_layout)	r*   arysr    r"   Z
ax_differsZ
missingdimrL   rJ   Zstridedr   rK   r   
_broadcast   s$    



zUFuncMechanism._broadcastc                 C   s*   |    |   |   |  }| |S )z[Prepare and return the arguments for the ufunc.
        Does not call to_device().
        )r8   r;   rA   rD   rS   )r*   rR   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   rW   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*   r:   rF   r   r   r   rM      s    zUFuncMechanism.broadcast_devicec                 C   s   |S )zSEnsures array layout met device requirement.

        Override in sublcass
        r   )r*   r:   r   r   r   rQ      s    z!UFuncMechanism.force_array_layoutc                    s  | d| j| dd}|r2tdd|  | || } \}}|d j}|dk	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krLj||d}||g ||d | |	r<||S | |S n|r|j
d	krl |}|}||g ||d | ||S |j|kst|j|kstj||d}||g ||d | |j|d|S dS )z1Perform the entire ufunc call mechanism.
        streamoutNzunrecognized keywords: %s, r   c                    s\    j r
tz
|  W S  tk
rV    | s2 n  |  } | Y S Y nX d S r   )SUPPORT_DEVICE_SLICINGrZ   Zravelr-   to_host	to_device)r   hostary)crr\   r   r   attempt_ravel  s    

z*UFuncMechanism.call.<locals>.attempt_ravelr   c                    s   g | ]} |qS r   r   rG   )rd   r   r   rH     s     z'UFuncMechanism.call.<locals>.<listcomp>FT)r\   )popDEFAULT_STREAMwarningswarnjoinrT   rV   rF   r-   r.   rI   r5   ra   device_arrayextendlaunchreshapeZcopy_to_hostr   r9   )clsr%   r&   kwsr]   ZrestyfuncZoutshapeZdevarysZ
any_devicer   Zdev_arF   Zdevoutr   )rd   rc   r\   r   call   sT    








zUFuncMechanism.callc                 C   s   t dS )zBImplement to device transfer
        Override in subclass
        NrY   )r*   rb   r\   r   r   r   ra   G  s    zUFuncMechanism.to_devicec                 C   s   t dS )z@Implement to host transfer
        Override in subclass
        NrY   )r*   devaryr\   r   r   r   r`   M  s    zUFuncMechanism.to_hostc                 C   s   t dS )zBImplements device allocation
        Override in subclass
        NrY   )r*   rF   r9   r\   r   r   r   rj   S  s    zUFuncMechanism.device_arrayc                 C   s   t dS )zKImplements device function invocation
        Override in subclass
        NrY   )r*   rp   countr\   r&   r   r   r   rl   Y  s    zUFuncMechanism.launch)__name__
__module____qualname____doc__rf   r_   r,   r8   r;   rA   rD   rS   rT   rV   r-   r.   rM   rQ   classmethodrq   ra   r`   rj   rl   r   r   r   r   r$   F   s*   +	!

Yr$   c                 C   s    t | tjr| j} tt| S r   )r/   r   Z
EnumMemberr9   r3   str)tyr   r   r   to_dtype`  s    r{   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?   rg   rh   RuntimeWarningKeyErrorpy_funcr   identityr   	kernelmap)r*   rp   r   cachetargetoptionsoptfmtr   r   r   r,   g  s    
zDeviceVectorize.__init__c                 C   s   | j S r   r   rU   r   r   r   pyfuncw  s    zDeviceVectorize.pyfuncc                 C   s  |d k	r:t dt |d ks t|d kr2t|}n|| }~~t|\}}t|f| }| jj	}| 
| j||}| |\}	}| |	}
ttjfdd |D |d d  g  }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   rG   r   r   r   rH     s     z'DeviceVectorize.add.<locals>.<listcomp>z__vectorized_%sc                 s   s   | ]}t |V  qd S r   )r{   r   tr   r   r   r     s     z&DeviceVectorize.add.<locals>.<genexpr>)rg   rh   DeprecationWarningr   r   r   normalize_signaturer   r   rt   _get_kernel_source_kernel_template_compile_core_get_globalsr   voidexec_compile_kernelr&   r{   r   )r*   sigr'   restyper&   return_typeZdevfnsigfuncnameZkernelsourcecorefnZglblZstagerkernelZ	argdtypesZresdtyper   r   r   add{  s4    
 
(
zDeviceVectorize.addc                 C   s   t d S r   rY   rU   r   r   r   build_ufunc  s    zDeviceVectorize.build_ufuncc                 C   sH   dd t t|jD }t|d|ddd |D d}|jf |S )Nc                 S   s   g | ]}d | qS )za%dr   r   r"   r   r   r   rH     s     z6DeviceVectorize._get_kernel_source.<locals>.<listcomp>r^   c                 s   s   | ]}d | V  qdS )z%s[__tid__]Nr   r   r   r   r   r     s     z5DeviceVectorize._get_kernel_source.<locals>.<genexpr>)namer&   argitems)rN   r   r&   dictri   r   )r*   templater   r   r&   Zfmtsr   r   r   r     s    z"DeviceVectorize._get_kernel_sourcec                 C   s   t d S r   rY   r*   r   r   r   r   r     s    zDeviceVectorize._compile_corec                 C   s   t d S r   rY   )r*   r   r   r   r   r     s    zDeviceVectorize._get_globalsc                 C   s   t d S r   rY   r*   fnobjr   r   r   r   r     s    zDeviceVectorize._compile_kernel)NNN)rt   ru   rv   r,   propertyr   r   r   r   r   r   r   r   r   r   r   r|   f  s   

 r|   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std
t | _d S )Nr}   r~   Tznopython flag must be Truer^   c                 S   s   g | ]}t |qS r   )reprr   kr   r   r   rH     s     z2DeviceGUFuncVectorize.__init__.<locals>.<listcomp>z3The following target options are not supported: {0}r   zonly support 1 output)r?   re   ri   keysr   r   r   r   r   r
   inputsig	outputsigr   r   r   r   )r*   rp   r   r   r   r   optsr   r   r   r   r,     s    
zDeviceGUFuncVectorize.__init__c                 C   s   | j S r   r   rU   r   r   r   r     s    zDeviceGUFuncVectorize.pyfuncc                 C   s  |d k	r:t dt |d ks t|d k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   rH     s     z-DeviceGUFuncVectorize.add.<locals>.<listcomp>c                 S   s   g | ]}t |qS r   r   r   r   r   r   rH     s     z__gufunc_{name})r   )r   c                 s   s   | ]}t t|jV  qd S r   )r3   r9   ry   r   r   r   r   r     s     z,DeviceGUFuncVectorize.add.<locals>.<genexpr>)rg   rh   r   r   r   r   r   r   r   r   rt   expand_gufunc_templater   r   r   r   rO   _determine_gufunc_outer_typesr   r   )r*   r   r'   r   indimsoutdimsr&   r   r   srcZglblsr   Zoutertysr   Zdtypesr   r   r   r     s4    
  

zDeviceGUFuncVectorize.addc                 C   s   t d S r   rY   r   r   r   r   r     s    z%DeviceGUFuncVectorize._compile_kernelc                 C   s   t d S r   rY   r   r   r   r   r     s    z"DeviceGUFuncVectorize._get_globals)NNN)	rt   ru   rv   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   )rI   r   z,gufunc signature mismatch: ndim>0 for scalarA)r9   rI   Zlayout)r   r/   r   Arraycopyr   )ZargtysZdims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   rH     s     z*expand_gufunc_template.<locals>.<listcomp>zmin({0})r^   c                 S   s   g | ]}d  |qS )z{0}.shape[0]r   rG   r   r   r   rH     s   c                 S   s   g | ]\}}}t |||qS r   _gen_src_for_indexingr   arefadimsatyper   r   r   rH      s   c                 S   s   g | ]\}}}t |||qS r   r   r   r   r   r   rH     s   N)r   r&   
checkedargr   )rN   r   r   ri   r   )r   r   r   r   r'   Zargdimsargnamesr   inputs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))ri   r/   r   r   rI   )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	   )rn   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 }||k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   rH   X  s     z)GUFuncEngine.schedule.<locals>.<listcomp>Fr   Tz!arg #%d: outer dimension mismatch)r   r   r?   r   r   r   r   r5   r   r   r3   ZargmaxGUFuncSchedule)r*   ishapesZ	symbolmapZouter_shapesZinner_shapesZargnrF   symbolsZ
inner_ndimr   Zinner_shapeZouter_shapeZaxisZdimsymoshapesZoutsigZoshapeZsizesZ	largest_iloopdimspinnedr"   dr   r   r   schedule.  sT    





zGUFuncEngine.scheduleN)rt   ru   rv   rw   rx   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   rH   t  s     z+GUFuncSchedule.__init__.<locals>.<listcomp>)
parentr   r   r   r   r   r   loopnr   output_shapes)r*   r   r   r   r   r   r   r   r   r,   i  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   rU   r   r   rH   z  s     z*GUFuncSchedule.__str__.<locals>.<listcomp>)pprintpformatr   )r*   r   attrsvaluesr   rU   r   __str__v  s    zGUFuncSchedule.__str__N)rt   ru   rv   r,   r   r   r   r   r   r   h  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&tdd S )Ni   @r   zonly support single output)r   engineZmax_blocksizer   r   )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_parametersrS   kernel_parameterskernel_returnvaluelaunch_kernelr   post_process_result)
r*   r&   ro   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k
rj   | |}| j| \}}Y nX |d k	r|jd |jkrtd||||fS )Nc                 S   s   g | ]
}|j qS r   rE   rG   r   r   r   rH     s     z/GenerializedUFunc._schedule.<locals>.<listcomp>c                 s   s   | ]}|j V  qd S r   rB   r   r   r   r   r     s     z.GenerializedUFunc._schedule.<locals>.<genexpr>r   zoutput shape mismatch)	r   r   r   r   r   _search_matching_signaturer   rF   r   )r*   r   r]   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td|jsdn|j }g }t||jD ]B\}}|s`|jdkr`| ||}|| q2|| ||| q2|j	|f|j
d  }	||	fS )Nr   zzero looping dimensionr   )r   r   r   r   r   size_broadcast_scalar_inputr5   _broadcast_arrayrm   r   )
r*   r   paramsretvalZodimr   pcsrr   r   r   r   r   rS     s    zGenerializedUFunc._broadcastc                 C   sf   |f| }|j |kr|S t|j t|k rX|t|j  d  |j ksLtd| ||S |j| S d S )Nz+cannot add dim and reshape at the same time)rF   r   r   _broadcast_add_axisrm   )r*   r:   ZnewdimZinnerdimnewshaper   r   r   r     s    

z"GenerializedUFunc._broadcast_arrayc                 C   s   t dd S )Nzcannot add new axisrY   )r*   r:   r  r   r   r   r    s    z%GenerializedUFunc._broadcast_add_axisc                 C   s   t d S r   rY   r[   r   r   r   r     s    z)GenerializedUFunc._broadcast_scalar_inputN)rt   ru   rv   r,   r   r   r   rS   r   r  r   r   r   r   r   r   ~  s   r   c                   @   sx   e Zd Zddddddddg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 ) GUFuncCallStepsr&   kwargsr   r   r   r   _is_device_array_need_device_conversionc           
         s   |dkrt d| _| _d} jd _ jd k	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 k	rt dn|	\ _d S )Nr   z multiple output is not supportedFr]   c                    s   g | ]}  |qS r   r-   rG   rU   r   r   rH     s     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   r5   r3   r6   r   )
r*   r   r   r&   r  Zuser_output_is_devicer   r   isdevZunused_inputsr   rU   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   r9   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 kr&| j|jd |d}n| j}|| _d S )Nr   )rF   r9   )r  r   rj   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 sVt| _d S )Nc                 3   s   | ]}  |V  qd S r   r  rG   rU   r   r   r   -  s     z<GUFuncCallSteps.prepare_kernel_parameters.<locals>.<genexpr>)r   r   r  r5   ra   r>   r   r   )r*   r   inpr  r   rU   r   r   &  s    z)GUFuncCallSteps.prepare_kernel_parametersc                 C   s4   | j r| | j| j}n| jd kr*| j}n| j}|S r   )r  r`   r   r   )r*   r]   r   r   r   r   0  s    
z#GUFuncCallSteps.post_process_resultc                 C   s   d S r   r   rU   r   r   r   r   9  s    zGUFuncCallSteps.prepare_inputsc                 C   s   t d S r   rY   )r*   r   Znelemr&   r   r   r   r   <  s    zGUFuncCallSteps.launch_kernelc                 C   s   t d S r   rY   rW   r   r   r   r-   ?  s    zGUFuncCallSteps.is_device_arrayc                 C   s   |S r   r   rW   r   r   r   r.   B  s    zGUFuncCallSteps.as_device_arrayc                 C   s   t d S r   rY   )r*   rb   r   r   r   ra   E  s    zGUFuncCallSteps.to_devicec                 C   s   t d S r   rY   )r*   rF   r9   r   r   r   rj   H  s    zGUFuncCallSteps.device_arrayN)rt   ru   rv   	__slots__r,   r   r   r   r   r   r   r-   r.   ra   rj   r   r   r   r   r    s(   !	
	r  )#rw   collectionsr   r   rg   	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$   r{   r|   r   r   r   r   r   r   r   r   r  r   r   r   r   <module>   s4     I@
Ka