File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,19 @@ def run(self):
37
37
self ._add_output (x )
38
38
39
39
40
+ class _Math (EnvExperiment ):
41
+ """Test kernel math"""
42
+
43
+ def build (self ):
44
+ self .setattr_device ("core" )
45
+ self .x = 3.1
46
+ self .x_sqrt = 0.0
47
+
48
+ @kernel
49
+ def run (self ):
50
+ self .x_sqrt = self .x ** 0.5
51
+
52
+
40
53
class _Misc (EnvExperiment ):
41
54
def build (self ):
42
55
self .setattr_device ("core" )
@@ -194,6 +207,11 @@ def test_primes(self):
194
207
_run_on_host (_Primes , maximum = 100 , output_list = l_host )
195
208
self .assertEqual (l_device , l_host )
196
209
210
+ def test_math (self ):
211
+ math_device = self .execute (_Math )
212
+ math_host = _run_on_host (_Math )
213
+ self .assertEqual (math_device .x_sqrt , math_host .x_sqrt )
214
+
197
215
def test_misc (self ):
198
216
for f in self .execute , _run_on_host :
199
217
uut = f (_Misc )
You can’t perform that action at this time.
0 commit comments