Add a new 'init' directive that specifies the name of the function to
call to do function-specific initialization.
- include-sources: This should be assigned a comma-separated list of source
files that need to be included to provide definitions of global variables
and functions (specifically, this includes using "#include "source").
+ - init: Name of an initializer function to call to initialize the benchtest.
- name: See following section for instructions on how to use this directive.
Lines beginning with a single hash '#' are treated as comments. See
unsigned long iters, res;
+#ifdef BENCH_INIT
+ BENCH_INIT ();
+#endif
TIMING_INIT (res);
iters = 1000 * res;
else:
getret = ''
+ # Test initialization.
+ if directives['init']:
+ print('#define BENCH_INIT %s' % directives['init'])
+
print(EPILOGUE % {'getret': getret, 'func': func})
'args': [],
'includes': [],
'include-sources': [],
- 'ret': ''
+ 'ret': '',
+ 'init': ''
}
try: