예제 #1
0
def check_that_all_insns_are_scheduled(kernel):

    all_schedulable_insns = set(insn.id for insn in kernel.instructions)
    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_schedulable_insns

    if scheduled_insns < all_schedulable_insns:
        from loopy.diagnostic import UnscheduledInstructionError
        raise UnscheduledInstructionError(
            "unscheduled instructions: '%s'" %
            ', '.join(all_schedulable_insns - scheduled_insns))
예제 #2
0
파일: check.py 프로젝트: inducer/loopy
def check_that_all_insns_are_scheduled(kernel):
    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_schedulable_insns

    if scheduled_insns < all_schedulable_insns:
        from loopy.diagnostic import UnscheduledInstructionError
        raise UnscheduledInstructionError(
            "unscheduled instructions: '%s'"
            % ', '.join(all_schedulable_insns - scheduled_insns))