From: Corinna Vinschen <vinschen@redhat.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: newlib@sourceware.org
Subject: Re: [PATCH] Emulate clock and other stubs on nvptx
Date: Thu, 19 Aug 2021 12:34:06 +0200 [thread overview]
Message-ID: <YR4znn5zjjWYix0Y@calimero.vinschen.de> (raw)
In-Reply-To: <YR4w3/+ysctZx6/G@calimero.vinschen.de>
On Aug 19 12:22, Corinna Vinschen wrote:
> Hi Roger,
>
> On Aug 18 17:43, Roger Sayle wrote:
> >
> > Please be gentle, this is my first patch to newlib.
> >
> > This patch to the libc/machine/nvptx port of newlib implements an
> > approximation of "clock" and provides some additional stub routines.
> > These changes not only reduce the number of (link) failures in the GCC
> > testsuite when targeting nvptx-none, but also allow the NIST scimark4
> > benchmark to compile and run without modification.
> >
> > newlib already contains support for backends to provide their own
> > clock implementations via -DCLOCK_PROVIDED. That functionality is
> > used here to return an approximate elapsed time based on the NVidia
> > GPU's clock64 cycle counter. Although not great, this is better than
> > the current behaviour of link error from the unresolved symbol
> > _times_r.
> >
> > The other part of the patch is to add a small number of stub functions
> > to nvptx's misc.c. Adding isatty, for example, resolves linking
> > problems in libc from the dependency in __smakebuf_r, and the sync
> > stub, for example, fixes the failure with GCC's
> > testsuite/gfortran.dg/ISO_Fortran_binding_14.f90 [which simply tests
> > that gfortran can call a/any C function].
> >
> > Hopefully, these changes are acceptable. If so, if someone could
> > please commit
>
> They are, but your patch submission is a bit weird and more work to
> apply than necessary.
>
> Please commit your patches to your local git repo, including a nice
> commit message, create a git patch file via `git format-patch' and send
> it via `git send-email --to="newlib@..." to this mailing list. Note
> that providing Makefile.in is nice, but you don't *have* to provide
> Makefile.in. We'll regenerate that as required.
>
> Another point: Given the HW support for a monotonic clock tick,
> wouldn't it make more sense to implement clock_gettime() with support
> for CLOCK_REALTIME and CLOCK_MONOTONIC, and implement clock() by calling
> clock_gettime()?
Oh, btw., since your comment enumerates the CPU variants, isn't there
a runtime method to check the CPU and use more accurate values per
CPU? Just an idea...
Corinna
next prev parent reply other threads:[~2021-08-19 10:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 16:43 Roger Sayle
2021-08-19 10:22 ` Corinna Vinschen
2021-08-19 10:34 ` Corinna Vinschen [this message]
2021-08-19 10:45 ` [Fwd: Re: [PATCH] Emulate clock and other stubs on nvptx] Yago Rubio
2021-08-19 12:59 ` [PATCH] Emulate clock and other stubs on nvptx Joel Sherrill
2021-08-19 13:57 ` Roger Sayle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YR4znn5zjjWYix0Y@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.org \
--cc=roger@nextmovesoftware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).