<s> """<STR_LIT>""" <EOL> from unittest import main , makeSuite , TestCase , TestSuite <EOL> import pycuda . autoinit <EOL> import pycuda . gpuarray as gpuarray <EOL> import numpy as np <EOL> import scipy as sp <EOL> import scipy . special <EOL> import skcuda . linalg as linalg <EOL> import skcuda . misc as misc <EOL> import skcuda . special as special <EOL> class test_special ( TestCase ) : <EOL> def setUp ( self ) : <EOL> np . random . seed ( <NUM_LIT:0> ) <EOL> linalg . init ( ) <EOL> def test_sici_float32 ( self ) : <EOL> x = np . array ( [ [ <NUM_LIT:1> , <NUM_LIT:2> ] , [ <NUM_LIT:3> , <NUM_LIT:4> ] ] , np . float32 ) <EOL> x_gpu = gpuarray . to_gpu ( x ) <EOL> ( si_gpu , ci_gpu ) = special . sici ( x_gpu ) <EOL> ( si , ci ) = scipy . special . sici ( x ) <EOL> assert np . allclose ( si , si_gpu . get ( ) ) <EOL> assert np . allclose ( ci , ci_gpu . get ( ) ) <EOL> def test_sici_float64 ( self ) : <EOL> x = np . array ( [ [ <NUM_LIT:1> , <NUM_LIT:2> ] , [ <NUM_LIT:3> , <NUM_LIT:4> ] ] , np . float64 ) <EOL> x_gpu = gpuarray . to_gpu ( x ) <EOL> ( si_gpu , ci_gpu ) = special . sici ( x_gpu ) <EOL> ( si , ci ) = scipy . special . sici ( x ) <EOL> assert np . allclose ( si , si_gpu . get ( ) ) <EOL> assert np . allclose ( ci , ci_gpu . get ( ) ) <EOL> def test_exp1_complex64 ( self ) : <EOL> z = np . asarray ( np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) + <NUM_LIT> * np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) , np . complex64 ) <EOL> z_gpu = gpuarray . to_gpu ( z ) <EOL> e_gpu = special . exp1 ( z_gpu ) <EOL> assert np . allclose ( sp . special . exp1 ( z ) , e_gpu . get ( ) ) <EOL> def test_exp1_complex128 ( self ) : <EOL> z = np . asarray ( np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) + <NUM_LIT> * np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) , np . complex128 ) <EOL> z_gpu = gpuarray . to_gpu ( z ) <EOL> e_gpu = special . exp1 ( z_gpu ) <EOL> assert np . allclose ( sp . special . exp1 ( z ) , e_gpu . get ( ) ) <EOL> def test_expi_complex64 ( self ) : <EOL> z = np . asarray ( np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) + <NUM_LIT> * np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) , np . complex64 ) <EOL> z_gpu = gpuarray . to_gpu ( z ) <EOL> e_gpu = special . expi ( z_gpu ) <EOL> assert np . allclose ( sp . special . expi ( z ) , e_gpu . get ( ) ) <EOL> def test_expi_complex128 ( self ) : <EOL> z = np . asarray ( np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) + <NUM_LIT> * np . random . rand ( <NUM_LIT:4> , <NUM_LIT:4> ) , np . complex128 ) <EOL> z_gpu = gpuarray . to_gpu ( z ) <EOL> e_gpu = special . expi ( z_gpu ) <EOL> assert np . allclose ( sp . special . expi ( z ) , e_gpu . get ( ) ) <EOL> def suite ( ) : <EOL> s = TestSuite ( ) <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> if misc . get_compute_capability ( pycuda . autoinit . device ) >= <NUM_LIT> : <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> s . addTest ( test_special ( '<STR_LIT>' ) ) <EOL> return s <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( defaultTest = '<STR_LIT>' ) </s>
