title: What is the clock measure by clock() and clock64() in CUDA?
body: <p>What is the clock measure by <code>clock()</code> and <code>clock64()</code> in CUDA ?</p>
  
  <p>According to <a href="http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#time-function" rel="noreferrer">CUDA documentation</a> the clock is  'per-multiprocessor counter'.  According to my understanding this refers to Primary GPU clock (not the shader clock). </p>
  
  <p>But when I measure clock counts and convert it to time values using primary GPU clock frequency, the results I get are twice large as the real values (I measure real values using the kernel execution time from  host code using cuda events). This suggests <code>clock()</code> returns the shader clock frequency instead of the primary GPU clock.</p>
  
  <p>How can I solve this confusion ?</p>
  
  <p>EDIT : 
  I calculated the primary GPU clock frequency by dividing the clock rate I get from cudaGetDeviceProperties by 2. As far as I understand the value given by <a href="http://developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/docs/online/group__CUDART__DEVICE_g5aa4f47938af8276f08074d09b7d520c.html" rel="noreferrer">cudaGetDeviceProperties</a> is the shader clock frequency. </p>