diff --git a/loopy/schedule/device_mapping.py b/loopy/schedule/device_mapping.py index c393fe7c2754fd883dda1e69ff7d64c7ade123bb..4bbf99d57145a5c3518262783eae862bf0d6a737 100644 --- a/loopy/schedule/device_mapping.py +++ b/loopy/schedule/device_mapping.py @@ -87,11 +87,8 @@ def get_common_hw_inames(kernel, insn_ids): # Get the list of hardware inames in which the temporary is defined. if len(insn_ids) == 0: return set() - id_to_insn = kernel.id_to_insn - from six.moves import reduce - return reduce( - set.intersection, - (get_hw_inames(kernel, id_to_insn[id]) for id in insn_ids)) + return set.intersection( + *(get_hw_inames(kernel, kernel.id_to_insn[id]) for id in insn_ids)) def remove_illegal_loops_for_hw_tagged_inames_in_schedule(kernel):