Hi!
On 2021-07-22T00:20:13+0200, I wrote:
> [...], I've now pushed "OpenACC 'nohost' clause" to
> master branch in commit a61f6afbee370785cf091fe46e2e022748528307, [...]
Via Tobias' recent commit 3269a722b7a03613e9c4e2862bc5088c4a17cc11
"Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP'
__builtin_is_initial_device",
I remembered this thing from three years ago:
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c
> @@ -0,0 +1,63 @@
> +/* Test 'nohost' clause via 'acc_on_device'.
> +
> + With optimizations disabled, we currently don't expect that
> 'acc_on_device' "evaluates at compile time to a constant".
> + { dg-skip-if "TODO PR82391" { *-*-* } { "-O0" } }
> +*/
> +
> +/* { dg-additional-options "-fdump-tree-oaccdevlow" } */
> +
> +/* { dg-additional-options "-fno-inline" } for stable results regarding
> OpenACC 'routine'. */
> +[...]
Here we do specify '-fno-inline'...
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90
> @@ -0,0 +1,63 @@
> +! Test 'nohost' clause via 'acc_on_device'.
> +
> +! { dg-do run }
> +
> +! With optimizations disabled, we currently don't expect that
> 'acc_on_device' "evaluates at compile time to a constant".
> +! { dg-skip-if "TODO PR82391" { *-*-* } { "-O0" } }
> +
> +! { dg-additional-options "-fdump-tree-oaccdevlow" }
> +
> +program main
> +[...]
..., but here we didn't. To address that, I've pushed to trunk branch
commit de0320712d026a2d1eeb57aef277fa5a91808ac2 (HEAD, upstream/trunk)
"OpenACC 'nohost' clause: harmonize
'libgomp.oacc-{c-c++-common,fortran}/routine-nohost-1.*'",
see attached.
Grüße
Thomas
>From de0320712d026a2d1eeb57aef277fa5a91808ac2 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <[email protected]>
Date: Mon, 14 Oct 2024 14:38:13 +0200
Subject: [PATCH] OpenACC 'nohost' clause: harmonize
'libgomp.oacc-{c-c++-common,fortran}/routine-nohost-1.*'
The test case 'libgomp.oacc-fortran/routine-nohost-1.f90' added in 2021
commit a61f6afbee370785cf091fe46e2e022748528307 "OpenACC 'nohost' clause" was
dependend on inlining being enabled, and otherwise ('-fno-inline') failed to
optimize/link:
/tmp/ccb2hsPd.o: In function `MAIN__._omp_fn.0':
routine-nohost-1.f90:(.text+0xf4): undefined reference to `fact_nohost_'
However, as of recent commit 3269a722b7a03613e9c4e2862bc5088c4a17cc11
"Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device",
we're now properly handling OpenACC/Fortran 'acc_on_device', and may specify
'-fno-inline', like done in 'libgomp.oacc-c-c++-common/routine-nohost-1.c'.
libgomp/
* testsuite/libgomp.oacc-fortran/routine-nohost-1.f90: Add
'-fno-inline'.
---
libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90
index b0537b8ff0b..e5f3e5740da 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-nohost-1.f90
@@ -7,6 +7,8 @@
! { dg-additional-options "-fdump-tree-oaccloops" }
+! { dg-additional-options "-fno-inline" } for stable results regarding OpenACC 'routine'.
+
program main
use openacc
implicit none
--
2.34.1