diff --git a/examples/benchmark-all.py b/examples/benchmark-all.py index 3fcb7f3981a3b52f27bcd230416f0f6b79ea74a8..ed969a1d4a1b367d7da7cd606f578a5e2bb5f0e3 100644 --- a/examples/benchmark-all.py +++ b/examples/benchmark-all.py @@ -69,14 +69,13 @@ for platform in cl.get_platforms(): """).build() c = numpy.empty_like(a) - before = cl.enqueue_marker(queue) - after = prg.sum(queue, a.shape, a_buf, b_buf, dest_buf) - - cl.enqueue_read_buffer(queue, dest_buf, c).wait() - elapsed = 1e-9*(after.profile.end - before.profile.end) + exec_evt = prg.sum(queue, a.shape, a_buf, b_buf, dest_buf) + exec_evt.wait() + elapsed = 1e-9*(exec_evt.profile.end - exec_evt.profile.start) print "Execution time of test: %g s" % elapsed + cl.enqueue_read_buffer(queue, dest_buf, c).wait() error = 0 for i in range(1000): if c[i] != c_result[i]: