[PATCH] D71179: [OpenMP][WIP] Initial support for `begin/end declare variant`

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 02:30:32 PST 2019


JonChesterfield added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_cmath.h:70
 __DEVICE__ float fmod(float __x, float __y) { return ::fmodf(__x, __y); }
-// TODO: remove when variant is supported
-#ifndef _OPENMP
----------------
jdoerfert wrote:
> As far as I can tell, `fpclassify` is not available in CUDA so it is unclear if we want to have it here or not. I removed it due to the TODO above. Consequently I also had to remove other `fpclassify` occurrences. If it turns out the host version is not usable on the device and we need the builtins, we add them back but under the opposite guard, that is `#ifdef _OPENMP`.
We could call __builtin_fpclassify for nvptx, e.g. from https://github.com/ROCm-Developer-Tools/aomp-extras/blob/0.7-6/aomp-device-libs/libm/src/libm-nvptx.cpp

```int fpclassify(float __x) {
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
}
int fpclassify(double __x) {
  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71179





More information about the cfe-commits mailing list