By using the -Qax compiler flag I can get the compiler to generate code to run efficiently on different kinds of processor, for example
-QaxAVX,SSE2
generates code for AVX and SSE2. At run time, a suitable code path is chosen depending on what hardware I'm running on.
I would like to be able to test the different code paths on a single machine. In my case, my processor has AVX instructions available, but I would like to test the SSE2 path as well. Is there any way I can do this, or must I just run on a machine which has SSE2 but not AVX?
Apart from testing purposes, another reason for wanting to do this is that users of the library software that I help build sometimes want to force the library to avoid AVX instructions so that they get more reproducible results across different machines.
What I'd like to do is similar to what you can do when using MKL:
https://software.intel.com/en-us/articles/introduction-to-the-conditiona...
which allows you to choose CPU via a library call or setting of an environment variable.
I guess what I'm trying to do is the equivalent of intercepting whatever compiler run-time routine determines the current hardware capablilities, so that I can return a result different to the actual hardware.
Mick Pont