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

Submitted by Meng, Mengmeng on Nov. 19, 2015, 10:25 p.m.

Details

Message ID 1447971944-2001-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. 19, 2015, 10:25 p.m.
Get FPS of the two benchmarks in place of GB/S.

v2:
Operating 1000 frame instead of 100.

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

Patch hide | download patch | download mbox

diff --git a/benchmark/benchmark_copy_buffer.cpp b/benchmark/benchmark_copy_buffer.cpp
index 951d8e6..93bf1b6 100644
--- a/benchmark/benchmark_copy_buffer.cpp
+++ b/benchmark/benchmark_copy_buffer.cpp
@@ -30,7 +30,7 @@  double benchmark_copy_buffer_ ##T(void) \
   locals[1] = 4; \
  \
   gettimeofday(&start,0); \
-  for (size_t i=0; i<100; i++) { \
+  for (size_t i=0; i<1000; i++) { \
     OCL_NDRANGE(2); \
   } \
   OCL_FINISH(); \
@@ -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)(1000 / (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..40cb647 100644
--- a/benchmark/benchmark_copy_image.cpp
+++ b/benchmark/benchmark_copy_image.cpp
@@ -45,7 +45,7 @@  double benchmark_copy_image_ ##T(void) \
   locals[1] = 4; \
 \
   gettimeofday(&start,0); \
-  for (size_t i=0; i<100; i++) { \
+  for (size_t i=0; i<1000; i++) { \
     OCL_NDRANGE(2); \
   } \
   OCL_FINISH(); \
@@ -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)(1000 / (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)