diff --git a/loopy/kernel.py b/loopy/kernel.py index 8ac9c12045e29c3969ab0f5133db5aafb2798765..24ca824e73b5bc1da793031573ea910a03c6944f 100644 --- a/loopy/kernel.py +++ b/loopy/kernel.py @@ -299,7 +299,7 @@ class Instruction(Record): """ def __init__(self, id, assignee, expression, - forced_iname_deps=set(), insn_deps=set(), boostable=None, + forced_iname_deps=frozenset(), insn_deps=set(), boostable=None, boostable_into=None, temp_var_type=None, duplicate_inames_and_tags=[]): @@ -309,7 +309,7 @@ class Instruction(Record): if isinstance(expression, str): assignee = parse(expression) - assert isinstance(forced_iname_deps, set) + assert isinstance(forced_iname_deps, frozenset) assert isinstance(insn_deps, set) Record.__init__(self, @@ -738,10 +738,10 @@ class LoopKernel(Record): if groups["iname_deps_and_tags"] is not None: inames_and_tags = parse_iname_and_tag_list( groups["iname_deps_and_tags"]) - forced_iname_deps = set(iname for iname, tag in inames_and_tags) + forced_iname_deps = frozenset(iname for iname, tag in inames_and_tags) iname_to_tag_requests.update(dict(inames_and_tags)) else: - forced_iname_deps = set() + forced_iname_deps = frozenset() if groups["duplicate_inames_and_tags"] is not None: duplicate_inames_and_tags = parse_iname_and_tag_list( diff --git a/loopy/symbolic.py b/loopy/symbolic.py index c7376b4d652156bdf953bae3eaba84dcb63f5065..92629cc160ab8c0482e8a400a117ba58680f46b5 100644 --- a/loopy/symbolic.py +++ b/loopy/symbolic.py @@ -691,7 +691,7 @@ def get_dependencies(expr): from loopy.symbolic import DependencyMapper dep_mapper = DependencyMapper(composite_leaves=False) - return set(dep.name for dep in dep_mapper(expr)) + return frozenset(dep.name for dep in dep_mapper(expr))