diff options
author | David Gross <dgross@google.com> | 2018-07-02 17:45:01 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-07-02 17:45:01 +0000 |
commit | d6d227a99f0f653a875b14d4a02670613cdd3f18 (patch) | |
tree | 1a1a2ac4ec09a442d27bd7725347ae53c857e911 | |
parent | 1d5d34618a9c4d8340eb4f6d597fa84563371d46 (diff) | |
parent | a183646e0b227bd59eb0fdc64b814d9c3bb2260d (diff) | |
download | eigen-d6d227a99f0f653a875b14d4a02670613cdd3f18.tar.gz |
Merge "Fix for HDRNet producing nondeterministic results."android-o-mr1-iot-release-1.0.2
-rw-r--r-- | Eigen/src/Core/products/GeneralMatrixMatrix.h | 1 | ||||
-rw-r--r-- | Eigen/src/Core/products/Parallelizer.h | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 6440e1d09..41cfb0e03 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -146,7 +146,6 @@ static void run(Index rows, Index cols, Index depth, // Release all the sub blocks A'_i of A' for the current thread, // i.e., we simply decrement the number of users by 1 for(Index i=0; i<threads; ++i) - #pragma omp atomic info[i].users -= 1; } } diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h index c2f084c82..c0ddc0c06 100644 --- a/Eigen/src/Core/products/Parallelizer.h +++ b/Eigen/src/Core/products/Parallelizer.h @@ -10,6 +10,8 @@ #ifndef EIGEN_PARALLELIZER_H #define EIGEN_PARALLELIZER_H +#include <atomic> + namespace Eigen { namespace internal { @@ -75,8 +77,8 @@ template<typename Index> struct GemmParallelInfo { GemmParallelInfo() : sync(-1), users(0), lhs_start(0), lhs_length(0) {} - Index volatile sync; - int volatile users; + std::atomic<Index> sync; + std::atomic<int> users; Index lhs_start; Index lhs_length; |