[PATCH] D95075: [hip] Fix `<complex>` compilation on Windows with VS2019.

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 20 13:44:31 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b5d7c7b0a24: [hip] Fix `<complex>` compilation on Windows with VS2019. (authored by hliao).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95075/new/

https://reviews.llvm.org/D95075

Files:
  clang/lib/Headers/__clang_hip_cmath.h


Index: clang/lib/Headers/__clang_hip_cmath.h
===================================================================
--- clang/lib/Headers/__clang_hip_cmath.h
+++ clang/lib/Headers/__clang_hip_cmath.h
@@ -626,6 +626,13 @@
 
 // Define device-side math functions from <ymath.h> on MSVC.
 #if defined(_MSC_VER)
+
+// Before VS2019, `<ymath.h>` is also included in `<limits>` and other headers.
+// But, from VS2019, it's only included in `<complex>`. Need to include
+// `<ymath.h>` here to ensure C functions declared there won't be markded as
+// `__host__` and `__device__` through `<complex>` wrapper.
+#include <ymath.h>
+
 #if defined(__cplusplus)
 extern "C" {
 #endif // defined(__cplusplus)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95075.317996.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210120/393fa032/attachment.bin>


More information about the cfe-commits mailing list