Quantcast
Channel: Intermédiaire
Viewing all articles
Browse latest Browse all 677

Diagnostic 15344: Loop was not vectorized: vector dependence prevents vectorization

$
0
0

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

Cause:

When using Intel Visual Fortran Compiler's optimization and vectorization report options  -O2 -Qvec-report2 -Qopt-report:2 the vectorization report generated states that loop was not vectorized since vector dependence prevents vectorization.  

Example:

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

integer function foo(a, n)
    implicit none
    integer, intent(in) :: n
    real, intent(inout) :: a(n)
    real :: max
    integer :: inx, i

    max = a(0)
    do i=1,n
        if (max < a(i)) then
            max = a(i)
            inx = i*i
        endif
    end do

    foo = inx

end function

Report from: Vector optimizations [vec]

LOOP BEGIN at  f15344.f90(9,5)
   remark #15344: loop was not vectorized: vector dependence prevents vectorization. First dependence is shown below. Use level 5 report for details   [ f15344.f90(12,13) ]
   remark #15346: vector dependence: assumed ANTI dependence between  line 10 and  line 10   [ f15344.f90(12,13) ]
LOOP END

Resolution:

Rewriting the code as in the following example will resolve vector dependence and the loop will be vectorized

integer function foo(a, n)
    implicit none
    integer, intent(in) :: n
    real, intent(inout) :: a(n)
    real :: max
    integer :: inx, i

    max = a(0)
    do i=1,n
        if (max < a(i)) then
            max = a(i)
            inx = i
        endif
    end do

    foo = inx*inx

end function

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel Fortran

 

 

 

  • Intel Compilers Vectorization Reports Optimization Reports
  • Développeurs
  • Développeurs Intel AppUp®
  • Professeurs
  • Étudiants
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • Windows*
  • Fortran
  • Avancé
  • Intermédiaire
  • Intel® Integrated Native Developer Experience (INDE)
  • Compilateur Intel® Fortran
  • Intel® Fortran Composer XE
  • Intel® Parallel Composer
  • Intel® Visual Fortran Composer XE
  • Intel® Fortran Studio XE
  • Intel® Integrated Native Developer Experience (INDE) Build Edition pour OS X*
  • Intel® Parallel Studio
  • Intel® Parallel Studio XE
  • Intel® Parallel Studio XE Cluster Edition
  • Intel® Parallel Studio XE Composer Edition
  • Intel® Parallel Studio XE Professional Edition
  • URL
  • Rubriques de compilateurs
  • Amélioration des performances
  • Zone des thèmes: 

    IDZone
  • Windows*

  • Viewing all articles
    Browse latest Browse all 677

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>