aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJaebaek Seo <duke.acacia@gmail.com>2018-03-07 09:25:51 -0500
committerDiego Novillo <dnovillo@google.com>2018-03-20 21:30:06 -0400
commit3b594e163009cb224e80155ff17971a4b2fc0cd4 (patch)
tree41adb3a971592fdbff601111261357a430001327 /include
parent735d8a579ecb6c5b5d41c2a81d695b49f7bd3248 (diff)
downloadspirv-tools-3b594e163009cb224e80155ff17971a4b2fc0cd4.tar.gz
Add --time-report to spirv-opt
This patch adds a new option --time-report to spirv-opt. For each pass executed by spirv-opt, the flag prints resource utilization for the pass (CPU time, wall time, RSS and page faults) This fixes issue #1378
Diffstat (limited to 'include')
-rw-r--r--include/spirv-tools/optimizer.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index ed8c8d56..b7a511ae 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -119,6 +119,11 @@ class Optimizer {
// output is sent to the |out| output stream.
Optimizer& SetPrintAll(std::ostream* out);
+ // Sets the option to print the resource utilization of each pass. If |out|
+ // is null, then no output is generated. Otherwise, output is sent to the
+ // |out| output stream.
+ Optimizer& SetTimeReport(std::ostream* out);
+
private:
struct Impl; // Opaque struct for holding internal data.
std::unique_ptr<Impl> impl_; // Unique pointer to internal data.