Code coverage using NVCC compiler

I am trying to instrument generated code/executable for use by gprof/gcov by adding “-pg” to my compiler flags.
But unfortunately i do not find any such instrumented file getting generated. Can anyone explain me or suggest some other alternative ?

Refer link :http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#options-for-altering-compiler-linker-behavior

To the best of my knowledge, nvcc doesn’t offer device code instrumentation for the purpose of coverage analysis. In fact the only tool chain I know that offers that feature is gcc.

You could obviously do your own instrumentation for limited amounts of device code. What is driving the need for coverage analysis in your use case?

Are you wanting gprof-type output for device code or for host code?

If it is for host code, try

-Xcompiler -pg

I just tried it, and I get the expected gmon.out when I do that. However I did not go through the process of pulling it into gprof.

If it is for device code, this is the wrong approach as already discussed by @njuffa.