File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 7373# Specifically use schedule(dynamic) to distinguish incompatibilities in OpenMP runtime on macOS, #7318
7474
7575cat << EOF > test-omp.c
76- #include <omp.h>
7776void test_openmp(int * result) {
7877 int sum = 0;
78+ #ifdef _OPENMP
7979 #pragma omp parallel for reduction(+:sum) num_threads(2) schedule(dynamic)
8080 for (int i = 1; i <= 2; ++i) sum += i;
81+ #endif
8182 *result = sum;
8283}
8384EOF
@@ -110,8 +111,8 @@ stopifnot(identical(ans, 3L))
110111
111112detect_openmp () {
112113 # OpenMP flags provided in environment variables or specified when configuring R? Does -fopenmp work?
113- test_openmp_variant ' $(SHLIB_OPENMP_CFLAGS) ' ' $(SHLIB_OPENMP_CFLAGS) ' \
114- || test_openmp_variant " " " " \
114+ test_openmp_variant " " " " \
115+ || test_openmp_variant ' $(SHLIB_OPENMP_CFLAGS) ' ' $(SHLIB_OPENMP_CFLAGS) ' \
115116 || test_openmp_variant -fopenmp -fopenmp \
116117 && return
117118
You can’t perform that action at this time.
0 commit comments