
    
9j                    x    S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  SS	 jrS
 rg)    )annotationsN)_core)_fusion_interface)fusion)search)stream)runtimec           	     H
   Sn[        U5      nU[        [        [        [        4;   a:  [
        R                  " SU R                  S9n[
        R                  " XaUS9  SnSnGO?U[        R                  [        R                  4;   a0  UR                  n[
        R                  " XR                  U5      nSnO[        U[
        R                  5      (       a^  UR                   S:w  a  [#        S5      eUR                  n[
        R                  " XR                  U5      nUR%                  5       S   nSnOn[
        R&                  " U5      (       a&  Un[
        R                  " XR                  U5      nSnO-UR                  n[
        R                  " XR                  U5      nU(       d"  [)        SW< S	U R                  < S
U< S35      e[        R*                  " 5       (       aA  Uc  [,        R.                  " X5        g[        R0                  " [2        R4                  X1X 5        gU(       d  [7        [8        R:                  " [=        UR>                  5      [=        U R>                  5      SS9 V	V
s/ s H  u  pXS4;   PM     sn
n	5      (       d%  [#        SUR>                   SU R>                   35      eUR@                  U R@                  -
  nUS:  a#  UR%                  [C        [E        U5      5      5      nUb  [,        R.                  " XUS9  gU R                   S:X  a  gU(       a  [,        R.                  " X5        g[G        X5      (       Ga  [H        RJ                  (       a  URL                  U RL                  :w  a  URL                     U RN                  RQ                  URN                  URR                  5        [T        RV                  " 5       RY                  5       nSSS5        U RL                     [T        RV                  " 5       R[                  W5        SSS5        gU RN                  RQ                  URN                  URR                  5        gU RL                  n[H        R\                  " 5       n [H        R^                  " UR`                  5        URL                  U:w  a  URc                  5       n[,        R.                  " X5        [H        R^                  " U5        gs  sn
n	f ! , (       d  f       GN= f! , (       d  f       g= f! [H        R^                  " U5        f = f)aW  Copies values from one array to another with broadcasting.

This function can be called for arrays on different devices. In this case,
casting, ``where``, and broadcasting is not supported, and an exception is
raised if these are used.

Args:
    dst (cupy.ndarray): Target array.
    src (cupy.ndarray): Source array.
    casting (str): Casting rule. See :func:`numpy.can_cast` for detail.
    where (cupy.ndarray of bool): If specified, this array acts as a mask,
        and an element is copied only if the corresponding element of
        ``where`` is True.

.. seealso:: :func:`numpy.copyto`

F )dtype)castingT   z2non-scalar numpy.ndarray cannot be used for copytozCannot cast z to z in z casting modeN)	fillvaluez+could not broadcast input array from shape z into shape r   )_where)2typeboolintfloatcomplexnumpyemptyr   copytor   _FusionVarScalarr   _ScalarProxycan_cast
isinstancendarraysize
ValueErrorsqueezeisscalar	TypeError
_is_fusingr   elementwise_copy_call_ufuncr   _where_ufuncall	itertoolszip_longestreversedshapendimtuplerange_can_memcpyr	   is_hipdevicedatacopy_from_asyncnbytesr   get_current_streamrecord
wait_event	getDevice	setDeviceidcopy)dstsrcr   wheresrc_is_scalarsrc_typedst_arrr   	src_dtypesdsqueeze_ndim
copy_eventr1   prev_devices                  R/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_manipulation/basic.pyr   r      s   $ MCyHD#ug..++b		2 	W73	f--/@/M/MN	NII	>>)YY@	C	'	'88q=DF FII	>>#yy':kkmB				>>#yy':II	>>)YY@"CIIw8 9 	9 
 =""3, 	 v22EI
 !--#Xcii%8AG
G QKG
  
 !ii[SYYKAB B xx#((*!++eE,$789Cs6
xx1}s(3>>cjjCJJ6 ((3::>#668??A
  ))+66zB  	 HH$$SXXszz:ZZF##%K'&))$::((*Cs(+&e
B   	 	+&s,   0S 

AS&2%S83AT	 &
S58
T	T!c                d   U R                   R                  =(       a    UR                   R                  nU R                   R                  =(       a    UR                   R                  nU=(       d    U=(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ )N)flagsc_contiguousf_contiguousr   r   )r<   r=   rK   rL   s       rH   r/   r/      st    99))Dcii.D.DL99))Dcii.D.DL(L cii399.D CHH    )	same_kindN)
__future__r   r(   r   cupyr   
cupy._corer   r   cupy._sortingr   	cupy.cudar   cupy_backends.cuda.apir	   r   r/   r   rM   rH   <module>rU      s,    "    (     *v'rrM   