summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeng Mengmeng <mengmeng.meng@intel.com>2015-11-20 06:25:44 +0800
committerYang Rong <rong.r.yang@intel.com>2015-11-25 11:58:59 +0800
commite75321facfc5e68f1197eeff9a3a0ff4e192760e (patch)
tree47ab46687eea45c7538137b0a700782178c67f72
parentd4d20820bd41a88a1a0abe7c32ee11c1328f2c1c (diff)
Refine the benchmark tests: copy buffer and image.
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> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
-rw-r--r--benchmark/benchmark_copy_buffer.cpp6
-rw-r--r--benchmark/benchmark_copy_image.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/benchmark/benchmark_copy_buffer.cpp b/benchmark/benchmark_copy_buffer.cpp
index 951d8e6c..93bf1b68 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 ad132d7a..40cb647c 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)