mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Only use collapse() directive with OpenMP 3.0 or higher
Change-Id: Icba544c0494763c57eb6dc61e98379312ca15972
This commit is contained in:
@@ -337,7 +337,14 @@ bool CovarianceImpl::GetCovarianceMatrixInTangentOrAmbientSpace(
|
||||
max_covariance_block_size]);
|
||||
|
||||
bool success = true;
|
||||
#pragma omp parallel for num_threads(num_threads) schedule(dynamic) collapse(2)
|
||||
|
||||
// The collapse() directive is only supported in OpenMP 3.0 and higher. OpenMP
|
||||
// 3.0 was released in May 2008 (hence the version number).
|
||||
#if _OPENMP >= 200805
|
||||
# pragma omp parallel for num_threads(num_threads) schedule(dynamic) collapse(2)
|
||||
#else
|
||||
# pragma omp parallel for num_threads(num_threads) schedule(dynamic)
|
||||
#endif
|
||||
for (int i = 0; i < parameters.size(); ++i) {
|
||||
for (int j = 0; j < parameters.size(); ++j) {
|
||||
// The second loop can't start from j = i for compatibility with OpenMP
|
||||
|
||||
Reference in New Issue
Block a user