cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sandyandr
Adept I

Strange behavior of clock()

My "main" consists of 3 jobs - OpenCL kernel call, OpenGL render call, OpenCL kernel call. Each part exec-time is calculated by two clock() calls before and after each part. After enabling GLSL shaders for render process some second and third calls became 0.000 sec duration each or one of them without any visible reason. It seems that their real counters just had been added to first part exec-time. But how can it be? OpenXL shows all fine, but I need to know how long my OpenGL part lasts.

0 Likes
2 Replies
nou
Exemplar

do you call clFinish() and glFinish() before timing? because both API are asynchronous.

0 Likes

Sure. Every time. Because each part depends on previous part's results.

0 Likes