[PATCH] D61765: [OpenMP][Clang][BugFix] Split declares and math functions inclusion.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 13:24:41 PDT 2019


tra added inline comments.


================
Comment at: lib/Headers/__clang_cuda_math_forward_declares.h:30-38
+#ifndef _OPENMP
+__DEVICE__ long abs(long);
+__DEVICE__ long long abs(long long);
+#else
+#ifndef __cplusplus
 __DEVICE__ long abs(long);
 __DEVICE__ long long abs(long long);
----------------
I'm not quite sure what's the idea here. It may be worth adding a comment.

It could also be expressed somewhat simpler:

```
#if !(defined(_OPENMP) && defined(__cplusplus))
...
#endif
```



================
Comment at: lib/Headers/openmp_wrappers/__clang_openmp_math_declares.h:10
+
+#if defined(__NVPTX__) && defined(_OPENMP)
+
----------------
You may want to add include guards.

I'd also make inclusion of the file in non-openmp compilation an error, if it makes sense for OpenMP. It does for CUDA.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61765





More information about the cfe-commits mailing list