From 69a644a4966890fac19d6d54a1d3be40f17b17ff Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Sep 2009 17:24:02 -0400 Subject: [PATCH] Further tweak benchmark-all after feedback from James Snyder. --- examples/benchmark-all.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/benchmark-all.py b/examples/benchmark-all.py index 3fcb7f39..ed969a1d 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]: -- GitLab