Skip to content

Commit

Permalink
Starting with Clang 10 clang supports OpenMP 4.5 (201511) instead of …
Browse files Browse the repository at this point in the history
…3.1 (201107). As value of __GNUC_ is still 4, we need to extend our exception for GCC, so that Clang can use the newer data sharing model.
  • Loading branch information
Heiko Thiel committed Mar 29, 2020
1 parent d8ee72c commit 308dc13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/include/pcl/pcl_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
// We need to check for GCC version, because GCC releases before 9 were implementing an
// OpenMP 3.1 data sharing rule, even OpenMP 4 is supported, so a plain OpenMP version 4 check
// isn't enough (see https://www.gnu.org/software/gcc/gcc-9/porting_to.html#ompdatasharing)
#if defined _OPENMP && (_OPENMP <= 201307) || (__GNUC__ < 9)
#if (defined _OPENMP && (_OPENMP <= 201307)) || (defined ___GNUC__ && (__GNUC__ >= 6 && __GNUC__ < 9))
#define OPENMP_LEGACY_CONST_DATA_SHARING_RULE 1
#else
#define OPENMP_LEGACY_CONST_DATA_SHARING_RULE 0
Expand Down
2 changes: 1 addition & 1 deletion common/src/fft/kiss_fft.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void kf_work(
// execute the p different work units in different threads
// We cannot use OPENMP_LEGACY_CONST_DATA_SHARING_RULE here, because we cannot include
// pcl_macros.h in this file as this is a C file.
#if defined _OPENMP && (_OPENMP <= 201307) || (__GNUC__ < 9)
#if (defined _OPENMP && (_OPENMP <= 201307)) || (defined ___GNUC__ && (__GNUC__ >= 6 && __GNUC__ < 9))
#pragma omp parallel for \
default(none) \
shared(f, factors, Fout, in_stride)
Expand Down

0 comments on commit 308dc13

Please sign in to comment.