From d537de7deffa6036dab573ff174b7f8c8e470437 Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Thu, 6 Nov 2014 17:24:39 -0800 Subject: Clean up canonical mt benchmarks and reorganize extra versions in /mt. All versions support support at least 1/2/4 threads. --- benchmarks/common/util.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'benchmarks/common') diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h index 6c4f963..638f024 100644 --- a/benchmarks/common/util.h +++ b/benchmarks/common/util.h @@ -113,4 +113,15 @@ static void __attribute__((noinline)) barrier(int ncores) #include "encoding.h" #endif +#define stringify_1(s) #s +#define stringify(s) stringify_1(s) +#define stats(code, iter) do { \ + unsigned long _c = -rdcycle(), _i = -rdinstret(); \ + code; \ + _c += rdcycle(), _i += rdinstret(); \ + if (cid == 0) \ + printf("\n%s: %ld cycles, %ld.%ld cycles/iter, %ld.%ld CPI\n", \ + stringify(code), _c, _c/iter, 10*_c/iter%10, _c/_i, 10*_c/_i%10); \ + } while(0) + #endif //__UTIL_H -- cgit v1.1