diff --git a/loopy/check.py b/loopy/check.py index 0390618181b70129ba0395218f9dd40f2cad803a..4e0382abea19c33fe1ff1ea043f531dec698e8c1 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -515,6 +515,9 @@ def check_that_temporaries_are_defined_in_subkernels_where_used(kernel): insn_query.temporaries_read_in_subkernel(subkernel) - insn_query.temporaries_written_in_subkernel(subkernel)): + if temporary.initializer is not None: + continue + if kernel.temporary_variables[temporary].scope in ( temp_var_scope.PRIVATE, temp_var_scope.LOCAL): from loopy.diagnostic import MissingDefinitionError @@ -528,20 +531,25 @@ def check_that_temporaries_are_defined_in_subkernels_where_used(kernel): # {{{ check that all instructions are scheduled def check_that_all_insns_are_scheduled(kernel): - all_insns = set(insn.id for insn in kernel.instructions) + from loopy.kernel.instruction import NoOpInstruction + + all_schedulable_insns = set( + insn.id for insn in kernel.instructions + # nops are not schedulable + if not isinstance(insn, NoOpInstruction)) from loopy.schedule import sched_item_to_insn_id scheduled_insns = set( insn_id for sched_item in kernel.schedule for insn_id in sched_item_to_insn_id(sched_item)) - assert scheduled_insns <= all_insns + assert scheduled_insns <= all_schedulable_insns - if scheduled_insns < all_insns: + if scheduled_insns < all_schedulable_insns: from loopy.diagnostic import UnscheduledInstructionError raise UnscheduledInstructionError( "unscheduled instructions: '%s'" - % ', '.join(all_insns - scheduled_insns)) + % ', '.join(all_schedulable_insns - scheduled_insns)) # }}}