loopy/preprocess.py
def limit_boostability(kernel):
    """Finds out which other inames an instruction's inames occur with
    and then limits boostability to just those inames.
    """

    logger.debug("%s: limit boostability" % kernel.name)

    iname_occurs_with = {}
    for insn in kernel.instructions:
        insn_inames = kernel.insn_inames(insn)
        for iname in insn_inames:
            iname_occurs_with.setdefault(iname, set()).update(insn_inames)

    iname_use_counts = {}
    for insn in kernel.instructions:
        for iname in kernel.insn_inames(insn):
            iname_use_counts[iname] = iname_use_counts.get(iname, 0) + 1

    single_use_inames = set(iname for iname, uc in six.iteritems(iname_use_counts)
            if uc == 1)

    new_insns = []
    for insn in kernel.instructions:
        if insn.boostable is None:
            raise LoopyError("insn '%s' has undetermined boostability" % insn.id)
        elif insn.boostable:
            boostable_into = set()
            for iname in kernel.insn_inames(insn):
                boostable_into.update(iname_occurs_with[iname])

            boostable_into -= kernel.insn_inames(insn) | single_use_inames

            # Even if boostable_into is empty, leave boostable flag on--it is used
            # for boosting into unused hw axes.

            insn = insn.copy(boostable_into=boostable_into)
        else:
            insn = insn.copy(boostable_into=set())

        new_insns.append(insn)

    return kernel.copy(instructions=new_insns)
Finds out which other inames an instruction's inames occur with
    and then limits boostability to just those inames.
    
Finds out which other inames an instruction's inames occur with
and then limits boostability to just those inames.
Finds out which other inames an instruction ' s inames occur with and then limits boostability to just those inames .
def limit_boostability(kernel):
    logger.debug("%s: limit boostability" % kernel.name)
    iname_occurs_with = {}
    for insn in kernel.instructions:
        insn_inames = kernel.insn_inames(insn)
        for iname in insn_inames:
            iname_occurs_with.setdefault(iname, set()).update(insn_inames)
    iname_use_counts = {}
    for insn in kernel.instructions:
        for iname in kernel.insn_inames(insn):
            iname_use_counts[iname] = iname_use_counts.get(iname, 0) + 1
    single_use_inames = set(iname for iname, uc in six.iteritems(iname_use_counts)
            if uc == 1)
    new_insns = []
    for insn in kernel.instructions:
        if insn.boostable is None:
            raise LoopyError("insn '%s' has undetermined boostability" % insn.id)
        elif insn.boostable:
            boostable_into = set()
            for iname in kernel.insn_inames(insn):
                boostable_into.update(iname_occurs_with[iname])
            boostable_into -= kernel.insn_inames(insn) | single_use_inames
            insn = insn.copy(boostable_into=boostable_into)
        else:
            insn = insn.copy(boostable_into=set())
        new_insns.append(insn)
    return kernel.copy(instructions=new_insns)
def limit_boostability ( kernel ) : logger . debug ( "%s: limit boostability" % kernel . name ) iname_occurs_with = { } for insn in kernel . instructions : insn_inames = kernel . insn_inames ( insn ) for iname in insn_inames : iname_occurs_with . setdefault ( iname , set ( ) ) . update ( insn_inames ) iname_use_counts = { } for insn in kernel . instructions : for iname in kernel . insn_inames ( insn ) : iname_use_counts [ iname ] = iname_use_counts . get ( iname , 0 ) + 1 single_use_inames = set ( iname for iname , uc in six . iteritems ( iname_use_counts ) if uc == 1 ) new_insns = [ ] for insn in kernel . instructions : if insn . boostable is None : raise LoopyError ( "insn '%s' has undetermined boostability" % insn . id ) elif insn . boostable : boostable_into = set ( ) for iname in kernel . insn_inames ( insn ) : boostable_into . update ( iname_occurs_with [ iname ] ) boostable_into -= kernel . insn_inames ( insn ) | single_use_inames insn = insn . copy ( boostable_into = boostable_into ) else : insn = insn . copy ( boostable_into = set ( ) ) new_insns . append ( insn ) return kernel . copy ( instructions = new_insns )
Finds out which other inames an instruction's inames occur with
and then limits boostability to just those inames.
Finds out which other inames an instruction ' s inames occur with and then limits boostability to just those inames .
"""Finds out which other inames an instruction's inames occur with
    and then limits boostability to just those inames.
    """ # Even if boostable_into is empty, leave boostable flag on--it is used # for boosting into unused hw axes.
kernel