Profiling Report C++

While you could parse back the profiling report, I’d recommend just accessing the report object itself:

report = my_mo.profile()

conv2d_sum = 0
conv2d_perc = 0
for call in report.calls:
    if "conv2d" in call["Name"]:
        conv2d_sum += call["Duration (us)"].microseconds
        conv2d_perc += call["Percent"].percent

print(conv2d_sum)
print(conv2d_perc)

This example is in python, but you could do the same thing in C++.