[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 10 05:30:44 PDT 2018


ABataev added a comment.

In https://reviews.llvm.org/D46667#1094340, @Anastasia wrote:

> OpenCL C is based on C99, so OpenMP isn't enabled by default. But in your tests you use `-fopenmp` to activate it.
>
> OpenCL general philosophy is that vectors are written explicitly, but it's not always very easy. In OpenCL C++ we have added an attribute hint for auto vectorization  `cl::vec_type_hint`. It's given to a kernel rather than for a loop though. So I think this `simd` pragma is useful. My only worry is that other OpenMP features might not work well in OpenCL and we have no way to reject them at the moment.


We have special flag '-fopenmp-simd' to support only simd-based constructs. We can allow to use only this subset of OpenMP in OpenCL programs and disable support for '-fopenmp'.


Repository:
  rC Clang

https://reviews.llvm.org/D46667





More information about the cfe-commits mailing list