From 238c80e79c0591c2e0d5757018533edea7ae0213 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 19 Aug 2015 23:29:45 -0500 Subject: [PATCH] Test parsing of scientific notation --- test/test_loopy.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_loopy.py b/test/test_loopy.py index 87b4a95ad..4b2dcc5f5 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -2143,6 +2143,21 @@ def test_fusion(): print(knl) +def test_sci_notation_literal(ctx_factory): + ctx = ctx_factory() + queue = cl.CommandQueue(ctx) + + set_kernel = lp.make_kernel( + ''' { [i]: 0<=i<12 } ''', + ''' out[i] = 1e-12''') + + set_kernel = lp.set_options(set_kernel, write_cl=True) + + evt, (out,) = set_kernel(queue) + + assert (np.abs(out.get() - 1e-12) < 1e-20).all() + + if __name__ == "__main__": if len(sys.argv) > 1: exec(sys.argv[1]) -- GitLab