From 541a85bb0a1168619d509a4bb5dc11b63883d1f2 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sun, 4 Nov 2018 13:47:03 -0600 Subject: [PATCH] SumpyTimingFuture: Only wait for events to finish if non-empty --- sumpy/fmm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index bd1c51d9..a2331756 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -177,7 +177,8 @@ class SumpyTimingFuture(object): stacklevel=3) return TimingResult(wall_elapsed=None) - pyopencl.wait_for_events(self.events) + if self.events: + pyopencl.wait_for_events(self.events) result = 0 for event in self.events: -- GitLab