1 ! Test 'nohost' clause via 'acc_on_device'.
5 ! With optimizations disabled, we currently don't expect that 'acc_on_device' "evaluates at compile time to a constant".
6 ! { dg-skip-if "TODO PR82391" { *-*-* } { "-O0" } }
8 ! { dg-additional-options "-fdump-tree-oaccloops" }
13 integer, parameter :: n
= 10
15 integer, external :: fact_nohost
16 !$acc routine (fact_nohost)
17 integer, external :: fact
21 if (acc_on_device(acc_device_not_host
)) then
27 !$acc end parallel loop
30 if (acc_get_device_type() .eq
. acc_device_host
) then
31 if (a(i
) .ne
. 0) stop 10 + i
33 if (a(i
) .ne
. fact(i
)) stop 20 + i
38 recursive function fact(x
) result(res
)
41 integer, intent(in
) :: x
51 function fact_nohost(x
) result(res
)
54 !$acc routine (fact_nohost) nohost
55 integer, intent(in
) :: x
57 integer, external :: fact
60 end function fact_nohost
61 ! { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'fact_nohost' has 'nohost' clause\.$} 1 oaccloops { target { ! offloading_enabled } } } }
62 ! { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'fact_nohost_' has 'nohost' clause\.$} 1 oaccloops { target offloading_enabled } } }
63 !TODO See PR101551 for 'offloading_enabled' differences.