diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:48 -0600 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:48 -0600 |
commit | 09fcc751ef158898c315ebc9299a0fa3a722d914 (patch) | |
tree | 91116653d831ca5de92274277237ba2a42db3365 /includes/benchmark.h | |
parent | 11e616945340e87a1f567ab92e6dfac3068875b1 (diff) |
New upstream version 0.5.1+git20180227
Diffstat (limited to 'includes/benchmark.h')
-rw-r--r-- | includes/benchmark.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/includes/benchmark.h b/includes/benchmark.h index 39de042b..277f0c07 100644 --- a/includes/benchmark.h +++ b/includes/benchmark.h @@ -27,9 +27,29 @@ void benchmark_nqueens(void); void benchmark_raytrace(void); void benchmark_zlib(void); -gdouble benchmark_parallel_for(guint start, guint end, +typedef struct { + double result; + double elapsed_time; + int threads_used; +} bench_value; + +#define EMPTY_BENCH_VALUE {-1.0f,0,0} + +char *bench_value_to_str(bench_value r); +bench_value bench_value_from_str(const char* str); + +/* Note: + * benchmark_parallel_for(): element [start] included, but [end] is excluded. + * callback(): expected to processes elements [start] through [end] inclusive. + */ +bench_value benchmark_parallel_for(gint n_threads, guint start, guint end, + gpointer callback, gpointer callback_data); + +bench_value benchmark_parallel(gint n_threads, gpointer callback, gpointer callback_data); + +bench_value benchmark_crunch_for(float seconds, gint n_threads, gpointer callback, gpointer callback_data); -extern gdouble bench_results[BENCHMARK_N_ENTRIES]; +extern bench_value bench_results[BENCHMARK_N_ENTRIES]; -#endif /* __BENCHMARK_H__ */
\ No newline at end of file +#endif /* __BENCHMARK_H__ */ |