def _profile_output(self, dim_sizes): """Return a performance summary of the profiled sections.""" summary = self.profiler.summary(dim_sizes, self.dtype) with bar(): for k, v in summary.items(): name = '%s<%s>' % (k, ','.join('%d' % i for i in v.itershape)) info("Section %s with OI=%.2f computed in %.3f s [Perf: %.2f GFlops/s]" % (name, v.oi, v.time, v.gflopss)) return summary
def _profile_output(self, args): """Return a performance summary of the profiled sections.""" summary = self.profiler.summary(args, self._dtype) with bar(): for k, v in summary.items(): name = '%s<%s>' % (k, ','.join('%d' % i for i in v.itershape)) gpointss = ", %.2f GPts/s" % v.gpointss if k == 'main' else '' info("Section %s with OI=%.2f computed in %.3f s [%.2f GFlops/s%s]" % (name, v.oi, v.time, v.gflopss, gpointss)) return summary
def _profile_output(self, args): """Return a performance summary of the profiled sections.""" summary = self.profiler.summary(args, self._dtype) with bar(): for k, v in summary.items(): itershapes = [",".join(str(i) for i in its) for its in v.itershapes] if len(itershapes) > 1: name = "%s<%s>" % (k, ",".join("<%s>" % i for i in itershapes)) else: name = "%s<%s>" % (k, itershapes[0]) gpointss = ", %.2f GPts/s" % v.gpointss if v.gpointss else '' info("%s with OI=%.2f computed in %.3f s [%.2f GFlops/s%s]" % (name, v.oi, v.time, v.gflopss, gpointss)) return summary
def apply(self, *args, **kwargs): """Apply the stencil kernel to a set of data objects""" # Build the arguments list to invoke the kernel function arguments, dim_sizes = self.arguments(*args, **kwargs) # Invoke kernel function with args self.cfunction(*list(arguments.values())) # Output summary of performance achieved summary = self._profile_summary(dim_sizes) with bar(): for k, v in summary.items(): name = '%s<%s>' % (k, ','.join('%d' % i for i in v.itershape)) info( "Section %s with OI=%.2f computed in %.3f s [Perf: %.2f GFlops/s]" % (name, v.oi, v.time, v.gflopss)) return summary