[Beignet] [PATCH v2 2/4] Refine the benchmark tests: copy buffer and image.
Meng Mengmeng
mengmeng.meng at intel.com
Thu Nov 19 14:25:44 PST 2015
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 at intel.com>
---
benchmark/benchmark_copy_buffer.cpp | 6 +++---
benchmark/benchmark_copy_image.cpp | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
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)
--
1.9.1
More information about the Beignet
mailing list