libstdc++: Tweak two links in configuration docs
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / declare-variant-1.f90
blobe6f69dccb4940b68ea574bc1f22bfe74e68111bb
1 ! { dg-do run }
3 program main
4 implicit none
6 integer :: v
7 !$omp target map(from:v)
8 v = on ()
9 !$omp end target
11 select case (v)
12 case default
13 write (*,*) "Host fallback or unknown offloading"
14 case (1)
15 write (*,*) "Offloading to NVidia PTX"
16 case (2)
17 write (*,*) "Offloading to AMD GCN"
18 end select
19 contains
20 integer function on_nvptx ()
21 on_nvptx = 1
22 end function
24 integer function on_gcn ()
25 on_gcn = 2
26 end function
28 integer function on ()
29 !$omp declare variant (on_nvptx) match(construct={target},device={arch(nvptx)})
30 !$omp declare variant (on_gcn) match(construct={target},device={arch(gcn)})
31 on = 0
32 end function
33 end program