+
    :i}                         ^ RI t^ RIHt ^ RIHtHtHt ^ RIH	t	  ! R R]4      t
]R8X  d   ]P                  ! 4        R# R# )    N)cuda)unittestxfail_unless_cudasimCUDATestCase)configc                   f   a a ] tR t^t oV 3R ltR tR tR tR tR t	R t
]R 4       tR	tVtV ;t# )
TestExceptionc                F   < \         SV `  4        V P                  R 4       R# )z!Exceptions not supported with LTON)supersetUpskip_if_lto)self	__class__s   &d/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/cuda/tests/cudapy/test_exception.pyr   TestException.setUp	   s     	<=    c                   R  p\         P                  ! V4      p\         P                  ! RRR7      ! V4      p\        P                  '       g&   VR,          ! \        P
                  ! ^ ^.4      4       V P                  \        4      ;_uu_ 4       pVR,          ! \        P
                  ! ^ ^.4      4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)c                 t    \         P                  P                  pV^8X  d   V P                  V) ,           R# R# )   N)r   	threadIdxxshape)aryr   s   & r   foo)TestException.test_exception.<locals>.foo   s.      AAv 		1"	 r   TFdebugoptNztuple index out of range)      )r   jitr   ENABLE_CUDASIMnparrayassertRaises
IndexErrorassertInstr	exception)r   r   
unsafe_foosafe_foocms   &    r   test_exceptionTestException.test_exception   s    	 XXc]
88$E237$$$ tRXXq!f-.z**bTN288QF+, +0#bll2CD +*s   &C%%C5	c                    \         P                  ! R RR7      R 4       pVR,          ! R4       V P                  \        4      ;_uu_ 4        VR,          ! R 4       RRR4       R#   + '       g   i     R# ; i)TFr   c                 "    V '       d   \         hR # N
ValueError)do_raises   &r   r   *TestException.test_user_raise.<locals>.foo%   s       r   Nr   r   )r   r!   r%   r3   )r   r   s   & r   test_user_raiseTestException.test_user_raise$   sX    	%	(	! 
)	! 	D	%z**IdO +***s   A%%A6	c                ^   V'       * p\         P                  ! WR7      R 4       p\         P                  R 4       p^ pR\        P                  ! V4      R,           ,          pR\        P                  ! V4      R,           ,          pV^V3,          ! Wg4       R\        P                  ! V4      R,           ,          pR\        P                  ! V4      R,           ,          p	V^V3,          ! W4       \        P                  P                  W4       \        P                  P                  W4       R# )zTesting issue #2655.

Exception raising code can cause the compiler to miss location
of unifying branch target and resulting in unexpected warp
divergence.
r   c                    \         P                  P                  p\         P                  P                  pV^8  d:   \	        V4       F*  pW;;,          W,          W,          ,          ,          uu&   K,  	  \         P
                  ! 4        V^8  d<   \	        V4       F*  pW;;,          W,          W,          ,          ,          uu&   K,  	  R# R#    Nr   r   r   blockDimrangesyncthreadsr   ytidntidis   &&   r   problematicBTestException.case_raise_causing_warp_diverge.<locals>.problematic7   s    ..""C==??DRxtADADADL(D % RxtADADADL(D % r   c                    \         P                  P                  p\         P                  P                  pV^8  dI   \	        V4       F9  pW,          ^ 8w  g   K  W;;,          W,          W,          ,          ,          uu&   K;  	  \         P
                  ! 4        V^8  dK   \	        V4       F9  pW,          ^ 8w  g   K  W;;,          W,          W,          ,          ,          uu&   K;  	  R# R# r;   r=   rA   s   &&   r   oracle=TestException.case_raise_causing_warp_diverge.<locals>.oracleE   s    ..""C==??DRxtAtqy, % RxtAtqy, % r   g      ?g{Gz?N)r   r!   r#   arangetestingassert_almost_equal)
r   with_debug_modewith_opt_moderF   rI   ngot_xgot_yexpect_xexpect_ys
   &&        r   case_raise_causing_warp_diverge-TestException.case_raise_causing_warp_diverge.   s     ,+		;	) 
<	) 
	- 
	- biilT)*biilT)*AqD%'1,-1,-q!tX(


&&x7


&&x7r   c                *    V P                  RR7       R# )z#Test case for issue #2655.
        F)rN   N)rU   )r   s   &r   test_raise_causing_warp_diverge-TestException.test_raise_causing_warp_divergea   s     	,,U,Cr   c                r   \         P                  R  4       p\        P                  ! ^4      p\        P                  ! ^4      p\        P                  ! ^4      pVR,          ! W#V4       V P                  \        P                  ! V^ ,          4      R4       V P                  V^,          V^ ,          R4       R# )c                 R    V^ ,          V^ ,          ,          V ^ &   V^ ,          V ^&   R# r   N rr   rB   s   &&&r   f4TestException.test_no_zero_division_error.<locals>.fm   $    Q4!A$;AaDQ4AaDr   zExpected inf from div by zerozExpected execution to continueNr6   )r   r!   r#   zerosones
assertTrueisinfassertEqual)r   r`   r_   r   rB   s   &    r   test_no_zero_division_error)TestException.test_no_zero_division_errori   s     
	 
	 HHQKHHQKGGAJ	$a1(GH1qt%EFr   c                   \         P                  ! R RR7      R 4       p\        P                  ! ^4      p\        P                  ! ^4      p\        P                  ! ^4      p\
        P                  '       d   \        pM\        pV P                  V4      ;_uu_ 4        VR,          ! W#V4       RRR4       V P                  V^ ,          ^ R4       V P                  V^,          ^ R4       R#   + '       g   i     LF; i)TFr   c                 R    V^ ,          V^ ,          ,          V ^ &   V^ ,          V ^&   R# r\   r]   r^   s   &&&r   r`   :TestException.test_zero_division_error_in_debug.<locals>.f   rb   r   Nz Expected result to be left unsetzExpected execution to stopr6   )r   r!   r#   rc   rd   r   r"   FloatingPointErrorZeroDivisionErrorr%   rg   )r   r`   r_   r   rB   excs   &     r   !test_zero_division_error_in_debug/TestException.test_zero_division_error_in_debug{   s     
%	(	 
)	 HHQKHHQKGGAJ    $C#Cs##dGA! $ 	1q"DE1q">?	 $#s   C,,C<	c                f  aa R o\         P                  ! RR7      V3R l4       o\         P                  ! RR7      V3R l4       pV P                  \        4      ;_uu_ 4       pVR,          ! 4        RRR4       V P	                  S\        XP                  4      4       R#   + '       g   i     L7; i)zDevice Function ErrorT)devicec                     < \        S 4      hr1   r2   )msgs   r   r`   6TestException.test_raise_in_device_function.<locals>.f   s    S/!r   )r   c                     < S ! 4        R # r1   r]   )r`   s   r   kernel;TestException.test_raise_in_device_function.<locals>.kernel   s    Cr   Nr6   )r   r!   r%   r3   r'   r(   r)   )r   rx   raisesr`   ru   s   &  @@r   test_raise_in_device_function+TestException.test_raise_in_device_function   s    
 &			" 
	" 
		 
	 z**f4LN + 	c3v//01 +*s   "B  B0	r]   )__name__
__module____qualname____firstlineno__r   r-   r7   rU   rX   rh   rp   r   r{   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r	   r	      sF     >E*18fDG$@: 2 2 2r   r	   __main__)numpyr#   numbar   numba.cuda.testingr   r   r   
numba.corer   r	   r}   mainr]   r   r   <module>r      s;      K K b2L b2J zMMO r   