- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IVDEP shouldn't make any difference to those array assignments, unless you have set -assume dummy_aliases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I probably simplified too much from the original intention that I had, and forgot the aliasing rules of Fortran.
In my original idea I had derived types with pointer components in mind, which were used in the expression (lhs and rhs). The purpose of the directive was to assert the compiler that no dependencies exist. Apparently I was either confused or too pessimistic...
Good to know about the "-assume dummy_aliases" option. Will probably never want to use it. :-)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page