Quantcast
Channel: Intermedio
Viewing all articles
Browse latest Browse all 672

Diagnostic 15534: Loop was not vectorized: loop contains arithmetic if or computed goto.

$
0
0

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

Cause:

The vectorization report generated when using Visual Fortran Compiler's optimization options ( -O3 or -O2  -Qopt-report:2 ) states that loop was not vectorized since loop contains GOTO statement.

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)
      integer, intent(inout) :: b(n)
      integer:: i

      do i=1,n
             goto (100,200,300,400,100,200,300,400) b(i)
100    a(i) = a(i) + 1
         if (a(i) .gt. 0) goto 400
200    a(i) = a(i) + 1
400     continue
300    a(i) = a(i) + 1
      end do

end subroutine foo

Report from: Loop nest, Vector & Auto-parallelization optimizations [loop, vec, par]

Non-optimizable loops:

LOOP BEGIN at f15534.f90(15,7)
   remark #15534: loop was not vectorized: loop contains arithmetic if or computed goto. Consider using if-then-else statement.     
LOOP END

Resolution:

Premature exits from loops prevent vectorization, rewriting the code without GOTO statements will get this loop vectorized.

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel Fortran

  • vectorization
  • Intel Compilers Vectorization Reports Optimization Reports
  • Optimization Reports
  • vec-report vectorization reports
  • diagnostic messages
  • Desarrolladores
  • Socios
  • Profesores
  • Estudiantes
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • Yocto Project
  • Internet de las cosas
  • Windows*
  • Fortran
  • Avanzado
  • Intermedio
  • Intel® Composer XE
  • Intel® Fortran Composer XE
  • Intel® Visual Fortran Composer XE
  • Intel® Cluster Studio XE
  • Intel® Fortran Studio XE
  • Intel® Parallel Studio XE
  • Intel® Parallel Studio XE Cluster Edition
  • Intel® Parallel Studio XE Composer Edition
  • Intel® Parallel Studio XE Professional Edition
  • Intel® Advanced Vector Extensions
  • Herramientas de desarrollo
  • Optimización
  • Vectorización
  • Sistemas integrados
  • Portátil
  • Servidor
  • Escritorio
  • Dirección URL
  • Temas de compilador
  • Comprobación de errores
  • Mejora del rendimiento
  • Zona de temas: 

    IDZone
  • Windows*

  • Viewing all articles
    Browse latest Browse all 672


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