This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug testsuite/81690] libgomp.c/{target-32,thread-limit-2}.c fail for nvptx: missing usleep
- From: "tschwinge at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Aug 2017 17:36:02 +0000
- Subject: [Bug testsuite/81690] libgomp.c/{target-32,thread-limit-2}.c fail for nvptx: missing usleep
- Auto-submitted: auto-generated
- References: <bug-81690-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81690
--- Comment #3 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #2)
> Per PTX 3.1, "Table 141. Special Registers: %clock", "Special register
> %clock is an unsigned 32-bit read-only cycle counter that wraps silently",
Probably not too useful for implementing "usleep":
<http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#time-function>,
<https://stackoverflow.com/questions/11217117/equivalent-of-usleep-in-cuda-kernel>.
> which possibly could be used to implemented "usleep" (in newlib)? For that,
> we'd first have to figure out what a "cycle" is. Quite possibly, this will
> be different per hardware architecture, so would need some newlib/libgcc
> startup code. Possibly it might also depend on the actual clock speed at
> run time, which would make this more/too much convoluted, if at all
> practical?
>
> (Best to avoid such "sleep" function usage, of course.) ;-)