Use const keyword for 'int thread_id' variables.

Change-Id: I3afdf8a472cbc4f325b462bc9c42c03bc464f4b2
This commit is contained in:
pmoulon
2017-08-06 00:57:38 +02:00
parent 19333b0f55
commit afe93546b6
4 changed files with 14 additions and 14 deletions
@@ -168,9 +168,9 @@ void CoordinateDescentMinimizer::Minimize(
j < independent_set_offsets_[i + 1];
++j) {
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
const int thread_id = 0;
#endif
ParameterBlock* parameter_block = parameter_blocks_[j];
+6 -6
View File
@@ -356,9 +356,9 @@ bool CovarianceImpl::GetCovarianceMatrixInTangentOrAmbientSpace(
int size_i = parameter_sizes[i];
int size_j = parameter_sizes[j];
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
const int thread_id = 0;
#endif
double* covariance_block =
workspace.get() +
@@ -705,9 +705,9 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingSuiteSparseQR() {
}
# ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
# else
int thread_id = 0;
const int thread_id = 0;
# endif
double* solution = workspace.get() + thread_id * num_cols;
@@ -897,9 +897,9 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingEigenSparseQR() {
}
# ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
# else
int thread_id = 0;
const int thread_id = 0;
# endif
double* solution = workspace.get() + thread_id * num_cols;
+2 -2
View File
@@ -183,9 +183,9 @@ class ProgramEvaluator : public Evaluator {
}
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
const int thread_id = 0;
#endif
EvaluatePreparer* preparer = &evaluate_preparers_[thread_id];
EvaluateScratch* scratch = &evaluate_scratch_[thread_id];
+4 -4
View File
@@ -224,9 +224,9 @@ Eliminate(const BlockSparseMatrix* A,
#pragma omp parallel for num_threads(num_threads_) schedule(dynamic)
for (int i = 0; i < chunks_.size(); ++i) {
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
const int thread_id = 0;
#endif
double* buffer = buffer_.get() + thread_id * buffer_size_;
const Chunk& chunk = chunks_[i];
@@ -509,9 +509,9 @@ ChunkOuterProduct(const CompressedRowBlockStructure* bs,
BufferLayoutType::const_iterator it1 = buffer_layout.begin();
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
const int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
const int thread_id = 0;
#endif
double* b1_transpose_inverse_ete =
chunk_outer_product_buffer_.get() + thread_id * buffer_size_;