[libgomp, testsuite] Reduce recursion depth in declare_target-*.f90
authorTom de Vries <tdevries@suse.de>
Thu, 20 Jan 2022 12:37:08 +0000 (13:37 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 1 Feb 2022 07:13:06 +0000 (08:13 +0100)
When running the libgomp testsuite with GOMP_NVPTX_JIT=-O0 using an nvptx
accelerator (Nvidia T400, 2GB), I run into:
...
libgomp: cuCtxSynchronize error: unspecified launch failure \
  (perhaps abort was called)

libgomp: cuMemFree_v2 error: unspecified launch failure

libgomp: device finalization failed
FAIL: libgomp.fortran/examples-4/declare_target-1.f90   -O0  execution test
...

The test-case contains:
...
  ! Reduced from 25 to 23, otherwise execution runs out of thread stack on
  ! Nvidia Titan V.
  if (fib (23) /= fib_wrapper (23)) stop 2
...

Fix this by reducing the fib/fib_wrapper argument from 23 to 22.

Same for declare_target-2.f90.

Tested on x86_64 with nvptx accelerator.

libgomp/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: Reduce
recursion depth.
* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: Same.

libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90
libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90

index e439fe1..b761979 100644 (file)
@@ -29,5 +29,7 @@ program e_53_1
   if (fib (15) /= fib_wrapper (15)) stop 1
   ! Reduced from 25 to 23, otherwise execution runs out of thread stack on
   ! Nvidia Titan V.
-  if (fib (23) /= fib_wrapper (23)) stop 2
+  ! Reduced from 23 to 22, otherwise execution runs out of thread stack on
+  ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0.
+  if (fib (22) /= fib_wrapper (22)) stop 2
 end program
index ee582b2..f576c25 100644 (file)
@@ -6,9 +6,11 @@ program e_53_2
   !$omp target map(from: x)
     ! Reduced from 25 to 23, otherwise execution runs out of thread stack on
     ! Nvidia Titan V.
-    x = fib (23)
+    ! Reduced from 23 to 22, otherwise execution runs out of thread stack on
+    ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0.
+    x = fib (22)
   !$omp end target
-  if (x /= fib (23)) stop 1
+  if (x /= fib (22)) stop 1
 end program
 
 integer recursive function fib (n) result (f)