[Openmp-commits] [PATCH] D77071: [libomptarget][nfc] Move non-freestanding headers out of common

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 30 18:03:06 PDT 2020

JonChesterfield marked an inline comment as done.
JonChesterfield added inline comments.

Comment at: openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h:21
+#include <assert.h>
+#include <inttypes.h>
jdoerfert wrote:
> JonChesterfield wrote:
> > No stdio in amdgcn's target_impl as the only function used from it is printf, declared at the end of this header.
> > 
> > Can reduce amdgcn to wholly ffreestanding by providing an implementation of assert and two macros from inttypes, which may be a good idea as I think HIP is currently using the glibc versions of these headers for the device code.
> I think this seems reasonable, depending on the macros.
The macros are PRId64 and PRIu64 iirc, which expand to "ld"/"lu". Pretty minor. For a later patch anyway.

This reduces the requirements on common code to freestanding, target_impl functions, printf, assert, two print format macros. It's still quite a lot, but much less than stdlib + math suggests.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list