2 Replies Latest reply on Sep 26, 2014 5:38 AM by yy1990cn

    How to measure the total elapsed time?

    yy1990cn

      I've written a OpenCL program, when I measure this program with time in bash, it gives me the following output:

      real0m1.141s
      user0m0.167s
      sys0m0.097s
      user+sys0m0.264s

      and then I measure the same program in CodeXL, it shows that the total elapsed time is 0.077s. which one is more accurate? what is the best way to measure the total elapsed time of OpenCL programs? thx.

        • Re: How to measure the total elapsed time?
          benc

          Hello yy1990cn

           

          What do you use in codeXL to measure your execution time?

          CodeXL can profile in 2 different mode :

               1) HW counter, which will give you the time spent in the GPU and only the GPU

               2) API trace which will also give you the time spent in the driver/OS. In API trace you can see when you issue a specific command on host and when it was actually flushed to the GPU but also when it finished.

           

          Here I bet you measured only the GPU execution time using codeXL, while in bash you measurethe CPU time so actually you see the overhead of the driver/OS

           

          Ben