Skip to content

Commit 4d0786a

Browse files
author
git apple-llvm automerger
committed
Merge commit '7b5d7c7b0a24' from llvm.org/main into apple/main
2 parents 99282a3 + 7b5d7c7 commit 4d0786a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/lib/Headers/__clang_hip_cmath.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,13 @@ _GLIBCXX_END_NAMESPACE_VERSION
626626

627627
// Define device-side math functions from <ymath.h> on MSVC.
628628
#if defined(_MSC_VER)
629+
630+
// Before VS2019, `<ymath.h>` is also included in `<limits>` and other headers.
631+
// But, from VS2019, it's only included in `<complex>`. Need to include
632+
// `<ymath.h>` here to ensure C functions declared there won't be markded as
633+
// `__host__` and `__device__` through `<complex>` wrapper.
634+
#include <ymath.h>
635+
629636
#if defined(__cplusplus)
630637
extern "C" {
631638
#endif // defined(__cplusplus)

0 commit comments

Comments
 (0)