def savings(self, loop): metainterp_sd = FakeMetaInterpStaticData(self.cpu) jitdriver_sd = FakeJitDriverStaticData() opt = VectorizingOptimizer(metainterp_sd, jitdriver_sd, 0) opt.orig_label_args = loop.label.getarglist()[:] graph = opt.dependency_graph = DependencyGraph(loop) self.show_dot_graph(graph, 'costmodel') for k,m in graph.memory_refs.items(): graph.memory_refs[k] = FakeMemoryRef(m.array, m.index_var) opt.find_adjacent_memory_refs(graph) opt.extend_packset() opt.combine_packset() for pack in opt.packset.packs: print "pack: \n ", print '\n '.join([str(op.getoperation()) for op in pack.operations]) print costmodel = FakeCostModel(X86_CostModel(self.cpu, 0)) costmodel.reset_savings() state = VecScheduleState(graph, opt.packset, self.cpu, costmodel) opt.schedule(state) return costmodel.getsavings()
def savings(self, loop): jitdriver_sd = FakeJitDriverStaticData() opt = VectorizingOptimizer(self.metainterp_sd, jitdriver_sd, 0) opt.orig_label_args = loop.label.getarglist()[:] graph = opt.dependency_graph = DependencyGraph(loop) self.show_dot_graph(graph, 'costmodel') for k, m in graph.memory_refs.items(): graph.memory_refs[k] = FakeMemoryRef(m.array, m.index_var) opt.find_adjacent_memory_refs(graph) opt.extend_packset() opt.combine_packset() for pack in opt.packset.packs: print "pack: \n ", print '\n '.join( [str(op.getoperation()) for op in pack.operations]) print costmodel = FakeCostModel(GenericCostModel(self.cpu, 0)) costmodel.reset_savings() state = VecScheduleState(graph, opt.packset, self.cpu, costmodel) opt.schedule(state) return costmodel.getsavings()
def vectoroptimizer(self, loop): metainterp_sd = FakeMetaInterpStaticData(self.cpu) jitdriver_sd = FakeJitDriverStaticData() opt = VectorizingOptimizer(metainterp_sd, jitdriver_sd, 0) opt.orig_label_args = loop.label.getarglist()[:] return opt