Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Question on optimization directive IVDEP

$
0
0

Hello,

consider the code:

module ifc_ivdep_test
contains
  subroutine sub1 (z, x, y)
    real, intent(out) :: z(:)
    real, intent(in)  :: x(:)
    real, intent(in)  :: y(:)
!dir$ ivdep
    z = x * y           ! OK
  end subroutine sub1
  subroutine sub2 (z, x, y)
    real, intent(out) :: z(:,:)
    real, intent(in)  :: x(:,:)
    real, intent(in)  :: y(:,:)
!dir$ ivdep
    z = x * y           ! Warning
  end subroutine sub2
end module ifc_ivdep_test

Compiling this code gives a warning:

% ifort -V -c ifc_ivdep_test.f90
Intel(R) Fortran Compiler XE for applications running on IA-32, Version 15.0.5.223 Build 20150805
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

 Intel(R) Fortran 15.0-1818
ifc_ivdep_test.f90(14): warning #7866: The statement following this DEC loop optimization directive must be an iterative do-stmt, a vector assignment, an OMP do-directive or a parallel-do-directive, or an OMP simd-directive or a do-simd-directive.
!dir$ ivdep
------^

I am contemplating the restrictions I read from this warning.  The rank-1 array expression in sub1 appears fine.  Is there a reason to reject the rank-2 expression in sub2?  Assuming that only the innermost implicit loop is eligible for vectorization, it would be natural to assume the directive to apply to that loop.

Just wondering,

Harald

 


Viewing all articles
Browse latest Browse all 3270


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