From f0069c0605ed866f1fdfb39b2ddd91c73de5fb5e Mon Sep 17 00:00:00 2001 From: Kalle Immonen Date: Fri, 20 Oct 2017 15:21:47 +0300 Subject: [PATCH] Don't multiply GPU profiling times with timer resolution. CL_PROFILING_COMMAND_START/CL_PROFILING_COMMAND_END already returns the count in nanoseconds. On some devices CL_DEVICE_PROFILING_TIMER_RESOLUTION returns 1, which can mask the bug. --- include/CLUtils.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/CLUtils.hpp b/include/CLUtils.hpp index ff779ea..a25bdfc 100644 --- a/include/CLUtils.hpp +++ b/include/CLUtils.hpp @@ -449,9 +449,8 @@ namespace clutils GPUTimer (cl::Device &device) { period tPeriod; - size_t tRes = device.getInfo (); // x nanoseconds // Converts nanoseconds to seconds and then to the requested scale - tUnit = (double) tPeriod.den / (double) tPeriod.num / 1000000000.0 * tRes; + tUnit = (double) tPeriod.den / (double) tPeriod.num / 1000000000.0; } /*! \brief Returns a new unpopulated event.