+
    :ib"                     H   ^ RI t^ RIHt ^ RIHtHtHtHtH	t	H
t
HtHtHt ^ RIHt ^ RIHt ^ RIHtHtHt ^ RIHtHt ^ RIt^ RI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 R]4      t-].R8X  d   ]P^                  ! 4        R# R# )    N)compile_ptx)	f2i1i2i4i8u1u2u4u8)cuda)types)CUDATestCaseskip_on_cudasimskip_unless_cc_53)float16float32c                     \        V 4      # N)floatxs   &b/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/cuda/tests/cudapy/test_casting.pynative_castr      s    8O    c                 .    \         P                  ! V 4      # r   )npint8r   s   &r   to_int8r      s    771:r   c                 .    \         P                  ! V 4      # r   )r   int16r   s   &r   to_int16r"          88A;r   c                 .    \         P                  ! V 4      # r   )r   int32r   s   &r   to_int32r&      r#   r   c                 .    \         P                  ! V 4      # r   )r   int64r   s   &r   to_int64r)      r#   r   c                 .    \         P                  ! V 4      # r   )r   uint8r   s   &r   to_uint8r,   "   r#   r   c                 .    \         P                  ! V 4      # r   )r   uint16r   s   &r   	to_uint16r/   &   s    99Q<r   c                 .    \         P                  ! V 4      # r   )r   uint32r   s   &r   	to_uint32r2   *       <<?r   c                 .    \         P                  ! V 4      # r   )r   uint64r   s   &r   	to_uint64r6   .   r3   r   c                 d    \         P                  ! V 4      \         P                  ! R 4      ,          # )g      ?r   r   r   s   &r   
to_float16r9   2   s     JJqMBJJsO+,r   c                 d    \         P                  ! V 4      \         P                  ! ^4      ,          #    )r   r   r   s   &r   
to_float32r=   8       ::a=2::a=((r   c                 d    \         P                  ! V 4      \         P                  ! ^4      ,          # r;   )r   float64r   s   &r   
to_float64rA   <   r>   r   c                 .    \         P                  ! V 4      # r   )r   	complex64r   s   &r   to_complex64rD   @   s    <<?r   c                 .    \         P                  ! V 4      # r   )r   
complex128r   s   &r   to_complex128rG   D   s    ==r   c                 j    \         P                  P                  \        P                  ! V 4      ^4      # r;   r   fp16hmulr   r   r   s   &r   cuda_int_literal_to_float16rL   O   s!     99>>"**Q-++r   c                 d    \         P                  ! V 4      \         P                  ! ^4      ,          # r;   r8   r   s   &r    reference_int_literal_to_float16rN   U   r>   r   c                 j    \         P                  P                  \        P                  ! V 4      R 4      # g      @rI   r   s   &r   cuda_float_literal_to_float16rQ   Y   s!     99>>"**Q---r   c                 d    \         P                  ! V 4      \         P                  ! R 4      ,          # rP   r8   r   s   &r   "reference_float_literal_to_float16rS   _   s    ::a=2::c?**r   c                   .  a  ] tR t^ct o R t]R 4       t]! R4      R 4       t]R 4       t	]! R4      R 4       t
]R 4       t]R 4       t]! R4      R	 4       t]! R4      R
 4       t]R 4       t]! R4      R 4       t]R 4       t]! R4      R 4       tRtV tR# )TestCastingc                   aaaa \         P                  ! R R7      ! V4      o\         P                  V3R l4       oVVV3R lpV# )Tdevicec                 ,   < S! V ^ ,          4      V^ &   R# )r   N )argreswrapped_funcs   &&r   cuda_wrapper_fn4TestCasting._create_wrapped.<locals>.cuda_wrapper_fng   s    !#a&)CFr   c                    < \         P                  ! ^SR7      pW^ &   \         P                  ! ^SR7      pSR,          ! W4       V^ ,          # )   )dtype)ra   ra   )r   zeros)r[   argarrayresarrayr^   intypeouttypes   &  r   
wrapper_fn/TestCasting._create_wrapped.<locals>.wrapper_fnk   sA    xx0HQKxx1HD!(5A;r   )r   jit)selfpyfuncrf   rg   rh   r^   r]   s   &&ff @@r   _create_wrappedTestCasting._create_wrappedd   s9    xxt,V4		* 
	*	 r   c           
        \         \        \        \        3p\        P
                  \        P                  \        P                  \        P                  3p\        P                  \        P                  \        P                  3p\        W4       F  w  rEV F  pV P                  WeR 7      ;_uu_ 4        V P                  WFV4      pV P                  V! R4      V! R4      4       V P                  V! R4      \!        R4      4       V P                  V! R4      V! R4      4       V P                  V! R4      \!        R4      4       RRR4       K  	  K  	  R#   + '       g   i     K  ; i)fromtytoty皙(@N皙()r   r"   r&   r)   r   r   r!   r%   r(   r   r   r@   zipsubTestrm   assertEqualintrk   pyfuncstotysfromtysrl   rr   rq   cfuncs   &       r   test_float_to_intTestCasting.test_float_to_intt   s    Hh9"((BHHbhh7::rzz2::6/LF!\\\;; 00FE$$U4[&,?$$U4[#d)<$$U5\6%=A$$U5\3u:> <; " 0;;;s   3BE	E'z(Compilation unsupported in the simulatorc                    \         \        \        \        3pRp\	        W4       F0  w  r4\        V\        3RR7      w  rVV P                  RV R2V4       K2  	  R# )   TrW   z	cvt.rni.s.f16Nr          @   )r   r"   r&   r)   ru   r   r   assertInrk   rz   sizesrl   sizeptx_s   &      r   test_float16_to_int_ptx#TestCasting.test_float16_to_int_ptx   sO    Hh9/LF "t<FCMMIdV40#6 0r   c           
     V   \         \        \        \        3p\        P
                  \        P                  \        P                  \        P                  3p\        P                  \        P                  \        P                  3p\        W4       F  w  rEV Fw  pV P                  WeR 7      ;_uu_ 4        V P                  WFV4      pV P                  V! R4      V! R4      4       V P                  V! R4      \!        R4      4       RRR4       Ky  	  K  	  R#   + '       g   i     K  ; i)rp   rs   N)r   r"   r&   r)   r   r+   r.   r1   r5   r   r   r@   ru   rv   rm   rw   rx   ry   s   &       r   test_float_to_uintTestCasting.test_float_to_uint   s    Hh9299bii;::rzz2::6/LF!\\\;; 00FE$$U4[&,?$$U4[#d)< <; " 0;;;s   3AD	D(c                    \         \        \        \        3pRp\	        W4       F0  w  r4\        V\        3RR7      w  rVV P                  RV R2V4       K2  	  R# )r   TrW   z	cvt.rni.ur   Nr   )r,   r/   r2   r6   ru   r   r   r   r   s   &      r   test_float16_to_uint_ptx$TestCasting.test_float16_to_uint_ptx   sO    Y	9=/LF "t<FCMMIdV40#6 0r   c           	        \         \        \        3p\        P                  \        P
                  \        P                  3p\        W4       Fg  w  r4V P                  VR 7      ;_uu_ 4        V P                  V\        P                  V4      pV P                  V! R4      V! R4      4       RRR4       Ki  	  R#   + '       g   i     K~  ; i))rr   A  N)r9   r=   rA   r   r   r   r@   ru   rv   rm   r(   rw   )rk   rz   r{   rl   rr   r}   s   &     r   test_int_to_floatTestCasting.test_int_to_float   s    z:6RZZ4/LF4((,,VRXXtD  sVC[9 )( 0(((s   +A B99C
c           	     f   \         \        3p\        \        3p\	        W4       Fu  w  r4V P                  VR 7      ;_uu_ 4        V P                  V\        P                  \        P                  4      pV P                  V! R4      V! R4      4       RRR4       Kw  	  R#   + '       g   i     K  ; i))funcr   N)
rL   rQ   rN   rS   ru   rv   rm   r   r   rw   )rk   	cudafuncs	hostfuncscudafunchostfuncr}   s   &     r   test_literal_to_float16#TestCasting.test_literal_to_float16   s    024	579	 #&i";H8,,,,Xrzz2::N  sXc]; -, #<,,,s   ABB0c                    \         \        \        \        3pRp\	        W4       F/  w  r4\        \        V3RR7      w  rVV P                  RV 2V4       K1  	  R# )r   TrW   zcvt.rn.f16.sNr   )r   r   r   r   ru   r   r9   r   rk   r|   r   tyr   r   r   s   &      r   test_int_to_float16_ptx#TestCasting.test_int_to_float16_ptx   M    r2r"G+HB bU4@FCMML/5 ,r   c                    \         \        \        \        3pRp\	        W4       F/  w  r4\        \        V3RR7      w  rVV P                  RV 2V4       K1  	  R# )r   TrW   zcvt.rn.f16.uNr   )r	   r
   r   r   ru   r   r9   r   r   s   &      r   test_uint_to_float16_ptx$TestCasting.test_uint_to_float16_ptx   r   r   c           
     \   \         \        \        3p\        P                  \        P
                  \        P                  3p\        P                  ! \        W4      V4       F  w  w  r4pV P                  WER 7      ;_uu_ 4        V P                  W4V4      p\        P                  P                  V! R4      V! R4      V! ^4      ,          RR7       \        P                  P                  V! R4      V! R4      V! ^4      ,          RR7       RRR4       K  	  R#   + '       g   i     K  ; i)rp   rs   ga2U0*3?)rtolNrt   )r9   r=   rA   r   r   r   r@   	itertoolsproductru   rv   rm   testingassert_allclose)rk   rz   tysrl   rq   rr   r}   s   &      r   test_float_to_floatTestCasting.test_float_to_float   s    z:6zz2::rzz2&/&7&7G8I3&O"VdV77,,VTB
 

**5;+/:Q+?f + N

**5<+/;a+@v + O 87 'P777s   B	DD+c                    \         \        3pRp\        W4       F0  w  r4\        V\        3RR7      w  rVV P                  RV R2V4       K2  	  R# )f32TrW   zcvt.r   N)r   f64)r=   rA   ru   r   r   r   )rk   rz   	postfixesrl   postfixr   r   s   &      r   test_float16_to_float_ptx%TestCasting.test_float16_to_float_ptx   sK    z*"	"76OF "t<FCMMD	.4  7r   c                ^   \         \        3p\        P                  \        P                  3p\        P
                  \        P                  \        P                  3p\        W4       F  w  rEV F  pV P                  WeR 7      ;_uu_ 4        V P                  WFV4      p\        P                  P                  V! R4      V! V! R4      4      4       \        P                  P                  V! R4      V! V! R4      4      R,           4       RRR4       K  	  K  	  R#   + '       g   i     K  ; i)rp   gGz	@y                NgGz	)rD   rG   r   rC   rF   r   r   r@   ru   rv   rm   r   r   ry   s   &       r   test_float_to_complex!TestCasting.test_float_to_complex   s    /r}}-::rzz2::6/LF!\\\;; 00FE
 JJ..uT{/5fTl/CEJJ..uU|/5fUm/Dr/IK <; " 0;;;s   A>D	D,c                    \         P                  ! \        \        3R R7      w  rV P	                  RV4       \         P                  ! \        \
        3R R7      w  r2V P	                  RV4       R# )TrW   zst.f32zst.u16N)r   r   r   r   r   r   )rk   float32_ptxr   float16_ptxs   &   r   test_native_castTestCasting.test_native_cast   sN    ))+z$Oh,))+z$Oh,r   rZ   N)__name__
__module____qualname____firstlineno__rm   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   rU   rU   c   s(      ? ? ?@7 A7 
= 
= ?@7 A7 : : 	< 	< ?@6 A6 ?@6 A6 O O  ?@5 A5 K K$ ?@- A-r   rU   __main__)0numpyr   
numba.cudar   numba.core.typesr   r   r   r   r   r	   r
   r   r   numbar   
numba.corer   numba.cuda.testingr   r   r   numba.typesr   r   r   unittestr   r   r"   r&   r)   r,   r/   r2   r6   r9   r=   rA   rD   rG   rL   rN   rQ   rS   rU   r   mainrZ   r   r   <module>r      s     " ? ? ?  3 3 (  -)),).+Z-, Z-z zMMO r   