[Bug testsuite/81690] libgomp.c/{target-32,thread-limit-2}.c fail for nvptx: missing usleep
tschwinge at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 30 20:04:00 GMT 2017
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.) ;-)
More information about the Gcc-bugs
mailing list