loopy/kernel/__init__.py
def parents_per_domain(self):
        """Return a list corresponding to self.domains (by index)
        containing domain indices which are nested around this
        domain.

        Each domains nest list walks from the leaves of the nesting
        tree to the root.
        """

        # The stack of iname sets records which inames are active
        # as we step through the linear list of domains. It also
        # determines the granularity of inames to be popped/decactivated
        # if we ascend a level.

        iname_set_stack = []
        result = []

        from loopy.kernel.tools import is_domain_dependent_on_inames

        for dom_idx, dom in enumerate(self.domains):
            inames = set(dom.get_var_names(dim_type.set))

            # This next domain may be nested inside the previous domain.
            # Or it may not, in which case we need to figure out how many
            # levels of parents we need to discard in order to find the
            # true parent.

            discard_level_count = 0
            while discard_level_count < len(iname_set_stack):
                last_inames = iname_set_stack[-1-discard_level_count]

                if is_domain_dependent_on_inames(self, dom_idx, last_inames):
                    break

                discard_level_count += 1

            if discard_level_count:
                iname_set_stack = iname_set_stack[:-discard_level_count]

            if result:
                parent = len(result)-1
            else:
                parent = None

            for i in range(discard_level_count):
                assert parent is not None
                parent = result[parent]

            # found this domain's parent
            result.append(parent)

            if iname_set_stack:
                parent_inames = iname_set_stack[-1]
            else:
                parent_inames = set()
            iname_set_stack.append(parent_inames | inames)

        return result
Return a list corresponding to self.domains (by index)
        containing domain indices which are nested around this
        domain.

        Each domains nest list walks from the leaves of the nesting
        tree to the root.
        
Return a list corresponding to self.domains (by index)
containing domain indices which are nested around this
domain.

Each domains nest list walks from the leaves of the nesting
tree to the root.
Return a list corresponding to self . domains ( by index ) containing domain indices which are nested around this domain . Each domains nest list walks from the leaves of the nesting tree to the root .
def parents_per_domain(self):
        iname_set_stack = []
        result = []
        from loopy.kernel.tools import is_domain_dependent_on_inames
        for dom_idx, dom in enumerate(self.domains):
            inames = set(dom.get_var_names(dim_type.set))
            discard_level_count = 0
            while discard_level_count < len(iname_set_stack):
                last_inames = iname_set_stack[-1-discard_level_count]
                if is_domain_dependent_on_inames(self, dom_idx, last_inames):
                    break
                discard_level_count += 1
            if discard_level_count:
                iname_set_stack = iname_set_stack[:-discard_level_count]
            if result:
                parent = len(result)-1
            else:
                parent = None
            for i in range(discard_level_count):
                assert parent is not None
                parent = result[parent]
            result.append(parent)
            if iname_set_stack:
                parent_inames = iname_set_stack[-1]
            else:
                parent_inames = set()
            iname_set_stack.append(parent_inames | inames)
        return result
def parents_per_domain ( self ) : iname_set_stack = [ ] result = [ ] from loopy . kernel . tools import is_domain_dependent_on_inames for dom_idx , dom in enumerate ( self . domains ) : inames = set ( dom . get_var_names ( dim_type . set ) ) discard_level_count = 0 while discard_level_count < len ( iname_set_stack ) : last_inames = iname_set_stack [ - 1 - discard_level_count ] if is_domain_dependent_on_inames ( self , dom_idx , last_inames ) : break discard_level_count += 1 if discard_level_count : iname_set_stack = iname_set_stack [ : - discard_level_count ] if result : parent = len ( result ) - 1 else : parent = None for i in range ( discard_level_count ) : assert parent is not None parent = result [ parent ] result . append ( parent ) if iname_set_stack : parent_inames = iname_set_stack [ - 1 ] else : parent_inames = set ( ) iname_set_stack . append ( parent_inames | inames ) return result
Return a list corresponding to self.domains (by index)
containing domain indices which are nested around this
domain.
Return a list corresponding to self . domains ( by index ) containing domain indices which are nested around this domain .
"""Return a list corresponding to self.domains (by index)
        containing domain indices which are nested around this
        domain.

        Each domains nest list walks from the leaves of the nesting
        tree to the root.
        """ # The stack of iname sets records which inames are active # as we step through the linear list of domains. It also # determines the granularity of inames to be popped/decactivated # if we ascend a level. # This next domain may be nested inside the previous domain. # Or it may not, in which case we need to figure out how many # levels of parents we need to discard in order to find the # true parent. # found this domain's parent
self