From 050df449f7a569422c4087e25ddbde543d362357 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Thu, 14 Nov 2019 13:21:53 -0600 Subject: [PATCH 1/2] space-invaders: add ball radii events to wait_for --- boxtree/area_query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boxtree/area_query.py b/boxtree/area_query.py index 700b647..c300ec9 100644 --- a/boxtree/area_query.py +++ b/boxtree/area_query.py @@ -975,7 +975,9 @@ class SpaceInvaderQueryBuilder(object): outer_space_invader_dists = cl.array.zeros(queue, tree.nboxes, np.float32) if not wait_for: wait_for = [] - wait_for = wait_for + outer_space_invader_dists.events + wait_for = wait_for \ + + outer_space_invader_dists.events \ + + ball_radii.events evt = space_invader_query_kernel( *SPACE_INVADER_QUERY_TEMPLATE.unwrap_args( -- GitLab From 2e6aaa53ca8cf37c8648f0ed58a187a5cea77a00 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Thu, 14 Nov 2019 22:12:10 +0100 Subject: [PATCH 2/2] Apply suggestion to boxtree/area_query.py --- boxtree/area_query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boxtree/area_query.py b/boxtree/area_query.py index c300ec9..f02ea6b 100644 --- a/boxtree/area_query.py +++ b/boxtree/area_query.py @@ -975,9 +975,10 @@ class SpaceInvaderQueryBuilder(object): outer_space_invader_dists = cl.array.zeros(queue, tree.nboxes, np.float32) if not wait_for: wait_for = [] - wait_for = wait_for \ - + outer_space_invader_dists.events \ + wait_for = (wait_for + + outer_space_invader_dists.events + ball_radii.events + + [evt for bc in ball_centers for evt in bc.events]) evt = space_invader_query_kernel( *SPACE_INVADER_QUERY_TEMPLATE.unwrap_args( -- GitLab