Collecting different metrics for kernels in new CUPTI profiling API

Hello,

I’d like to ask if it is possible to interleave collection of different metrics for different kernels over multiple passes in the new CUPTI profiling API (using combination of user replay and autorange profiling).

E.g. I have kernels A and B. For kernel A, I want to collect metrics x and y. For kernel B, metrics y and z. Assuming, that collection requires multiple passes, the interleave could look like this:

  1. Launch profiling pass for kernel A, collect portion of data for metrics x, y
  2. Launch profiling pass for kernel B, collect portion of data for metrics y, z
  3. Launch profiling pass for kernel B, collect portion of data for metrics y, z
  4. Launch profiling pass for kernel A, collect portion of data for metrics x, y

In the old event/callback API, this was possible to do by creating multiple event group sets (calling cuptiMetricCreateEventGroupSets for different kernels with different metrics) and then passing the information about the event set that I wanted to collect data for into cuptiSubscribe before starting a profiling pass.

In the new API, I assume I need to create separate config image and counter data image when I want to collect data for different metrics. However, after that I’m not sure how to tell the profiler which data image it should use (information about counter data image is passed into CUpti_Profiler_BeginSession_Params, but I guess it is not intended to call cuptiProfilerBeginSession and cuptiProfilerEndSession each time I want to swap to different data image when beginning a new pass).

Is this somehow doable in the new API? If so, some example or hint how to do it would be great.

Thanks for reading.

Regards,
Filip