summaryrefslogtreecommitdiff
path: root/utests/utest_helper.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 /utests/utest_helper.cpp
parenta1ae5876623858957c3841edf7d0f79bc193ad3a (diff)
downloadbeignet-25a6a17a4ec46427ac29a0f0b4ce765c440864c7.tar.gz
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 'utests/utest_helper.cpp')
-rw-r--r--utests/utest_helper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 591054e9..d3c378e9 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -681,7 +681,7 @@ int cl_INT_ULP(int int_number)
return 0;
}
-int time_subtract(struct timeval *y, struct timeval *x, struct timeval *result)
+double time_subtract(struct timeval *y, struct timeval *x, struct timeval *result)
{
if ( x->tv_sec > y->tv_sec )
return -1;
@@ -699,6 +699,6 @@ int time_subtract(struct timeval *y, struct timeval *x, struct timeval *result)
}
}
- int msec = 1000.0*(y->tv_sec - x->tv_sec) + (y->tv_usec - x->tv_usec)/1000.0;
+ double msec = 1000.0*(y->tv_sec - x->tv_sec) + (y->tv_usec - x->tv_usec)/1000.0;
return msec;
-} \ No newline at end of file
+}