mirror of
https://github.com/andreas-abel/nanoBench.git
synced 2025-12-16 11:30:07 +01:00
code alignment
This commit is contained in:
@@ -53,7 +53,8 @@ paramDict = dict()
|
||||
# Assumes that no changes to the corresponding files in /sys/nb/ were made since the last call to setNanoBenchParameters().
|
||||
# Otherwise, reset() needs to be called first.
|
||||
def setNanoBenchParameters(config=None, configFile=None, msrConfig=None, msrConfigFile=None, nMeasurements=None, unrollCount=None, loopCount=None,
|
||||
warmUpCount=None, initialWarmUpCount=None, aggregateFunction=None, basicMode=None, noMem=None, codeOffset=0, verbose=None):
|
||||
warmUpCount=None, initialWarmUpCount=None, alignmentOffset=0, codeOffset=0, aggregateFunction=None, basicMode=None, noMem=None,
|
||||
verbose=None):
|
||||
if not ramdiskCreated: createRamdisk()
|
||||
|
||||
if config is not None:
|
||||
@@ -97,6 +98,16 @@ def setNanoBenchParameters(config=None, configFile=None, msrConfig=None, msrConf
|
||||
writeFile('/sys/nb/initial_warm_up', str(initialWarmUpCount))
|
||||
paramDict['initialWarmUpCount'] = initialWarmUpCount
|
||||
|
||||
if alignmentOffset is not None:
|
||||
if paramDict.get('alignmentOffset', None) != alignmentOffset:
|
||||
writeFile('/sys/nb/alignment_offset', str(alignmentOffset))
|
||||
paramDict['alignmentOffset'] = alignmentOffset
|
||||
|
||||
if codeOffset is not None:
|
||||
if paramDict.get('codeOffset', None) != codeOffset:
|
||||
writeFile('/sys/nb/code_offset', str(codeOffset))
|
||||
paramDict['codeOffset'] = codeOffset
|
||||
|
||||
if aggregateFunction is not None:
|
||||
if paramDict.get('aggregateFunction', None) != aggregateFunction:
|
||||
writeFile('/sys/nb/agg', aggregateFunction)
|
||||
@@ -112,11 +123,6 @@ def setNanoBenchParameters(config=None, configFile=None, msrConfig=None, msrConf
|
||||
writeFile('/sys/nb/no_mem', str(int(noMem)))
|
||||
paramDict['noMem'] = noMem
|
||||
|
||||
if codeOffset is not None:
|
||||
if paramDict.get('codeOffset', None) != codeOffset:
|
||||
writeFile('/sys/nb/code_offset', str(codeOffset))
|
||||
paramDict['codeOffset'] = codeOffset
|
||||
|
||||
if verbose is not None:
|
||||
if paramDict.get('verbose', None) != verbose:
|
||||
writeFile('/sys/nb/verbose', str(int(verbose)))
|
||||
|
||||
Reference in New Issue
Block a user