+
    :i)                     $   ^ RI t^ RIHtHt ^ RIHtHt ^ RIHtH	t	 ]P                  '       d   ]	P                  ]	P                  3tM#]	P                  ]	P                  ]	P                  3t ! R R]4      t]R8X  d   ]P"                  ! 4        R# R# )    N)unittestCUDATestCase)skip_on_cudasimskip_unless_cudasim)configcudac                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR t]! R4      R 4       t]! R4      R 4       tR t]! R4      R 4       tRtV tR# )TestCudaArrayc                   \         P                  ! ^ 4      p\        P                  ! V4      pVP	                  4       pV P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       R# )r   N)nparanger   	to_devicecopy_to_hostassertEqualshapesize)selfxdxhxs   &   `/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/cuda/tests/cudapy/test_array.pytest_gpu_array_zero_length(TestCudaArray.test_gpu_array_zero_length   s    IIaL^^A__"((+)"((+)    c                    Rp\         P                  ! R4      P                  p\         P                  ! \        P
                  ! R4      4      P                  pV P                  W!4       V P                  W14       R # )N )r   device_arrayr   device_array_liker   ndarrayr   )r   
null_shapeshape1shape2s   &   r   test_null_shapeTestCudaArray.test_null_shape   sW    
""2&,,''

27==,,r   c           
        \         P                  ! R 4      R 4       p\        P                  ! ^
\        P                  R7      p\        P
                  ! ^PV\        P                  R7      p\        P
                  ! ^	V^R \        P                  R7      pVR,          ! V4       V P                  \        P                  ! V\        \        ^	4      4      4      4       R# )zvoid(double[:])c                 l    \         P                  ! ^4      pWP                  ^ ,          8  d   WV&   R# R#    Nr   gridr   )r   is   & r   kernel4TestCudaArray.test_gpu_array_strided.<locals>.kernel"   s(    		!A771:~! r   dtype)r   bufferr/   )r0   r/   N)
   r2   )r   jitr   r   doubler   byte
assertTrueallcloselistrange)r   r,   r   yzs   &    r   test_gpu_array_strided$TestCudaArray.test_gpu_array_strided    s    	#	$	 
%	
 IIb		*JJVARWW=JJq1R		:vqAtE!H~67r   c                   \         P                  ! R 4      R 4       p\        P                  ! ^
\        P                  R7      pVRR^1,          p \         P
                  P                  V4       \        R4      h  \         d     R# i ; i)zvoid(double[:], double[:])c                 t    \         P                  ! ^4      pW P                  ^ ,          8  d   W V&   W!V&   R# R# r'   r)   )r   r:   r+   s   && r   
copykernel<TestCudaArray.test_gpu_array_interleaved.<locals>.copykernel0   s/    		!A771:~!! r   r.   NzDShould raise exception complaining the contiguous-ness of the array.)	r   r3   r   r   r4   devicearrayauto_deviceAssertionError
ValueError)r   r@   r   r:   s   &   r   test_gpu_array_interleaved(TestCudaArray.test_gpu_array_interleaved.   s    	.	/	 
0	 IIb		*er!eH	B((+ ! "A B B  		s   A: :B	B	c                    \         P                  P                  ^4      w  rV P                  \        P
                  ! VP                  4       \        P                  ! ^4      8H  4      4       R# )   N)r   rC   rD   r6   r   allr   array)r   d_s   &  r   test_auto_device_const$TestCudaArray.test_auto_device_constI   sC    ++A.q~~/288A;>?@r   c                   V! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  R,          VP                  R,          4       V P                  VP                  R,          VP                  R,          4       R# )zS
Tests of *_array_like where shape, strides, dtype, and flags should
all be equal.
C_CONTIGUOUSF_CONTIGUOUSN)r   r   stridesr/   flags)r   	like_funcrL   
array_likes   &&& r   _test_array_like_same#TestCudaArray._test_array_like_sameM   s    
 u%
j&6&67
(:(:;j&6&67^4#)).9	;^4#)).9	;r   c                    \         P                  ! ^
RR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; i)r2   CorderrV   Nr   r   ARRAY_LIKE_FUNCTIONSsubTestrX   r   d_arV   s   &  r   test_array_like_1d TestCudaArray.test_array_like_1d[   O    #.-I	22**9: 32 .222   AA-c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; ir2   r[   r\   r^   Nr2      r_   rb   s   &  r   test_array_like_2d TestCudaArray.test_array_like_2da   O    4-I	22**9: 32 .222rg   c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; iri   r_   rb   s   &  r   test_array_like_2d_transpose*TestCudaArray.test_array_like_2d_transposeg   rn   rg   c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; i)r2   r[   r\   r^   Nr2   rk      r_   rb   s   &  r   test_array_like_3d TestCudaArray.test_array_like_3dm   O    C8-I	22**9: 32 .222rg   c                    \         P                  ! ^
RR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; i)r2   Fr\   r^   Nr_   rb   s   &  r   test_array_like_1d_f"TestCudaArray.test_array_like_1d_fs   rf   rg   c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; ir2   ry   r\   r^   Nrj   r_   rb   s   &  r   test_array_like_2d_f"TestCudaArray.test_array_like_2d_fy   rn   rg   c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; ir}   r_   rb   s   &  r   test_array_like_2d_f_transpose,TestCudaArray.test_array_like_2d_f_transpose   rn   rg   c                    \         P                  ! RRR7      p\         F7  pV P                  VR7      ;_uu_ 4        V P	                  W!4       RRR4       K9  	  R#   + '       g   i     KN  ; i)r2   ry   r\   r^   Nrs   r_   rb   s   &  r   test_array_like_3d_f"TestCudaArray.test_array_like_3d_f   rw   rg   c                   V! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       \        P                  ! V4      pV P                  VP
                  VP
                  4       V P                  VP                  R,          VP                  R,          4       V P                  VP                  R,          VP                  R,          4       R# )z
Tests of device_array_like where the original array is a view - the
strides should not be equal because a contiguous array is expected.
rR   rS   N)r   r   r/   r   
zeros_likerT   rU   )r   rV   viewd_viewnb_likenp_likes   &&&&  r   _test_array_like_view#TestCudaArray._test_array_like_view   s    
 F#w}}5w}}5 --%'//:~6 ~6	8~6 ~6	8r   c                *   ^
p\         P                  ! V4      R,          p\        P                  ! V4      R,          p\         F8  pV P                  VR7      ;_uu_ 4        V P                  WBV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r2   NNrJ   r^   Nr   zerosr   r   r`   ra   r   r   r   r   r   rV   s   &    r   test_array_like_1d_view%TestCudaArray.test_array_like_1d_view   sk    xxs#""5)#.-I	22**9FC 32 .222    BBc                2   ^
p\         P                  ! VRR7      R,          p\        P                  ! VRR7      R,          p\         F8  pV P                  VR7      ;_uu_ 4        V P                  WBV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r2   ry   r\   r   r^   Nr   r   s   &    r   test_array_like_1d_view_f'TestCudaArray.test_array_like_1d_view_f   sp    xxS)#.""54S9-I	22**9FC 32 .222   $BBc                *   Rp\         P                  ! V4      R,          p\        P                  ! V4      R,          p\         F8  pV P                  VR7      ;_uu_ 4        V P                  WBV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r2   r^   Nrj   r   r   r   r   s   &    r   test_array_like_2d_view%TestCudaArray.test_array_like_2d_view   sk    xxx(""5)(3-I	22**9FC 32 .222r   c                2   Rp\         P                  ! VRR7      R,          p\        P                  ! VRR7      R,          p\         F8  pV P                  VR7      ;_uu_ 4        V P                  WBV4       RRR4       K:  	  R#   + '       g   i     KO  ; ir2   ry   r\   r^   Nrj   r   r   r   s   &    r   test_array_like_2d_view_f'TestCudaArray.test_array_like_2d_view_f   sp    xxS)(3""54X>-I	22**9FC 32 .222r   z5Numba and NumPy stride semantics differ for transposec                H   Rp\         P                  ! V4      R,          P                  p\         F  pV P	                  VR7      ;_uu_ 4        V! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  RVP                  4       V P                  VP                  R,          4       V P                  VP                  R,          4       RRR4       K  	  R#   + '       g   i     K  ; i)r2   r^   rR   rS   Nrj   r   )(      )r   r   Tr`   ra   r   r   r/   rT   r6   rU   assertFalse)r   r   r   rV   likes   &    r   (test_array_like_2d_view_transpose_device6TestCudaArray.test_array_like_2d_view_transpose_device   s    ""5)(355-I	22
 !(  tzz:  tzz:  $,,7

> :;  N!;< 32 .222s   B5DD!c                $   Rp\         P                  ! V4      R,          P                  p\        P                  ! V4      R,          P                  p\
         EF  pV P                  VR7      ;_uu_ 4        \         P                  ! V4      pV! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  R,          VP                  R,          4       V P                  VP                  R,          VP                  R,          4       RRR4       EK"  	  R#   + '       g   i     EK8  ; i)r2   r^   rR   rS   Nrj   r   )r   r   r   r   r   r`   ra   r   r   r   r/   rT   rU   )r   r   r   r   rV   r   r   s   &      r   +test_array_like_2d_view_transpose_simulator9TestCudaArray.test_array_like_2d_view_transpose_simulator   s    xxx(**""5)(355--I	22 ---#F+  w}}=  w}}=  '//B  ~!>!(~!>@  ~!>!(~!>@ 32 .222s   5C9E==Fc                Z   Rp\         P                  ! VRR7      R,          P                  p\        P                  ! VRR7      R,          P                  p\
         F8  pV P                  VR7      ;_uu_ 4        V P                  WBV4       RRR4       K:  	  R#   + '       g   i     KO  ; ir   )r   r   r   r   r   r`   ra   r   r   s   &    r   #test_array_like_2d_view_f_transpose1TestCudaArray.test_array_like_2d_view_f_transpose   s|    xxS)(355""54X>@@-I	22**9FC 32 .222s   8BB*z-Kernel overloads not created in the simulatorc                D   \         P                  R  4       p^p\        P                  ! V34      p\         P                  ! V4      p\        P
                  ! V34      pVR,          ! W54       VR,          ! WE4       V P                  ^\        VP                  4      4       R# )c                 T    \         P                  ! ^4      pW,          ^,          W&   R# r'   )r   r*   )Aoutr+   s   && r   func+TestCudaArray.test_issue_4628.<locals>.func   s    		!ATAXCFr   N)r(      )	r   r3   r   onesr   r   r   len	overloads)r   r   narc   results   &     r   test_issue_4628TestCudaArray.test_issue_4628   s~     
	 
	 GGQDMnnQ1$VQVS!C/0r   r   N)__name__
__module____qualname____firstlineno__r   r#   r<   rG   rO   rX   rd   rl   rp   ru   rz   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r
   r
      s     *-8B6A;;;;;;;;;8"DDDD LM= N=   % &@&@&D DE1 F1r   r
   __main__)numpyr   numba.cuda.testingr   r   r   r   numbar   r   ENABLE_CUDASIMr   pinned_array_liker`   mapped_array_liker
   r   mainr   r   r   <module>r      s     5 C  
 22D4J4JK 22D4J4J 224q1L q1h zMMO r   