From c99f88a7e36ea42c2d53d632c019c1a4fcc8e253 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sun, 30 Jun 2013 15:14:39 -0400 Subject: [PATCH] Add test_rmul_yields_right_type --- test/test_array.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_array.py b/test/test_array.py index a2f47391..bbc63f3a 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -227,6 +227,21 @@ def test_absrealimag(ctx_factory): # {{{ operators +@pytools.test.mark_test.opencl +def test_rmul_yields_right_type(ctx_factory): + context = ctx_factory() + queue = cl.CommandQueue(context) + + a = np.array([1, 2, 3, 4, 5]).astype(np.float32) + a_gpu = cl_array.to_device(queue, a) + + two_a = 2*a_gpu + assert isinstance(two_a, cl_array.Array) + + two_a = np.float32(2)*a_gpu + assert isinstance(two_a, cl_array.Array) + + @pytools.test.mark_test.opencl def test_pow_array(ctx_factory): context = ctx_factory() -- GitLab