How to use Timer in cuda cutil.h not found, fedora 10

I want to use timer in my program.So I wrote the following in my code :-

unsigned int timer=0;
scan_best<<< 1, 10 >>>(g_odata, g_idata, n);//Call the kernel

copy the data g_odata from device global memory into m_odata in main memory using cudaMemcpy

printf(“Processing time=%f(ms)\n”,cutGetTimerValue(timer));

I understand that I need to included cutil.h for this, so I included cutil.h. But I am getting the following error while compiling the code:

[root@H/]# nvcc -o text error: cutil.h: No such file or directory

I would appreciate your suggestions in this regard.

Thanks for your precious time!!

Disclaimer: You really shouldn’t use the cutil library for anything. It is designed for supporting the SDK sample programs and nothing more. It isn’t thread safe, it isn’t all that well tested. it isn’t documented.

With that out of the way, you need to point nvcc at the place where cutil.h is located (should be something like C/common/inc inside the SDK, and you will need to point the linker at the place where the cutil library is located (should be something like C/lib inside the SDK).

Thanks avidday

could you please tell me Best way to measure the time of my kernal and which header file i need.

The runtime API Events functions will get you reliable device side timers. For host side timers, the POSIX timer API is the right thing to use, because it is thread safe.

Avidday I just want to measure execution time of the kernel, still then do I need to have host side timers? Could you please send me a link where all this is explained with an example such as somewhere in the sdk?

No, you don’t need host time timers in that case. The transposeNew example in the 2.3 SDK uses events for kernel timing, Between that and the documentation, it should be pretty simple to work out.