
    (phA                     t   S SK r S SKr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rS rSSS	S
SSS.rS rS r\R&                  " SSS9S 5       r\
" \S5      \R*                  R-                  S\" 5       5      \R*                  R.                  S 5       5       5       rg! \\4 a    \" S5      r Nf = f)    N)uuid4)check_version)MissingModulecupyc                     [         R                  SS4[         R                  SS4[         R                  SS4[         R                  SS4[         R
                  S	S
4[         R                  R                  SS4[         R                  SS4[         R                  SS4[         R                  SS4[         R                  SS4[         R                  SS4/n / nU  H2  u  p#nSU S3nUR                   H  nUR                  XeU45        M     M4     U$ )Nzcephes/beta.hz"out0 = xsf::cephes::beta(in0, in1)zbinom.hzout0 = xsf::binom(in0, in1)z	digamma.hzxsf::digamma(in0)zcephes/expn.hz"out0 = xsf::cephes::expn(in0, in1)zhyp2f1.hz&out0 = xsf::hyp2f1(in0, in1, in2, in3)z
lambertw.hz#out0 = xsf::lambertw(in0, in1, in2)zcephes/ellik.hz#out0 = xsf::cephes::ellik(in0, in1)zcephes/ellie.hz#out0 = xsf::cephes::ellie(in0, in1)zcdflib.hz!out0 = xsf::gdtrib(in0, in1, in2)zsici.hzxsf::sici(in0, &out0, &out1)zxsf::shichi(in0, &out0, &out1)z#include <xsf/>)scbetabinomdigammaexpnhyp2f1_ufuncs	_lambertw	ellipkinc	ellipeincgdtribsicishichitypesappend)cases_sourcecasesufuncheaderroutinepreamble	signatures          T/var/www/html/venv/lib/python3.13/site-packages/scipy/special/tests/test_xsf_cuda.pyget_test_casesr       s    	/#GH	9;<	["56	/#GH	J HI			|-RS	')NO	')NO	J CD	(:;	H>?L E".w#F81-ILL)w78 % #/ L    float32float64	complex64
complex128int32int64fdFDilc                 >   U R                  S5      u  p/ n/ n[        U5       H"  u  pVUR                  [        U    SU 35        M$     [        U5       H"  u  pVUR                  [        U    SU 35        M$     SR	                  U5      nSR	                  U5      nX44$ )N->z inz outz, )split	enumerater   	dtype_mapjoin)r   in_out	in_params
out_paramsr-   typecodes          r   
get_paramsr:   3   s    t$HCIJ ~Ih/0A378 & ~Yx01aS9: &		)$I:&J  r!   c                    UR                   UR                  UR                  UR                  UR                  UR
                  S.nU R                  S5      u  p4/ nU H$  nUR                  UR                  SX&   S95        M&     U$ )Nr(   r0      )dtype)	r"   r#   r$   r%   r&   r'   r1   r   zeros)r   xpr3   r5   _argsr9   s          r   get_sample_inputrB   @   su    ZZZZ\\]]XXXXI __T"FCDBHHQi&9H:; Kr!   moduleT)scopeautousec               #      #    [         R                  " 5       n [        R                  R	                  SS 5      nU [        R                  S'   S v   Ub  U[        R                  S'   O[        R                  S	 [
        R                  " U 5        g 7f)NCUPY_CACHE_DIR)tempfilemkdtemposenvirongetshutilrmtree)temp_cache_diroriginal_cache_dirs     r   manage_cupy_cacherQ   Q   sk      %%'N(8$?#1BJJ 	%'9

#$JJ'(
MM.!s   BBz13.0.0zsignature,preamble,routinec           
          S[        5       R                   3n[        U 5      u  pV[        R                  " UUUUUS[
        R                  " 5        3S4S9nU" [        U [        5      6 ng )Nxz--include-path=z
-std=c++17)r   options)r   hexr:   r   ElementwiseKernelr	   _get_includerB   )	r   r   r   rQ   namer7   r8   funcr@   s	            r   test_compiles_in_cupyrZ   b   sm     uw{{mD&y1I!!"2??#4"56ED 	y$/0Ar!   )rJ   pytestscipy.specialspecialr	   rM   rH   uuidr   scipy.special._testutilsr   r   r   ImportErrorAttributeErrorr    r3   r:   rB   fixturerQ   markparametrizexslowrZ    r!   r   <module>rg      s    	      2 2!
0 
						
!" h-" ."  tX5~7GH1  I 1o 	^$ ! D!s   B$ $B76B7