diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2017-05-24 16:20:24 +0100 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2017-05-24 16:22:02 +0100 |
commit | 056765c412951b991836126412fbd6ffb8054013 (patch) | |
tree | 60a8f1dafe471f1ae4dacc1da73ba04b1a75a5fc /scripts | |
parent | 26c266febe1fc97c46d25a33aaf6a1869a51c008 (diff) |
media-bench.pl: More tweak to saturation point finding
Plus a help text correction and calibration speed-up in
-R and -T modes.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/media-bench.pl | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/scripts/media-bench.pl b/scripts/media-bench.pl index 885080cd..7d374859 100755 --- a/scripts/media-bench.pl +++ b/scripts/media-bench.pl @@ -213,7 +213,7 @@ sub calibrate_workload my $error; my $r; - $r = 23; + $r = $realtime_target > 0 ? $realtime_target * $client_target_s : 23; for (;;) { my @args = ( "-n $nop", "-r $r", $warg); my ($time, $wps); @@ -243,6 +243,8 @@ sub find_saturation_point my $target = $realtime_target > 0 ? $realtime_target : $wps_target; my $r = $rr; my ($warg, $wcnt); + my $maxc; + my $max = 0; if (defined $w_direct) { $warg = $wrk; @@ -262,12 +264,21 @@ sub find_saturation_point my $delta; if ($target <= 0) { + if ($wps > $max) { + $max = $wps; + $maxc = $c; + } $delta = ($wps - $last_wps) / $last_wps; - $delta = -$tolerance if $delta < 0; + if ($delta > 0) { + last if $delta < $tolerance; + } else { + $delta = ($wps - $max) / $max; + last if abs($delta) >= $tolerance; + } } else { $delta = ($wps / $c - $target) / $target; + last if $delta < 0 and abs($delta) >= $tolerance; } - last if $delta < 0 and abs($delta) >= $tolerance; $r = int($rr * ($client_target_s / $time)); } elsif ($c == 1) { $swps = $wps; @@ -277,7 +288,11 @@ sub find_saturation_point $last_wps = $wps; } - return ($c - 1, $last_wps, $swps); + if ($target <= 0) { + return ($maxc, $max, $swps); + } else { + return ($c - 1, $last_wps, $swps); + } } getopts('hxn:b:W:B:r:t:i:R:T:w:', \%opts); @@ -299,7 +314,7 @@ Supported options: -i pct Engine idleness tolerance. -R wps Run workloads in the real-time mode at wps rate. -T wps Calibrate up to wps/client target instead of GPU saturation. - -w str Pass-through to gem_wsim -w. + -w str Pass-through to gem_wsim. Overrides normal workload selection. ENDHELP exit 0; } |