From 764145ca3898ff5dc2ac24d1b55472edcee92508 Mon Sep 17 00:00:00 2001 From: Hao Gao <gaohao95@gmail.com> Date: Thu, 23 Nov 2017 11:07:15 -0600 Subject: [PATCH] Make BuiltList immutable and add copyright notice --- pyopencl/algorithm.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py index dc3be4be..152fa3a5 100644 --- a/pyopencl/algorithm.py +++ b/pyopencl/algorithm.py @@ -5,7 +5,8 @@ from __future__ import absolute_import from six.moves import range from six.moves import zip -__copyright__ = """Copyright 2011-2012 Andreas Kloeckner""" +__copyright__ = """Copyright 2011-2012 Andreas Kloeckner \ + Copyright 2017 Hao Gao""" __license__ = """ Permission is hereby granted, free of charge, to any person @@ -1087,7 +1088,12 @@ class ListOfListsBuilder: # The scan will turn the "counts" array into the "starts" array # in-place. - result[name] = BuiltList(starts=counts) + if self.eliminate_empty_output_lists: + result[name] = BuiltList(count=None, starts=counts, lists=None, + num_nonempty_lists=None, + nonempty_indices=None) + else: + result[name] = BuiltList(count=None, starts=counts, lists=None) count_list_args.append(counts.data) # }}} -- GitLab