From 5935dea845a5f92c1ca25766fd8589f35b50d354 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <kaushikcfd@gmail.com> Date: Tue, 29 Jun 2021 06:03:31 -0500 Subject: [PATCH] explains the reason for flushing the queue after every compiled kernel launch Co-authored-by: Andreas Kloeckner <inform@tiker.net> --- arraycontext/impl/pytato/compile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arraycontext/impl/pytato/compile.py b/arraycontext/impl/pytato/compile.py index 6ebe0f2..302dc65 100644 --- a/arraycontext/impl/pytato/compile.py +++ b/arraycontext/impl/pytato/compile.py @@ -298,7 +298,9 @@ class CompiledFunction: evt, out_dict = self.pytato_program(queue=self.actx.queue, allocator=self.actx.allocator, **input_kwargs_to_loopy) - + # FIXME Kernels (for now) allocate tons of memory in temporaries. If we + # race too far ahead with enqueuing, there is a distinct risk of + # running out of memory. This mitigates that risk a bit, for now. evt.wait() # }}} -- GitLab