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 (fallback_usleep): Renamed from
	nvptx_usleep; use also for device={arch(gcn)}.
This commit is contained in:
Tobias Burnus 2020-11-18 14:11:27 +01:00
parent ba97b53260
commit cb1a4876a0
1 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#include <unistd.h>
int
nvptx_usleep (useconds_t d)
fallback_usleep (useconds_t d)
{
/* This function serves as a replacement for usleep in
this test case. It does not even attempt to be functionally
@ -13,7 +13,8 @@ nvptx_usleep (useconds_t d)
return 0;
}
#pragma omp declare variant (nvptx_usleep) match(construct={target},device={arch(nvptx)})
#pragma omp declare variant (fallback_usleep) match(construct={target},device={arch(nvptx)})
#pragma omp declare variant (fallback_usleep) match(construct={target},device={arch(gcn)})
#pragma omp declare variant (usleep) match(user={condition(1)})
int
tgt_usleep (useconds_t d)
@ -21,4 +22,4 @@ tgt_usleep (useconds_t d)
return 0;
}
#pragma omp declare target to (nvptx_usleep, tgt_usleep)
#pragma omp declare target to (fallback_usleep, tgt_usleep)