From 8eddb9194a5fbd29aee79992630e5b7fe3c3bea3 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 8 Aug 2020 21:08:47 +0100 Subject: [PATCH] test/lit: Add smoke test for math function broadcasting --- artiq/test/lit/embedding/array_math_fns.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 artiq/test/lit/embedding/array_math_fns.py diff --git a/artiq/test/lit/embedding/array_math_fns.py b/artiq/test/lit/embedding/array_math_fns.py new file mode 100644 index 000000000..2b298f2ef --- /dev/null +++ b/artiq/test/lit/embedding/array_math_fns.py @@ -0,0 +1,15 @@ +# RUN: %python -m artiq.compiler.testbench.embedding %s + +from artiq.language.core import * +import numpy as np + +@kernel +def entrypoint(): + # Just make sure everything compiles. + a = np.array([1.0, 2.0, 3.0]) + b = np.sin(a) + assert b.shape == a.shape + + c = np.array([1.0, 2.0, 3.0]) + d = np.arctan(c) + assert d.shape == c.shape