[Openmp-commits] [PATCH] D45528: [OpenMP] Remove compilation warning when using clang to compile bc files.

Guansong Zhang via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Apr 15 10:26:26 PDT 2018


guansong added a comment.

In https://reviews.llvm.org/D45528#1067671, @grokos wrote:

> In https://reviews.llvm.org/D45528#1067615, @guansong wrote:
>
> > In https://reviews.llvm.org/D45528#1067520, @grokos wrote:
> >
> > > In https://reviews.llvm.org/D45528#1067487, @guansong wrote:
> > >
> > > > update as suggested (except PRId64)
> > >
> > >
> > > Isn't `PRId64` working?
> >
> >
> > I did not find any usage of it on the device side. Not confident on using it. We can remove the warning first, and improve the format later?
>
>
> It's not giving a warning because in CUDA `long long int` happens to be 64 bits long, so you can use `%lld` to print an `int64_t`. This is not guaranteed to be true on every platform, therefore the portable way to print an `int64_t` is using the `PRId64` macro. That's what we do in the base library.


My understanding of PRId64 is just a pretty format for lld, which I did not master yet, maybe you can help me to understand those two macros better.

But not sure why %lld can be wrong with long long int, this is standard c/c++ which cuda is based on?


https://reviews.llvm.org/D45528





More information about the Openmp-commits mailing list