Closed leiwen83 closed 3 years ago
You should be instrumenting only once, at the first launch of given kernel. Subsequent calls to the same kernel do not need to be instrumented.
To accomplish that you can use a set
std::unordered_set<CUfunction> already_instrumented;
where you put the CUfunction after it is already instrumented, so the next time you encounter the same CUfunction you will not instrument it again.
All the example tools do that, but see the tool instr_count.cu for a small example.
got it. thx
The instrument is time cost process, so whether the tool could support modify code once, then it is left in memory and loaded for running for thereafter while holding the change?