summaryrefslogtreecommitdiff
path: root/benchmark/benchmark_use_host_ptr_buffer.cpp
diff options
context:
space:
mode:
authorChuanbo Weng <chuanbo.weng@intel.com>2015-02-03 10:27:22 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-02-06 12:46:22 +0800
commit25a6a17a4ec46427ac29a0f0b4ce765c440864c7 (patch)
tree2a9f902f2509a6f70717f269febc915495f53139 /benchmark/benchmark_use_host_ptr_buffer.cpp
parenta1ae5876623858957c3841edf7d0f79bc193ad3a (diff)
Refine benchmark output.
Change output measurement from time to bandwidth, so we can compare all benchmark results easily. And change return type of benchmark from int to double, because int is not precise enough. v2: Change output measurement from time to bandwidth. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'benchmark/benchmark_use_host_ptr_buffer.cpp')
-rw-r--r--benchmark/benchmark_use_host_ptr_buffer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/benchmark/benchmark_use_host_ptr_buffer.cpp b/benchmark/benchmark_use_host_ptr_buffer.cpp
index 80b6c5c3..9e3d1551 100644
--- a/benchmark/benchmark_use_host_ptr_buffer.cpp
+++ b/benchmark/benchmark_use_host_ptr_buffer.cpp
@@ -1,7 +1,7 @@
#include "utests/utest_helper.hpp"
#include <sys/time.h>
-int benchmark_use_host_ptr_buffer(void)
+double benchmark_use_host_ptr_buffer(void)
{
struct timeval start,stop;
@@ -32,7 +32,9 @@ int benchmark_use_host_ptr_buffer(void)
free(buf_data[0]);
buf_data[0] = NULL;
- return time_subtract(&stop, &start, 0);
+ double elapsed = time_subtract(&stop, &start, 0);
+
+ return BANDWIDTH(n*sizeof(uint32_t)*100*2, elapsed);
}
MAKE_BENCHMARK_FROM_FUNCTION(benchmark_use_host_ptr_buffer);