[2/4] Refine the benchmark tests: copy buffer and image.

Submitted by Meng, Mengmeng on Nov. 18, 2015, 3:42 a.m.

Details

Message ID 1447818178-12257-1-git-send-email-mengmeng.meng@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Meng, Mengmeng Nov. 18, 2015, 3:42 a.m.
Get FPS of the two benchmarks in place of GB/S.

Signed-off-by: Meng Mengmeng <mengmeng.meng@intel.com>
---
 benchmark/benchmark_copy_buffer.cpp | 4 ++--
 benchmark/benchmark_copy_image.cpp  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/benchmark/benchmark_copy_buffer.cpp b/benchmark/benchmark_copy_buffer.cpp
index 951d8e6..f9efdf3 100644
--- a/benchmark/benchmark_copy_buffer.cpp
+++ b/benchmark/benchmark_copy_buffer.cpp
@@ -45,10 +45,10 @@  double benchmark_copy_buffer_ ##T(void) \
  \
   double elapsed = time_subtract(&stop, &start, 0); \
  \
-  return BANDWIDTH(sz * sizeof(M) * 2 * 100, elapsed); \
+  return (double)(100 / (elapsed * 1e-3)); \
 } \
  \
-MAKE_BENCHMARK_FROM_FUNCTION_KEEP_PROGRAM(benchmark_copy_buffer_ ##T, true, "GB/S");
+MAKE_BENCHMARK_FROM_FUNCTION_KEEP_PROGRAM(benchmark_copy_buffer_ ##T, true, "FPS");
 
 BENCH_COPY_BUFFER(uchar,"bench_copy_buffer_uchar",unsigned char)
 BENCH_COPY_BUFFER(ushort,"bench_copy_buffer_ushort",unsigned short)
diff --git a/benchmark/benchmark_copy_image.cpp b/benchmark/benchmark_copy_image.cpp
index ad132d7..a74ed88 100644
--- a/benchmark/benchmark_copy_image.cpp
+++ b/benchmark/benchmark_copy_image.cpp
@@ -60,10 +60,10 @@  double benchmark_copy_image_ ##T(void) \
 \
   double elapsed = time_subtract(&stop, &start, 0); \
 \
-  return BANDWIDTH(sz * sizeof(M)*2 * 100, elapsed); \
+  return (double)(100 / (elapsed * 1e-3)); \
 } \
 \
-MAKE_BENCHMARK_FROM_FUNCTION_KEEP_PROGRAM(benchmark_copy_image_ ##T, true, "GB/S");
+MAKE_BENCHMARK_FROM_FUNCTION_KEEP_PROGRAM(benchmark_copy_image_ ##T, true, "FPS");
 
 BENCH_COPY_IMAGE(uchar,unsigned char,CL_UNSIGNED_INT8)
 BENCH_COPY_IMAGE(ushort,unsigned short,CL_UNSIGNED_INT16)