[PATCH] D93638: [hip] Enable HIP compilation with `<complex`> on MSVC.
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 5 13:01:17 PST 2021
tra added inline comments.
================
Comment at: clang/lib/Headers/__clang_hip_runtime_wrapper.h:73-74
+#define __HOST_DEVICE__ \
+ static __host__ __device__ inline __attribute__((always_inline))
+__HOST_DEVICE__ double _Cosh(double x, double y) { return cosh(x) * y; }
+__HOST_DEVICE__ float _FCosh(float x, float y) { return coshf(x) * y; }
----------------
I don't think we want to provide a HD implementation.
This will potentially change the meaning of these functions on the host side vs what they do in a C++ compilation.
It should probably be just `__device__`.
Next question is -- do we want to provide the definitions, or would just declarations be sufficient?
In other words -- are these functions needed for some standard C++ library functionality that we expect to work on the GPU?
If it's just to aid with overload resolution, declarations should do.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93638/new/
https://reviews.llvm.org/D93638
More information about the cfe-commits
mailing list