title: Calculating time using clock gives value as zero - linux
body: <p>I have a cuda code which performs calculation on GPU. 
  I am using clock(); to find out timings</p>
  
  <p>My code structure is </p>
  
  <pre><code>__global__ static void sum(){
  
  // calculates sum 
  }
  
  extern "C"
  int run_kernel(int array[],int nelements){
   clock_t start, end;
    start = clock();
    //perform operation on gpu - call sum
   end = clock();
   double elapsed_time = ((double) (end - start)) / CLOCKS_PER_SEC;
   printf("time required : %lf", elapsed_time);
  }
  </code></pre>
  
  <p>But the time is always 0.0000
  I checked printing start and end time. Start has some value but end time is always zero. </p>
  
  <p>Any idea what might be the cause? Any alternatives to measure time. </p>
  
  <p>Any help would be appreciated. </p>
  
  <p>Thanks</p>