Skip to content

Commit 12d6f1d

Browse files
author
whitequark
committedApr 6, 2016
Commit missing parts of bb064c6.
1 parent bb064c6 commit 12d6f1d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

Diff for: ‎artiq/test/coredevice/test_portability.py

+18
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ def run(self):
3737
self._add_output(x)
3838

3939

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+
4053
class _Misc(EnvExperiment):
4154
def build(self):
4255
self.setattr_device("core")
@@ -194,6 +207,11 @@ def test_primes(self):
194207
_run_on_host(_Primes, maximum=100, output_list=l_host)
195208
self.assertEqual(l_device, l_host)
196209

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+
197215
def test_misc(self):
198216
for f in self.execute, _run_on_host:
199217
uut = f(_Misc)

0 commit comments

Comments
 (0)
Please sign in to comment.