From 798673a556a5dc68398ef9b749cd3051bc45dbde Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 19 Jul 2019 14:08:54 -0500 Subject: [PATCH] Add test that actually runs built-from-binary program --- test/test_wrapper.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/test_wrapper.py b/test/test_wrapper.py index ea50bd5a..e0522955 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -628,9 +628,11 @@ def test_context_dep_memoize(ctx_factory): assert counter[0] == 1 -def test_can_build_binary(ctx_factory): +def test_can_build_and_run_binary(ctx_factory): ctx = ctx_factory() - device, = ctx.devices + queue = cl.CommandQueue(ctx) + + device = queue.device program = cl.Program(ctx, """ __kernel void simple(__global float *in, __global float *out) @@ -643,6 +645,12 @@ def test_can_build_binary(ctx_factory): foo = cl.Program(ctx, [device], [binary]) foo.build() + n = 256 + a_dev = cl.clrandom.rand(queue, n, np.float32) + dest_dev = cl_array.empty_like(a_dev) + + foo.simple(queue, (n,), (16,), a_dev.data, dest_dev.data) + def test_enqueue_barrier_marker(ctx_factory): ctx = ctx_factory() -- GitLab