Dear all,
I have a few host functions and each function wraps a kernel. I want to calculate the run time of these functions. Is the following method OK?
float time;
cudaEvent_t start,stop;
cudaEventCreate(&start);
cudaEventCreate(&stop);
cudaEventRecord( start,0 );
host_function_1;//each host function launches a kernel
host_function_2;
…
host_function_3;
cudaEventRecord( stop,0 );
cudaEventSynchronize(stop);
cudaEventElapsedTime(&time,start,stop);
Thanks,
Chandler