aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-11-18 14:11:27 +0100
committerTobias Burnus <tobias@codesourcery.com>2020-11-18 14:11:27 +0100
commitcb1a4876a0e724ca3962ec14dce9e7819fa72ea5 (patch)
tree28ec312fcdb23f99bcfb0dc7e3d517ba0be26025
parentba97b532604815333848ee30e069dde6e36ce4c9 (diff)
downloadgcc-cb1a4876a0e724ca3962ec14dce9e7819fa72ea5.zip
gcc-cb1a4876a0e724ca3962ec14dce9e7819fa72ea5.tar.gz
gcc-cb1a4876a0e724ca3962ec14dce9e7819fa72ea5.tar.bz2
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)}.
-rw-r--r--libgomp/testsuite/libgomp.c/usleep.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libgomp/testsuite/libgomp.c/usleep.h b/libgomp/testsuite/libgomp.c/usleep.h
index c01aaa0..669b41c 100644
--- a/libgomp/testsuite/libgomp.c/usleep.h
+++ b/libgomp/testsuite/libgomp.c/usleep.h
@@ -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)