Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6238)

Unified Diff: bench/nanobench.cpp

Issue 1671573002: Create a thermal manager class and wire it in to nanobench behind a flag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/bench.gyp » ('j') | tools/ThermalManager.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c2bcb4950ac6b6ac6f5896412deb3cb8ccf44fee..2fafb27d2c7c143f0dc31b9b364a9ac1b0db00a4 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -38,6 +38,7 @@
#include "SkSurface.h"
#include "SkTaskGroup.h"
#include "SkThreadUtils.h"
+#include "ThermalManager.h"
#include <stdlib.h>
@@ -111,6 +112,7 @@ DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test
DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?");
DEFINE_bool(gpuStatsDump, false, "Dump GPU states after each benchmark to json");
DEFINE_bool(keepAlive, false, "Print a message every so often so that we don't time out");
+DEFINE_bool(useThermalManager, false, "Uses a thermal manager to prevent overheating\n");
static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
@@ -1050,6 +1052,10 @@ int nanobench_main() {
SkTArray<Config> configs;
create_configs(&configs);
+#if USE_THERMAL_MANAGER
+ ThermalManager tm;
+#endif
+
if (FLAGS_keepAlive) {
start_keepalive();
}
@@ -1067,6 +1073,11 @@ int nanobench_main() {
bench->delayedSetup();
}
for (int i = 0; i < configs.count(); ++i) {
+#if USE_THERMAL_MANAGER
+ if (FLAGS_useThermalManager && !tm.coolOffIfNecessary()) {
+ SkDebugf("Could not cool off, timings will be throttled\n");
+ }
+#endif
Target* target = is_enabled(b, configs[i]);
if (!target) {
continue;
« no previous file with comments | « no previous file | gyp/bench.gyp » ('j') | tools/ThermalManager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698