Beispiel #1
0
    def as_oir(self):
        loc = SourceLocation(
            self.debuginfo.start_line or 1,
            self.debuginfo.start_column or 1,
            self.debuginfo.filename or "<unknown>",
        )
        sections = []
        for interval, sdfg in self.sections:
            horizontal_executions = []
            for state in sdfg.topological_sort(sdfg.start_state):

                for node in (n for n in nx.topological_sort(state.nx)
                             if isinstance(n, HorizontalExecutionLibraryNode)):
                    horizontal_executions.append(
                        OIRFieldRenamer(get_node_name_mapping(
                            state, node)).visit(node.as_oir()))
            sections.append(
                VerticalLoopSection(
                    interval=interval,
                    horizontal_executions=horizontal_executions,
                    loc=loc))

        return VerticalLoop(sections=sections,
                            loop_order=self.loop_order,
                            caches=self.caches,
                            loc=loc)
Beispiel #2
0
    def as_oir(self):

        sections = []
        for interval, sdfg in self.sections:
            horizontal_executions = []
            for state in sdfg.topological_sort(sdfg.start_state):

                for node in (n for n in nx.topological_sort(state.nx)
                             if isinstance(n, HorizontalExecutionLibraryNode)):
                    horizontal_executions.append(
                        OIRFieldRenamer(get_node_name_mapping(
                            state, node)).visit(node.as_oir()))
            sections.append(
                VerticalLoopSection(
                    interval=interval,
                    horizontal_executions=horizontal_executions))

        return VerticalLoop(
            sections=sections,
            loop_order=self.loop_order,
            caches=self.caches,
        )
Beispiel #3
0
 def build(self) -> VerticalLoopSection:
     return VerticalLoopSection(
         interval=self._interval, horizontal_executions=self._horizontal_executions
     )