[Mesa-dev] [PATCH 2/2] clover: Use 1 as default value for CL_DEVICE_PROFILING_TIMER_RESOLUTION

Tom Stellard thomas.stellard at amd.com
Wed Jul 16 13:49:09 PDT 2014


We use PIPE_QUERY_TIMESTAMP for profiling events, and gallium specifies
that the timestamp be in nanoseconds.
---
 src/gallium/state_trackers/clover/api/device.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 1176668..25d29f5 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -249,7 +249,9 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_PROFILING_TIMER_RESOLUTION:
-      buf.as_scalar<size_t>() = 0;
+      // PIPE_QUERY_TIMESTAMP returns a timestamp in units of nanoseconds,
+      // so we default to 1 here.
+      buf.as_scalar<size_t>() = 1;
       break;
 
    case CL_DEVICE_ENDIAN_LITTLE:
-- 
1.8.1.5



More information about the mesa-dev mailing list