[PATCH] D104904: [OpenMP][AMDGCN] Initial math headers support
Pushpinder Singh via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 28 08:37:20 PDT 2021
pdhaliwal added inline comments.
================
Comment at: clang/lib/Headers/__clang_hip_cmath.h:30
+#ifdef __OPENMP_AMDGCN__
+#define __DEVICE__ static __attribute__((always_inline, nothrow))
+#define __CONSTEXPR__ constexpr
----------------
ashi1 wrote:
> Does OpenMP not require `__device__` attribute here? I know constexpr defines `__device__` on HIP, does OMP do the same?
It does not as these methods are inside declare variant.
================
Comment at: clang/lib/Headers/__clang_hip_cmath.h:32
+#define __CONSTEXPR__ constexpr
+#define __constant__ __attribute__((constant))
+#else
----------------
ashi1 wrote:
> I don't think this is the right place to define `__constant__`? It's unused in this header, and may get forgotten. Would it be better to define it in the openmp wrapper or does cmath define it in OpenMP?
It is being used. However, I have moved it to openmp_wrappers/cmath.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104904/new/
https://reviews.llvm.org/D104904
More information about the cfe-commits
mailing list