Skip to content

Commit

Permalink
change 'if' to 'assert' when checking for instruction ids set to 'Non…
Browse files Browse the repository at this point in the history
…e' and cast to ids str in comprehensions
  • Loading branch information
a-alveyblanc committed Jun 20, 2023
1 parent bece0e5 commit 9822ede
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions loopy/schedule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,11 @@ def get_insns_in_topologically_sorted_order(
from pytools.graph import compute_topological_order

rev_dep_map: Dict[str, Set[str]] = {
insn.id: set() for insn in kernel.instructions
if isinstance(insn.id, str)}
str(insn.id): set() for insn in kernel.instructions}
for insn in kernel.instructions:
for dep in insn.depends_on:
if insn.id is not None:
rev_dep_map[dep].add(insn.id)
assert insn.id is not None
rev_dep_map[dep].add(insn.id)

# For breaking ties, we compare the features of an intruction
# so that instructions with the same set of features are lumped
Expand Down Expand Up @@ -2090,9 +2089,7 @@ def _generate_loop_schedules_inner(

schedule=(),

unscheduled_insn_ids={insn.id
for insn in kernel.instructions
if isinstance(insn.id, str)},
unscheduled_insn_ids={str(insn.id) for insn in kernel.instructions},
scheduled_insn_ids=frozenset(),
within_subkernel=kernel.state != KernelState.LINEARIZED,
may_schedule_global_barriers=True,
Expand Down

0 comments on commit 9822ede

Please sign in to comment.