'Configure the OpenCL kernel
local_size can be None'

def configure(self, global_size, local_size=None, stream=None):

    global_size = _ensure_list(global_size)
    if (local_size is not None):
        local_size = _ensure_list(local_size)
        size = max(len(global_size), len(local_size))
        _ensure_size_or_append(global_size, size)
        _ensure_size_or_append(local_size, size)
    clone = self.copy()
    clone.global_size = tuple(global_size)
    clone.local_size = (tuple(local_size) if local_size else None)
    clone.stream = stream
    return clone
