... awaiting proper resolution, of course.
libgomp/
PR target/99555
* testsuite/lib/on_device_arch.c: New file.
* testsuite/libgomp.c/pr99555-1.c: Likewise.
* testsuite/libgomp.c-c++-common/task-detach-6.c: Until resolved,
skip for nvptx offloading, with error status.
* testsuite/libgomp.fortran/task-detach-6.f90: Likewise.
--- /dev/null
+#include <gomp-constants.h>
+
+/* static */ int
+device_arch_nvptx (void)
+{
+ return GOMP_DEVICE_NVIDIA_PTX;
+}
+
+#pragma omp declare variant (device_arch_nvptx) match(construct={target},device={arch(nvptx)})
+/* static */ int
+device_arch (void)
+{
+ return GOMP_DEVICE_DEFAULT;
+}
+
+static int
+on_device_arch (int d)
+{
+ int d_cur;
+ #pragma omp target map(from:d_cur)
+ d_cur = device_arch ();
+
+ return d_cur == d;
+}
+
+int
+on_device_arch_nvptx ()
+{
+ return on_device_arch (GOMP_DEVICE_NVIDIA_PTX);
+}
/* { dg-do run } */
+/* { dg-additional-sources "../lib/on_device_arch.c" } */
+extern int on_device_arch_nvptx ();
+
#include <omp.h>
#include <assert.h>
int main (void)
{
+ //TODO See '../libgomp.c/pr99555-1.c'.
+ if (on_device_arch_nvptx ())
+ __builtin_abort (); //TODO Until resolved, skip, with error status.
+
int x = 0, y = 0, z = 0;
int thread_count;
omp_event_handle_t detach_event1, detach_event2;
--- /dev/null
+// PR99555 "[OpenMP/nvptx] Execution-time hang for simple nested OpenMP 'target'/'parallel'/'task' constructs"
+
+// { dg-additional-options "-O0" }
+
+// { dg-additional-sources "../lib/on_device_arch.c" }
+extern int on_device_arch_nvptx ();
+
+int main (void)
+{
+ if (on_device_arch_nvptx ())
+ __builtin_abort (); //TODO Until resolved, skip, with error status.
+
+#pragma omp target
+#pragma omp parallel // num_threads(1)
+#pragma omp task
+ ;
+
+ return 0;
+}
! { dg-do run }
+! { dg-additional-sources ../lib/on_device_arch.c }
+ ! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" }
+
! Test tasks with detach clause on an offload device. Each device
! thread spawns off a chain of tasks, that can then be executed by
! any available thread.
integer :: x = 0, y = 0, z = 0
integer :: thread_count
+ interface
+ integer function on_device_arch_nvptx() bind(C)
+ end function on_device_arch_nvptx
+ end interface
+
+ !TODO See '../libgomp.c/pr99555-1.c'.
+ if (on_device_arch_nvptx () /= 0) then
+ error stop !TODO Until resolved, skip, with error status.
+ end if
+
!$omp target map (tofrom: x, y, z) map (from: thread_count)
!$omp parallel private (detach_event1, detach_event2)
!$omp single