[python-dtcwt] 215/497: make benchmark script not fail on non-OpenCL machines

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit 68fe1b48ef7e63d6c186fa91700d55682ea3d10d
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Wed Nov 20 16:56:00 2013 +0000

    make benchmark script not fail on non-OpenCL machines
    
    Skip the benchmark all together if there is not OpenCL present.
---
 scripts/benchmark_opencl.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/benchmark_opencl.py b/scripts/benchmark_opencl.py
index 8763ea9..1fa2f5a 100644
--- a/scripts/benchmark_opencl.py
+++ b/scripts/benchmark_opencl.py
@@ -48,8 +48,12 @@ def benchmark(statement='pass', setup='pass'):
     return t
 
 def main():
-    queue = get_default_queue()
-    print('Using context: {0}'.format(queue.context))
+    try:
+        queue = get_default_queue()
+        print('Using context: {0}'.format(queue.context))
+    except NoCLPresentError:
+        print('Skipping benchmark since OpenCL is not present')
+        return
 
     print('Running NumPy colfilter...')
     a = benchmark('colfilter(lena, h1o)',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list