[PATCH] D47849: [OpenMP][Clang][NVPTX] Enable math functions called in an OpenMP NVPTX target device region to be resolved as device-native function calls

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 08:21:22 PDT 2018


gtbercea added a comment.

In https://reviews.llvm.org/D47849#1192383, @Hahnfeld wrote:

> In https://reviews.llvm.org/D47849#1192375, @gtbercea wrote:
>
> > I do not get that error.
>
>
> In the beginning you said that you were facing the same error. Did that go away in the meantime?
>  Are you testing on x86 or Power? With optimizations enabled?


Since I'm running on Power I was facing a similar problem related to host assembly instructions on device but not exactly the same error.

The error you are seeing is that the NVPTX target doesn't regard "x" as a valid input constraint. x is an x86 specific constraint which I don't have on the Power side.

The problems I was having were related to the math functions on the device resolving to host math functions which contained host assembly instructions which were not recognized by NVPTX. This patch fixes that issue.

Perhaps the inclusion of the host math.h should just be prevented for device code?


Repository:
  rC Clang

https://reviews.llvm.org/D47849





More information about the cfe-commits mailing list