how to disable vectorization
Tim Prince
n8tm@aol.com
Sun Nov 15 01:34:00 GMT 2015
On 11/14/2015 5:00 PM, Tobias Burnus wrote:
> Tim Prince wrote:
>> Now that gfortran 6.0 has become aggressive enough on vectorization to
>> reduce performance in some cases, is there an equivalent to:
>> gcc (by function): __attribute__((optimize("no-tree-vectorize")))
>> or ifort (by DO loop) !dir$ novector ?
>
> I think there isn't but I wonder whether the OpenMP's "!$omp simd
> savelen(1)" directive is able to do this.
>
> (Requires -fopenmp-simd or -fopenmp, the former only enables the SIMD
> directives, ignoring other OpenMP directives, without linking libgomp
> and without implying -frecursive.)
>
> Cheers,
>
> Tobias
>
>
This works for a DO loop (allowing a compiler targeting Xeon Phi to
optimize):
#ifndef __MIC__
!$omp simd safelen(1)
#endif
leaving no way to control the optimization under f90 array assignment.
This makes 14 omp simd loops, along with 17 omp parallel regions, in my
benchmark.
I brought up omp simd safelen last month when rehearsing for my Intel
sponsored webinar and it was the first time they had seen an example of
it; now you've pointed out another use. It would also reconcile the C
source code between Intel and gnu compilers.
Thanks,
--
Tim Prince
More information about the Fortran
mailing list