Determine if AVX2/AVX512 acceleration is used

Valued forum members,

I have hired a professional software engineer to program an image processing program whose processing algorithms could benefit from AVX CPU instructions.
The software works exceptionally, and there is reason to believe that acceleration is taking place.

I am curious if there is a way to monitor if and to what extent the acceleration is really being used.

Does anyone have any ideas?


I'm willing to throw an idea in.

I would ask the engineer you hired what it would take to implement a feature that toggles on and off the AVX CPU instructions, and then use a stopwatch to measure the performance difference. If when you toggle the feature, it takes the same amount of time, either the change is relatively small, or the acceleration isn't taking place.

This tells you whether it is using the instructions, and gives you a measure for the improvement in performance. (e.g. The computation takes 10% of the time to complete using AVX instructions than when it doesn't.)


thank you very much for your input.
We considered such a switch before we started. We decided against it as the code contains parts written in assembly for performance reasons. To have a switch, certain parts would have to be written twice using different mechanics, which would be pointless.
I was wondering if a tool like "avx_top" (I just made that up) would exist.
However, that's not really important. I'm just curious.


I assume you have access to binaries generated during compilation, in ELF format maybe. I would start with objdump or similar tool to dump assembly code and search for AVX instructions . There are probably more tools, maybe FreeBSD specific.
I don't know compiler name, version, used flags, target platform etc.. Some time ago there was Intel Vtune (or something similar) but probably available only for other OSes.