| 1 |
! { dg-do compile { target i?86-*-* x86_64-*-* } } |
| 2 |
! { dg-additional-options "-mavx2" } |
| 3 |
|
| 4 |
module main |
| 5 |
implicit none |
| 6 |
contains |
| 7 |
function f1 (x, y, z) |
| 8 |
integer, dimension(4) :: f1 |
| 9 |
real, dimension(4), intent(in) :: x, y |
| 10 |
real, intent(out) :: z |
| 11 |
|
| 12 |
f1 = x |
| 13 |
end function |
| 14 |
|
| 15 |
function f2 (x, y, z) |
| 16 |
integer, dimension(8) :: f2 |
| 17 |
real, dimension(8), intent(in) :: x, y |
| 18 |
real, intent(out) :: z |
| 19 |
|
| 20 |
f2 = x |
| 21 |
end function |
| 22 |
|
| 23 |
function f3 (x, y, z) |
| 24 |
integer, dimension(4) :: f3 |
| 25 |
real, dimension(4), intent(in) :: x, z |
| 26 |
integer, intent(in) :: y |
| 27 |
|
| 28 |
f3 = x |
| 29 |
end function |
| 30 |
|
| 31 |
integer function f4 (x, y, z) |
| 32 |
real, intent(in) :: x, y |
| 33 |
real, pointer, intent(out) :: z |
| 34 |
!$omp declare variant (f1) match (construct={parallel,do,simd(simdlen(4),notinbranch,uniform(z),aligned(z:16))}) ! { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" } |
| 35 |
end function |
| 36 |
|
| 37 |
integer function f5 (u, v, w) |
| 38 |
real, intent(in) :: u, v |
| 39 |
real, pointer, intent(out) :: w |
| 40 |
!$omp declare variant (f1) match (construct={parallel,do,simd(uniform(w),simdlen(8*2-12),aligned(w:16),notinbranch)}) ! { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" } |
| 41 |
end function |
| 42 |
|
| 43 |
integer function f6 (u, v, w) |
| 44 |
real, intent(in) :: u, v |
| 45 |
real, pointer, intent(out) :: w |
| 46 |
!$omp declare variant (f1) match (construct={parallel,do,simd(linear(w),notinbranch,simdlen(4),aligned(w:16))}) ! { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" } |
| 47 |
end function |
| 48 |
|
| 49 |
integer function f7 (u, v, w) |
| 50 |
real, intent(in) :: u, v |
| 51 |
real, pointer, intent(out) :: w |
| 52 |
!$omp declare variant (f1) match (construct={parallel,do,simd(uniform(w),notinbranch,simdlen(4),aligned(w:8))}) ! { dg-error "'f1' used as a variant with incompatible 'construct' selector sets" } |
| 53 |
end function |
| 54 |
|
| 55 |
integer function f8 (u, v, w) |
| 56 |
real, intent(in) :: u, v |
| 57 |
real, pointer, intent(out) :: w |
| 58 |
!$omp declare variant (f1) match (construct={parallel,do,simd(uniform(w),notinbranch,simdlen(4),aligned(w))}) |
| 59 |
end function |
| 60 |
|
| 61 |
integer function f9 (x, y, z) |
| 62 |
real, intent(in) :: x, y |
| 63 |
real, pointer, intent(out) :: z |
| 64 |
!$omp declare variant (f2) match (construct={do,simd(uniform(z),simdlen(8),notinbranch)}) ! { dg-error "'f2' used as a variant with incompatible 'construct' selector sets" } |
| 65 |
end function |
| 66 |
|
| 67 |
integer function f10 (x, y, q) |
| 68 |
real, intent(in) :: x, y |
| 69 |
real, pointer, intent(out) :: q |
| 70 |
!$omp declare variant (f2) match (construct={do,simd(notinbranch,simdlen(2+2+4),uniform (q))}) ! { dg-error "'f2' used as a variant with incompatible 'construct' selector sets" } |
| 71 |
end function |
| 72 |
|
| 73 |
integer function f11 (x, y, z) |
| 74 |
real, intent(in) :: x, y |
| 75 |
real, pointer, intent(out) :: z |
| 76 |
!$omp declare variant (f2) match (construct={do,simd(linear(z:2),simdlen(8),notinbranch)}) |
| 77 |
end function |
| 78 |
|
| 79 |
integer function f12 (x, y) |
| 80 |
integer, intent(in) :: x, y |
| 81 |
!$omp declare variant (f3) match (construct={simd(simdlen(4),inbranch,linear(y:1))}) ! { dg-error "'f3' used as a variant with incompatible 'construct' selector sets" } |
| 82 |
end function |
| 83 |
|
| 84 |
integer function f13 (x, q) |
| 85 |
integer, intent(in) :: x, q |
| 86 |
!$omp declare variant (f3) match (construct={simd(inbranch, simdlen (5-1), linear (q:4-3))}) ! { dg-error "'f3' used as a variant with incompatible 'construct' selector sets" } |
| 87 |
end function |
| 88 |
|
| 89 |
integer function f14 (x, q) |
| 90 |
integer, intent(in) :: x, q |
| 91 |
!$omp declare variant (f3) match (construct={simd(inbranch,simdlen(4),linear(q:2))}) |
| 92 |
end function |
| 93 |
end module |