1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

wa/workloads: Change to use 'loops' parameter.

Change to consistently use 'loops' parameter instead of 'iterations'
etc.
This commit is contained in:
Marc Bonnici 2018-05-11 13:48:13 +01:00 committed by setrofim
parent 8d7d32d180
commit 6f5fca36df
6 changed files with 19 additions and 18 deletions

View File

@ -78,7 +78,7 @@ class Geekbench(ApkUiautoWorkload):
Parameter('version', default=sorted(versions.keys())[-1], allowed_values=sorted(versions.keys()),
description='Specifies which version of the workload should be run.',
override=True),
Parameter('times', kind=int, default=1,
Parameter('loops', kind=int, default=1, aliases=['times'],
description=('Specfies the number of times the benchmark will be run in a "tight '
'loop", i.e. without performaing setup/teardown inbetween.')),
Parameter('timeout', kind=int, default=3600,
@ -86,7 +86,7 @@ class Geekbench(ApkUiautoWorkload):
'multiplied by ``times`` to calculate the overall run timeout. ')),
Parameter('disable_update_result', kind=bool, default=False,
description=('If ``True`` the results file will not be pulled from the targets '
'/data/data/com.primatelabs.geekbench folder. This allows the '
'``/data/data/com.primatelabs.geekbench`` folder. This allows the '
'workload to be run on unrooted targets and the results extracted '
'manually later.')),
]
@ -112,7 +112,7 @@ class Geekbench(ApkUiautoWorkload):
def __init__(self, *args, **kwargs):
super(Geekbench, self).__init__(*args, **kwargs)
self.gui.uiauto_params['version'] = self.version
self.gui.uiauto_params['times'] = self.times
self.gui.uiauto_params['loops'] = self.loops
self.gui.uiauto_params['is_corporate'] = self.is_corporate
self.gui.timeout = self.timeout
@ -126,7 +126,7 @@ class Geekbench(ApkUiautoWorkload):
def setup(self, context):
super(Geekbench, self).setup(context)
self.run_timeout = self.timeout * self.times
self.run_timeout = self.timeout * self.loops
self.exact_apk_version = self.version
def update_output(self, context):
@ -137,8 +137,8 @@ class Geekbench(ApkUiautoWorkload):
update_method(context)
def validate(self):
if (self.times > 1) and (self.version == '2'):
raise ConfigError('times parameter is not supported for version 2 of Geekbench.')
if (self.loops > 1) and (self.version == '2'):
raise ConfigError('loops parameter is not supported for version 2 of Geekbench.')
def update_result_2(self, context):
score_calculator = GBScoreCalculator()

View File

@ -46,7 +46,7 @@ public class UiAutomation extends BaseUiAutomation {
Integer majorVersion;
Integer minorVersion;
Boolean isCorporate;
Integer times;
Integer loops;
@Before
public void initialize() {
@ -55,7 +55,7 @@ public class UiAutomation extends BaseUiAutomation {
majorVersion = Integer.parseInt(version[0]);
minorVersion = Integer.parseInt(version[1]);
isCorporate = params.getBoolean("is_corporate");
times = params.getInt("times");
loops = params.getInt("loops");
}
@Test
@ -70,7 +70,7 @@ public class UiAutomation extends BaseUiAutomation {
@Test
@Override
public void runWorkload() throws Exception {
for (int i = 0; i < times; i++) {
for (int i = 0; i < loops; i++) {
switch (majorVersion) {
case 2:
// In version 2, we scroll through the results WebView to make sure
@ -92,7 +92,7 @@ public class UiAutomation extends BaseUiAutomation {
shareResults();
}
break;
case 4:
case 4:
case 5:
runCpuBenchmarks(isCorporate);
waitForResultsv3onwards();
@ -101,7 +101,7 @@ public class UiAutomation extends BaseUiAutomation {
throw new RuntimeException("Invalid version of Geekbench requested");
}
if (i < (times - 1)) {
if (i < (loops - 1)) {
mDevice.pressBack();
if (majorVersion < 4)
mDevice.pressBack(); // twice

View File

@ -69,7 +69,7 @@ class Jankbench(ApkWorkload):
Parameter('test_ids', kind=list_or_string,
allowed_values=valid_test_ids,
description='ID of the jankbench test to be run.'),
Parameter('reps', kind=int, default=1, constraint=lambda x: x > 0,
Parameter('loops', kind=int, default=1, constraint=lambda x: x > 0, aliases=['reps'],
description='''
Specifies the number of times the benchmark will be run in a "tight loop",
i.e. without performaing setup/teardown inbetween.
@ -188,8 +188,8 @@ class Jankbench(ApkWorkload):
if self.test_ids:
test_idxs = [str(self.valid_test_ids.index(i)) for i in self.test_ids]
command_params.append('--eia com.android.benchmark.EXTRA_ENABLED_BENCHMARK_IDS {}'.format(','.join(test_idxs)))
if self.reps:
command_params.append('--ei com.android.benchmark.EXTRA_RUN_COUNT {}'.format(self.reps))
if self.loops:
command_params.append('--ei com.android.benchmark.EXTRA_RUN_COUNT {}'.format(self.loops))
return 'am start -W -S -n {}/{} {}'.format(self.package,
self.activity,
' '.join(command_params))

View File

@ -90,8 +90,9 @@ class Meabo(Workload):
default=16384,
),
Parameter(
'num_iterations',
'loops',
kind=int,
aliases=['num_iterations'],
description='''
Number of iterations that core loop is executed.
''',
@ -220,7 +221,7 @@ class Meabo(Workload):
('-r', 'nrow'),
('-C', 'num_cpus'),
('-H', 'num_hwcntrs'),
('-i', 'num_iterations'),
('-i', 'loops'),
('-x', 'num_palindromes'),
('-p', 'num_particles'),
('-R', 'num_randomloc'),

View File

@ -49,7 +49,7 @@ class Memcpy(Workload):
description='''
Specifies the size, in bytes, of the buffer to be copied.
'''),
Parameter('iterations', kind=int, default=1000,
Parameter('loops', kind=int, default=1000, aliases=['iterations'],
description='''
Specfies the number of iterations that will be performed.
'''),
@ -69,7 +69,7 @@ class Memcpy(Workload):
Memcpy.target_exe = self.target.install_if_needed(host_binary)
def setup(self, context):
self.command = '{} -i {} -s {}'.format(Memcpy.target_exe, self.iterations, self.buffer_size)
self.command = '{} -i {} -s {}'.format(Memcpy.target_exe, self.loops, self.buffer_size)
for c in (self.cpus.list()):
self.command += ' -c {}'.format(c)
self.result = None