mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +08:00
Only include <atomic> if needed.
This commit is contained in:
parent
4ee2e9b340
commit
3ffefcb95c
@ -67,6 +67,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EIGEN_HAS_OPENMP
|
#ifdef EIGEN_HAS_OPENMP
|
||||||
|
#include <atomic>
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
#ifndef EIGEN_PARALLELIZER_H
|
#ifndef EIGEN_PARALLELIZER_H
|
||||||
#define EIGEN_PARALLELIZER_H
|
#define EIGEN_PARALLELIZER_H
|
||||||
|
|
||||||
#include <atomic>
|
|
||||||
|
|
||||||
#include "../InternalHeaderCheck.h"
|
#include "../InternalHeaderCheck.h"
|
||||||
|
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
@ -78,14 +76,14 @@ namespace internal {
|
|||||||
|
|
||||||
template<typename Index> struct GemmParallelInfo
|
template<typename Index> struct GemmParallelInfo
|
||||||
{
|
{
|
||||||
GemmParallelInfo() : sync(-1), users(0), lhs_start(0), lhs_length(0) {}
|
|
||||||
|
|
||||||
// volatile is not enough on all architectures (see bug 1572)
|
#ifdef EIGEN_HAS_OPENMP
|
||||||
// to guarantee that when thread A says to thread B that it is
|
GemmParallelInfo() : sync(-1), users(0), lhs_start(0), lhs_length(0) {}
|
||||||
// done with packing a block, then all writes have been really
|
|
||||||
// carried out... C++11 memory model+atomic guarantees this.
|
|
||||||
std::atomic<Index> sync;
|
std::atomic<Index> sync;
|
||||||
std::atomic<int> users;
|
std::atomic<int> users;
|
||||||
|
#else
|
||||||
|
GemmParallelInfo() : lhs_start(0), lhs_length(0) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
Index lhs_start;
|
Index lhs_start;
|
||||||
Index lhs_length;
|
Index lhs_length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user