- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been in the habit of using __MIC__ to tell the compiler how to vectorize (or not) e.g.
#if __MIC__
a(:n)= pack(b(:n),b(:n)>0)
#else
j= 0
do i= 1,n
if(b(i) > 0.)then
j= j+1
a(j)= b(i)
endif
enddo
#endif
or (for the case where the compiler vectorizes for AVX but loses performance)
#if ! __MIC__
!dir$ novector
#endif
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page