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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 30 13:00:59 PDT 2018


tra added a comment.

In https://reviews.llvm.org/D50845#1219819, @Hahnfeld wrote:

> Ok, the top preprocessor condition for that function is `#ifndef __SSE2_MATH__` - the exact same macro that was part of the motivation. Can you please test compiling a simple C file (including `math.h`) with `-mno-sse`? My guess would be that this is broken as well.
>  If yes I'm fine with reverting because I need to teach Clang to allow anonymous unions in type specifiers to make that weird system header work with this patch.


It compiles fine. The code that causes the problem is also conditional on `__NO_MATH_INLINES` and it's always defined for X86, so compilation only breaks for when we compile for NVPTX.

Still, the issue seems to be way too hairy for one-line fix, so I'll proceed with the unroll if you don't beat me to it.


Repository:
  rL LLVM

https://reviews.llvm.org/D50845





More information about the cfe-commits mailing list