From 3587325ae087bcc612c7a0d7dc5f5c35cdad2522 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 19 Aug 2011 18:01:39 +0200 Subject: [PATCH] Make the wrong-image error message less frightening. --- test/test_wrapper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test_wrapper.py b/test/test_wrapper.py index 44db7b58..40771c2c 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -266,7 +266,13 @@ class TestCL: a_result = np.empty_like(a) cl.enqueue_copy(queue, a_result, a_dest) - assert la.norm(a_result - a) == 0 + good = la.norm(a_result - a) == 0 + if not good: + if queue.device.type == cl.device_type.CPU: + assert good, ("The image implementation on your CPU CL platform '%s' " + "returned bad values. This is bad, but common." % queue.device.platform) + else: + assert good @pytools.test.mark_test.opencl def test_copy_buffer(self, ctx_factory): -- GitLab