diff options
author | Artem Belevich <tra@google.com> | 2017-09-27 19:07:15 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2017-09-27 19:07:15 +0000 |
commit | 93e33f8fb3dbc3d08ff5c99b184648f5e52265a0 (patch) | |
tree | a5ed9c0dccfadca370781e7e991cf8fe3a7bff51 | |
parent | bfa662ae4e91617cd41ef89b6708942b5d0f692d (diff) | |
download | bcm5719-llvm-93e33f8fb3dbc3d08ff5c99b184648f5e52265a0.tar.gz bcm5719-llvm-93e33f8fb3dbc3d08ff5c99b184648f5e52265a0.zip |
[CUDA] Work around conflicting function definitions in CUDA-9 headers.
Differential Revision: https://reviews.llvm.org/D38326
llvm-svn: 314334
-rw-r--r-- | clang/lib/Headers/__clang_cuda_runtime_wrapper.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h index e4fc5860b50..b8ffc2ce9ff 100644 --- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h +++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h @@ -173,7 +173,18 @@ inline __host__ double __signbitd(double x) { // __device__. #pragma push_macro("__forceinline__") #define __forceinline__ __device__ __inline__ __attribute__((always_inline)) + +#pragma push_macro("__float2half_rn") +#if CUDA_VERSION >= 9000 +// CUDA-9 has conflicting prototypes for __float2half_rn(float f) in +// cuda_fp16.h[pp] and device_functions.hpp. We need to get the one in +// device_functions.hpp out of the way. +#define __float2half_rn __float2half_rn_disabled +#endif + #include "device_functions.hpp" +#pragma pop_macro("__float2half_rn") + // math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we // get the slow-but-accurate or fast-but-inaccurate versions of functions like |