diff mbox series

testsuite/libgomp.c/usleep.h: Use sleep-loop also for GCN

Message ID 43fa72ec-a4d3-bc26-b744-21dbfa135d4c@codesourcery.com
State New
Headers show
Series testsuite/libgomp.c/usleep.h: Use sleep-loop also for GCN | expand

Commit Message

Tobias Burnus Nov. 18, 2020, 12:58 p.m. UTC
At least here newlib is build without HAVE_POSIX / 'posix' subdirectory
and, hence, among others without 'usleep'.

For nvptx, the same issue exists – and there 'omp declare variant' is used
to call a burn-cycles loop as replacement.
Affects target-32.c and thread-limit-2.c.

OK?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter

Comments

Jakub Jelinek Nov. 18, 2020, 1:07 p.m. UTC | #1
On Wed, Nov 18, 2020 at 01:58:58PM +0100, Tobias Burnus wrote:
> At least here newlib is build without HAVE_POSIX / 'posix' subdirectory
> and, hence, among others without 'usleep'.
> 
> For nvptx, the same issue exists – and there 'omp declare variant' is used
> to call a burn-cycles loop as replacement.
> Affects target-32.c and thread-limit-2.c.
> 
> OK?

Then please rename nvptx_usleep to fallback_usleep.

Ok with that change.

	Jakub
diff mbox series

Patch

testsuite/libgomp.c/usleep.h: Use sleep-loop also for GCN

As typically configured, newlib's libc.a does not build 'posix' and,
hence, usleep is not available. Thus, use the same fallback as for nvptx.

libgomp/
	* testsuite/libgomp.c/usleep.h (nvptx_usleep): Also use for device={arch(gcn)}.

diff --git a/libgomp/testsuite/libgomp.c/usleep.h b/libgomp/testsuite/libgomp.c/usleep.h
index c01aaa0a88f..1535ad06201 100644
--- a/libgomp/testsuite/libgomp.c/usleep.h
+++ b/libgomp/testsuite/libgomp.c/usleep.h
@@ -14,6 +14,7 @@  nvptx_usleep (useconds_t d)
 }
 
 #pragma omp declare variant (nvptx_usleep) match(construct={target},device={arch(nvptx)})
+#pragma omp declare variant (nvptx_usleep) match(construct={target},device={arch(gcn)})
 #pragma omp declare variant (usleep) match(user={condition(1)})
 int
 tgt_usleep (useconds_t d)