Exemple #1
0
    def _summary(self):
        """
        Print a summary of the DSE transformations
        """

        if self.profile:
            row = "%s [flops: %s, elapsed: %.2f]"
            summary = " >>\n     ".join(
                row % ("".join(filter(lambda c: not c.isdigit(), k[1:])),
                       str(self.ops.get(k, "?")), v)
                for k, v in self.timings.items())
            elapsed = sum(self.timings.values())
            dse("%s\n     [Total elapsed: %.2f s]" % (summary, elapsed))
Exemple #2
0
    def run(self, cluster):
        state = State(cluster, self.template)

        self._pipeline(state)

        self._finalize(state)

        if self.profile:
            # Print a summary of the applied transformations
            row = "%s [flops: %s, elapsed: %.2f]"
            summary = " >>\n     ".join(row % ("".join(filter(lambda c: not c.isdigit(),
                                                              k[1:])),
                                               str(state.ops.get(k, "?")), v)
                                        for k, v in state.timings.items())
            elapsed = sum(state.timings.values())
            dse("%s\n     [Total elapsed: %.2f s]" % (summary, elapsed))
            self.run_summary.append({'ops': state.ops, 'timings': state.timings})

        return state.clusters
    def run(self, cluster):
        state = State(cluster, self.template)

        self._pipeline(state)

        self._finalize(state)

        if self.profile:
            # Print a summary of the applied transformations
            row = "%s [flops: %s, elapsed: %.2f]"
            summary = " >>\n     ".join(
                row % ("".join(filter(lambda c: not c.isdigit(), k[1:])),
                       str(state.ops.get(k, "?")), v)
                for k, v in state.timings.items())
            elapsed = sum(state.timings.values())
            dse("%s\n     [Total elapsed: %.2f s]" % (summary, elapsed))
            self.run_summary.append({
                'ops': state.ops,
                'timings': state.timings
            })

        return state.clusters