File: declare-variant-9.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (58 lines) | stat: -rw-r--r-- 2,111 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
! { dg-do compile }
! { dg-additional-options "-cpp -fdump-tree-gimple" }
! { dg-additional-options "-mno-sse3" { target { i?86-*-* x86_64-*-* } } }

program main
  implicit none
contains
  subroutine f01 ()
  end subroutine
  subroutine f02 ()
    !$omp declare variant (f01) match (device={isa("avx512f",avx512bw)})
  end subroutine
  subroutine f05 ()
  end subroutine
  subroutine f06 ()
    !$omp declare variant (f05) match (device={kind(gpu)})
  end subroutine
  subroutine f07 ()
  end subroutine
  subroutine f08 ()
    !$omp declare variant (f07) match (device={kind("cpu")})
  end subroutine
  subroutine f09 ()
  end subroutine
  subroutine f10 ()
    !$omp declare variant (f09) match (device={isa(sm_35)})
  end subroutine
  subroutine f11 ()
  end subroutine
  subroutine f12 ()
    !$omp declare variant (f11) match (device={arch(nvptx)})
  end subroutine
  subroutine f13 ()
  end subroutine
  subroutine f14 ()
    !$omp declare variant (f13) match (device={arch("i386"),isa(sse4)})
  end subroutine
  subroutine f17 ()
  end subroutine
  subroutine f18 ()
    !$omp declare variant (f17) match (device={kind("any","fpga")})
  end subroutine

  subroutine test1 ()
    integer ::  i;
    call f02 ()	! { dg-final { scan-tree-dump-times "f02 \\\(\\\);" 1 "gimple" } }
    call f14 ()	! { dg-final { scan-tree-dump-times "f14 \\\(\\\);" 1 "gimple" } }
    call f18 ()	! { dg-final { scan-tree-dump-times "f18 \\\(\\\);" 1 "gimple" } }
  end subroutine

  subroutine test3 ()
    call f06 ()	! { dg-final { scan-tree-dump-times "f06 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
    call f08 ()	! { dg-final { scan-tree-dump-times "f07 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
    call f10 ()	! { dg-final { scan-tree-dump-times "f10 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* amdgcn*-*-* } } } } }
    call f12 ()	! { dg-final { scan-tree-dump-times "f12 \\\(\\\);" 1 "gimple" { target { ! { nvptx*-*-* } } } } }
		! { dg-final { scan-tree-dump-times "f11 \\\(\\\);" 1 "gimple" { target { nvptx*-*-* } } } }
  end subroutine
end program