Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select OpenMP data sharing mode based on specific GCC versions #3823

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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