diff --git a/examples/demo.py b/examples/demo.py index 623660fee1b20b9ba140504ca594cc648e28bc45..a4a503336e126cf5a392fc32f040166c6d92b939 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -23,7 +23,8 @@ __kernel void sum( """).build() res_g = cl.Buffer(ctx, mf.WRITE_ONLY, a_np.nbytes) -prg.sum(queue, a_np.shape, None, a_g, b_g, res_g) +knl = prg.sum # Use this Kernel object for repeated calls +knl(queue, a_np.shape, None, a_g, b_g, res_g) res_np = np.empty_like(a_np) cl.enqueue_copy(queue, res_np, res_g) diff --git a/examples/demo_array.py b/examples/demo_array.py index 41b0f79ef2ccb74a807a8da5aff5eedf6a3bb15f..74bb7cfc6fead21ff0a0bb29266e82541586aa9e 100644 --- a/examples/demo_array.py +++ b/examples/demo_array.py @@ -22,6 +22,7 @@ prg = cl.Program(ctx, """ } """).build() -prg.sum(queue, a.shape, None, a_dev.data, b_dev.data, dest_dev.data) +knl = prg.sum # Use this Kernel object for repeated calls +knl(queue, a.shape, None, a_dev.data, b_dev.data, dest_dev.data) print(la.norm((dest_dev - (a_dev+b_dev)).get()))