Skip to content

Commit

Permalink
Commit missing parts of bb064c6.
Browse files Browse the repository at this point in the history
whitequark committed Apr 6, 2016
1 parent bb064c6 commit 12d6f1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions artiq/test/coredevice/test_portability.py
Original file line number Diff line number Diff line change
@@ -37,6 +37,19 @@ def run(self):
self._add_output(x)


class _Math(EnvExperiment):
"""Test kernel math"""

def build(self):
self.setattr_device("core")
self.x = 3.1
self.x_sqrt = 0.0

@kernel
def run(self):
self.x_sqrt = self.x**0.5


class _Misc(EnvExperiment):
def build(self):
self.setattr_device("core")
@@ -194,6 +207,11 @@ def test_primes(self):
_run_on_host(_Primes, maximum=100, output_list=l_host)
self.assertEqual(l_device, l_host)

def test_math(self):
math_device = self.execute(_Math)
math_host = _run_on_host(_Math)
self.assertEqual(math_device.x_sqrt, math_host.x_sqrt)

def test_misc(self):
for f in self.execute, _run_on_host:
uut = f(_Misc)

0 comments on commit 12d6f1d

Please sign in to comment.