I just wonder how to compute time in Cuda…
I have a small test, the code is like this
t1=clock();
for(i=0;i<iteration_time;i++)
{
…call kernel_function…
}
t2=clock();
then I can not get the correct time when I use t2-t1, because I always get a tiny number no matter how I change the iteration_time… it is the same case when I use cutStartTimer and so forth…
I think it is because after the CPU calls the GPU function, it comes back without waiting for the result from GPU. Someone has the same case as me ?
Thanks!
Shuai