@@ -61,7 +61,7 @@ def driver(a, jitfunc):
61
61
return b
62
62
63
63
64
- def test_driver (input_arr , device_ty , jitfunc ):
64
+ def check_driver (input_arr , device_ty , jitfunc ):
65
65
out_actual = None
66
66
if device_ty == "GPU" :
67
67
with dpctl .device_context ("opencl:gpu" ) as gpu_queue :
@@ -79,65 +79,65 @@ def test_driver(input_arr, device_ty, jitfunc):
79
79
@unittest .skipUnless (dpctl .has_cpu_queues (), "test only on CPU system" )
80
80
class TestDPPYMathFunctionsCPU (unittest .TestCase ):
81
81
def test_fabs_cpu (self ):
82
- b_actual = test_driver (a , "CPU" , dppy_fabs )
82
+ b_actual = check_driver (a , "CPU" , dppy_fabs )
83
83
b_expected = np .fabs (a )
84
84
self .assertTrue (np .all (b_actual == b_expected ))
85
85
86
86
def test_sin_cpu (self ):
87
- b_actual = test_driver (a , "CPU" , dppy_sin )
87
+ b_actual = check_driver (a , "CPU" , dppy_sin )
88
88
b_expected = np .sin (a )
89
89
self .assertTrue (np .allclose (b_actual , b_expected ))
90
90
91
91
def test_cos_cpu (self ):
92
- b_actual = test_driver (a , "CPU" , dppy_cos )
92
+ b_actual = check_driver (a , "CPU" , dppy_cos )
93
93
b_expected = np .cos (a )
94
94
self .assertTrue (np .allclose (b_actual , b_expected ))
95
95
96
96
def test_exp_cpu (self ):
97
- b_actual = test_driver (a , "CPU" , dppy_exp )
97
+ b_actual = check_driver (a , "CPU" , dppy_exp )
98
98
b_expected = np .exp (a )
99
99
self .assertTrue (np .allclose (b_actual , b_expected ))
100
100
101
101
def test_sqrt_cpu (self ):
102
- b_actual = test_driver (a , "CPU" , dppy_sqrt )
102
+ b_actual = check_driver (a , "CPU" , dppy_sqrt )
103
103
b_expected = np .sqrt (a )
104
104
self .assertTrue (np .allclose (b_actual , b_expected ))
105
105
106
106
def test_log_cpu (self ):
107
- b_actual = test_driver (a , "CPU" , dppy_log )
107
+ b_actual = check_driver (a , "CPU" , dppy_log )
108
108
b_expected = np .log (a )
109
109
self .assertTrue (np .allclose (b_actual , b_expected ))
110
110
111
111
112
112
@unittest .skipUnless (dpctl .has_gpu_queues (), "test only on GPU system" )
113
113
class TestDPPYMathFunctionsGPU (unittest .TestCase ):
114
114
def test_fabs_gpu (self ):
115
- b_actual = test_driver (a , "GPU" , dppy_fabs )
115
+ b_actual = check_driver (a , "GPU" , dppy_fabs )
116
116
b_expected = np .fabs (a )
117
117
self .assertTrue (np .all (b_actual == b_expected ))
118
118
119
119
def test_sin_gpu (self ):
120
- b_actual = test_driver (a , "GPU" , dppy_sin )
120
+ b_actual = check_driver (a , "GPU" , dppy_sin )
121
121
b_expected = np .sin (a )
122
122
self .assertTrue (np .allclose (b_actual , b_expected ))
123
123
124
124
def test_cos_gpu (self ):
125
- b_actual = test_driver (a , "GPU" , dppy_cos )
125
+ b_actual = check_driver (a , "GPU" , dppy_cos )
126
126
b_expected = np .cos (a )
127
127
self .assertTrue (np .allclose (b_actual , b_expected ))
128
128
129
129
def test_exp_gpu (self ):
130
- b_actual = test_driver (a , "GPU" , dppy_exp )
130
+ b_actual = check_driver (a , "GPU" , dppy_exp )
131
131
b_expected = np .exp (a )
132
132
self .assertTrue (np .allclose (b_actual , b_expected ))
133
133
134
134
def test_sqrt_gpu (self ):
135
- b_actual = test_driver (a , "GPU" , dppy_sqrt )
135
+ b_actual = check_driver (a , "GPU" , dppy_sqrt )
136
136
b_expected = np .sqrt (a )
137
137
self .assertTrue (np .allclose (b_actual , b_expected ))
138
138
139
139
def test_log_gpu (self ):
140
- b_actual = test_driver (a , "GPU" , dppy_log )
140
+ b_actual = check_driver (a , "GPU" , dppy_log )
141
141
b_expected = np .log (a )
142
142
self .assertTrue (np .allclose (b_actual , b_expected ))
143
143
0 commit comments