diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py index 0b8a5181adc4e1d4f318940ebbafb9ddfd57b11c..e4ca85decfc290e8cab28f65c77f4b815bd388c3 100644 --- a/pyopencl/algorithm.py +++ b/pyopencl/algorithm.py @@ -822,6 +822,13 @@ class ListOfListsBuilder: self.complex_kernel = complex_kernel + if eliminate_empty_output_lists is True: + eliminate_empty_output_lists = \ + [name for name, _ in self.list_names_and_dtypes] + + if eliminate_empty_output_lists is False: + eliminate_empty_output_lists = [] + self.eliminate_empty_output_lists = eliminate_empty_output_lists for list_name in self.eliminate_empty_output_lists: if not any(list_name == name for name, _ in self.list_names_and_dtypes):