From 5f9c11d40503e94f906501f4c82b17106a0a64f5 Mon Sep 17 00:00:00 2001 From: Patrick Martin <patrickmmartin@gmail.com> Date: Fri, 19 May 2017 21:03:57 +0100 Subject: [PATCH] fix for some cases where the extreme memory sizes cause issues --- examples/dump-performance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/dump-performance.py b/examples/dump-performance.py index d8b00142..00df1d1b 100644 --- a/examples/dump-performance.py +++ b/examples/dump-performance.py @@ -28,9 +28,11 @@ def main(): print("latency: %g s" % perf.transfer_latency(queue, tx_type)) for i in range(6, 31, 2): bs = 1 << i - print("bandwidth @ %d bytes: %g GB/s" % ( - bs, perf.transfer_bandwidth(queue, tx_type, bs)/1e9)) - + try: + result = "%g GB/s" % (perf.transfer_bandwidth(queue, tx_type, bs)/1e9) + except Exception as e: + result = "exception: %s" % e.__class__.__name__ + print("bandwidth @ %d bytes: %s" % (bs, result)) if __name__ == "__main__": main() -- GitLab