Intel® Advisor Help

Issue: Scalar math function call(s) present

Math functions in the loop body are preventing the compiler from effectively vectorizing the loop. Improve performance by enabling vectorized math call(s).

Recommendation: Enable inline expansion

Inlining is disabled by compiler option. To fix: When using the Ob or inline-level compiler option to control inline expansion, replace the 0 argument with the 1 argument to enable inlining when an inline keyword or attribute is specified or the 2 argument to enable inlining of any function at compiler discretion.

Windows* OS Linux* OS
/Ob1 or /Ob2 -inline-level=1 or -inline-level=2

Read More:

Recommendation: Use the Intel short vector math library for vector intrinsics

Your application calls scalar instead of vectorized versions of math functions. To fix: Do all of the following:

Example:

gfortran PROGRAM.FOR -O2 -ftree-vectorize -funsafe-math-optimizations -mveclibabi=svml -L/opt/intel/lib/intel64 -lm -lsvml -Wl,-rpath=/opt/intel/lib/intel64

program main
parameter (N=100000000)
real*8 angles(N), results(N)
integer i
call srand(86456)

  do i=1,N
     angles(i) = rand()
  enddo

! the loop will be auto-vectorized
  do i=1,N
     results(i) = cos(angles(i))
  enddo

end

Read More:

Recommendation: Use a Glibc library with vectorized SVML functions

Your application calls scalar instead of vectorized versions of math functions. To fix: Do all of the following:

Note : Also use the -I/path/to/glibc/install/include and -L/path/to/glibc/install/lib compiler options if you have multiple Glibc libraries installed on the host.

Example:

gfortran PROGRAM.FOR -O2 -fopenmp -ffast-math -lrt -lm -mavx2

program main
parameter (N=100000000)
real*8 angles(N), results(N)
integer i
call srand(86456)

  do i=1,N
     angles(i) = rand()
  enddo

!$OMP SIMD
  do i=1,N
     results(i) = cos(angles(i))
  enddo

end

Read More:

Recommendation: Vectorize math function calls inside loops

Your application calls serialized versions of math functions when you use the precise floating point model. To fix: Do one of the following:

Example:

subroutine add(A, N, X)
   integer N, X
   real    A(N)
!DIR$ OMP SIMD
   do i=x+1, n
      a(i) = a(i) + a(i-x)
   enddo
end

Read More:

Recommendation: Change the floating point model

Your application calls serialized versions of math functions when you use the strict floating point model. To fix: Do one of the following:

Example:

gfortran program.for -O2 -fopenmp -fp-model precise -fast-transcendentals

!DIR$ OMP SIMD COLLAPSE(2)
do i = 1, N
  a(i) = b(i) * c(i)
  do j = 1, N
    d(j) = e(j) * f(j)
  enddo
enddo

Read More: