[PATCH] D50845: [CUDA/OpenMP] Define only some host macros during device compilation

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 17 08:30:50 PDT 2018


Hahnfeld added a comment.

In https://reviews.llvm.org/D50845#1202540, @ABataev wrote:

> Maybe for device compilation we also should define `__NO_MATH_INLINES` and `__NO_STRING_INLINES` macros to disable inline assembly in glibc?


Coming back to this original question:

- I just searched the headers on CentOS and Arch Linux and all cases considering these macros are guarded by `ifndef __x86_64__` which this patch still propagates for device compilation.
- From the CentOS package for PPC64LE it looks like the only affected case is in `bits/fenvinline.h` which defines the macros `fegetround()`, `feraiseexcept(__excepts)`, and `feclearexcept(__excepts)`. All matches in `bits/mathinline.h` are guarded by `ifndef __powerpc64__` or don't use inline assembly which should be fine.

As I'm not primarily developing on Power (and can't test such change), I'd ask you to create a patch adding these macros.


Repository:
  rC Clang

https://reviews.llvm.org/D50845





More information about the cfe-commits mailing list