Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Diagnostic 15335: Vectorization possible but seems inefficient

$
0
0

Product Version: Intel(R) Visual Fortran Compiler XE 15.0.0.070 

Cause: 

The vectorization report generated using Visual Fortran Compiler's optimization and vectorization report options  -O2 -Qvec-report2 -Qopt-report:2 states that loop was not vectorized: vectorization possible but seems inefficient.

Example:

An example below will generate the following remark in optimization report:

subroutine foo(a, b, n)
    implicit none
    integer, intent(in) :: n
    real, intent(inout) :: a(n)
    real, intent(out)   :: b
    real :: x = 0
    integer :: i

    do i=1,n
            x = x + a(2*i)
    end do

    b = x

end subroutine foo

 

 Report from: Vector optimizations [vec]

LOOP BEGIN at f15335.f90(9,5)

   remark #15335: loop was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
LOOP END

Resolution:

Using !DEC$ VECTOR ALWAYS directive in the code will vectorize the loop by overriding efficiency heuristics of the vectorizer.

See also:   
VECTOR and NOVECTOR

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel Fortran

 


Viewing all articles
Browse latest Browse all 3384

Latest Images

Trending Articles



Latest Images