aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/goacc/routine-level-of-parallelism-1.f90
blob: 99929f136f698f4277712f4815218374fe712517 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
! Test various aspects of clauses specifying compatible levels of parallelism
! with the OpenACC routine directive.  The C/C++ counterpart is
! '../../c-c++-common/goacc/routine-level-of-parallelism-2.c'.

! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
! aspects of that functionality.

subroutine g_1
  !$acc routine gang
  ! { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-2 }
  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-3 }
  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-4 }
end subroutine g_1

subroutine s_1_2a
  !$acc routine
end subroutine s_1_2a

subroutine s_1_2b
  !$acc routine seq
end subroutine s_1_2b

subroutine s_1_2c
  !$acc routine (s_1_2c)
end subroutine s_1_2c

subroutine s_1_2d
  !$acc routine (s_1_2d) seq
end subroutine s_1_2d

module s_2
contains
  subroutine s_2_1a
    !$acc routine
  end subroutine s_2_1a

  subroutine s_2_1b
    !$acc routine seq
  end subroutine s_2_1b

  subroutine s_2_1c
    !$acc routine (s_2_1c)
  end subroutine s_2_1c

  subroutine s_2_1d
    !$acc routine (s_2_1d) seq
  end subroutine s_2_1d
end module s_2

subroutine test
  external g_1, w_1, v_1
  external s_1_1, s_1_2

  interface
     function s_3_1a (a)
       integer a
       !$acc routine
     end function s_3_1a
  end interface

  interface
     function s_3_1b (a)
       integer a
       !$acc routine seq
     end function s_3_1b
  end interface

  !$acc routine(g_1) gang

  !$acc routine(w_1) worker

  !$acc routine(v_1) worker

  ! Also test the implicit seq clause.

  !$acc routine (s_1_1) seq

end subroutine test