loopy/schedule/__init__.py
def find_loop_nest_around_map(kernel):
    """Returns a dictionary mapping inames to other inames that are
    always nested around them.
    """
    result = {}

    all_inames = kernel.all_inames()

    iname_to_insns = kernel.iname_to_insns()

    # examine pairs of all inames--O(n**2), I know.
    from loopy.kernel.data import IlpBaseTag
    for inner_iname in all_inames:
        result[inner_iname] = set()
        for outer_iname in all_inames:
            if inner_iname == outer_iname:
                continue

            tag = kernel.iname_to_tag.get(outer_iname)
            if isinstance(tag, IlpBaseTag):
                # ILP tags are special because they are parallel tags
                # and therefore 'in principle' nest around everything.
                # But they're realized by the scheduler as a loop
                # at the innermost level, so we'll cut them some
                # slack here.
                continue

            if iname_to_insns[inner_iname] < iname_to_insns[outer_iname]:
                result[inner_iname].add(outer_iname)

    for dom_idx, dom in enumerate(kernel.domains):
        for outer_iname in dom.get_var_names(isl.dim_type.param):
            if outer_iname not in all_inames:
                continue

            for inner_iname in dom.get_var_names(isl.dim_type.set):
                result[inner_iname].add(outer_iname)

    return result
Returns a dictionary mapping inames to other inames that are
    always nested around them.
    
Returns a dictionary mapping inames to other inames that are
always nested around them.
Returns a dictionary mapping inames to other inames that are always nested around them .
def find_loop_nest_around_map(kernel):
    result = {}
    all_inames = kernel.all_inames()
    iname_to_insns = kernel.iname_to_insns()
    from loopy.kernel.data import IlpBaseTag
    for inner_iname in all_inames:
        result[inner_iname] = set()
        for outer_iname in all_inames:
            if inner_iname == outer_iname:
                continue
            tag = kernel.iname_to_tag.get(outer_iname)
            if isinstance(tag, IlpBaseTag):
                continue
            if iname_to_insns[inner_iname] < iname_to_insns[outer_iname]:
                result[inner_iname].add(outer_iname)
    for dom_idx, dom in enumerate(kernel.domains):
        for outer_iname in dom.get_var_names(isl.dim_type.param):
            if outer_iname not in all_inames:
                continue
            for inner_iname in dom.get_var_names(isl.dim_type.set):
                result[inner_iname].add(outer_iname)
    return result
def find_loop_nest_around_map ( kernel ) : result = { } all_inames = kernel . all_inames ( ) iname_to_insns = kernel . iname_to_insns ( ) from loopy . kernel . data import IlpBaseTag for inner_iname in all_inames : result [ inner_iname ] = set ( ) for outer_iname in all_inames : if inner_iname == outer_iname : continue tag = kernel . iname_to_tag . get ( outer_iname ) if isinstance ( tag , IlpBaseTag ) : continue if iname_to_insns [ inner_iname ] < iname_to_insns [ outer_iname ] : result [ inner_iname ] . add ( outer_iname ) for dom_idx , dom in enumerate ( kernel . domains ) : for outer_iname in dom . get_var_names ( isl . dim_type . param ) : if outer_iname not in all_inames : continue for inner_iname in dom . get_var_names ( isl . dim_type . set ) : result [ inner_iname ] . add ( outer_iname ) return result
Returns a dictionary mapping inames to other inames that are
always nested around them.
Returns a dictionary mapping inames to other inames that are always nested around them .
"""Returns a dictionary mapping inames to other inames that are
    always nested around them.
    """ # examine pairs of all inames--O(n**2), I know. # ILP tags are special because they are parallel tags # and therefore 'in principle' nest around everything. # But they're realized by the scheduler as a loop # at the innermost level, so we'll cut them some # slack here.
kernel