I've been in the habit of using __MIC__ to tell the compiler how to vectorize (or not) e.g.
do i= 1,n
if(b(i) > 0.)then
or (for the case where the compiler vectorizes for AVX but loses performance)
#if ! __MIC__
Now that compilers support AVX512, it appears that additional macros will be needed, e.g.
#if (! __KNC__) && (! __AVX512F__)
Is there a better way? Now that both ifort and gfortran are excessively aggressive sometimes about vectorization, I've introduced some conditional real,volatile :: declarations, but this is getting ugly.
I've been going through source code to remove conditional compilations where the latest Intel compilers make the right decision about vectorization, but it seems unlikely that compilers will get any better on this.
Tim, we haven't created preprocessor symbols for instruction set subsets. If you know you are going to compile for AVX512 you can define your own symbol and reference it. I don't think our compiler wants to go down the path of specific macros for this sort of thing. Certainly we're interested in test cases where automatic vectorization hurts rather than helps - a Premier Support issue would be best for this sort of thing.