mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Pulled latest updates from trunk
This commit is contained in:
commit
de7d92c259
@ -27,7 +27,7 @@ class ThreadPoolInterface {
|
|||||||
class ThreadPool : public ThreadPoolInterface {
|
class ThreadPool : public ThreadPoolInterface {
|
||||||
public:
|
public:
|
||||||
// Construct a pool that contains "num_threads" threads.
|
// Construct a pool that contains "num_threads" threads.
|
||||||
explicit ThreadPool(int num_threads) {
|
explicit ThreadPool(int num_threads) : threads_(num_threads, NULL), waiting_(num_threads, NULL) {
|
||||||
for (int i = 0; i < num_threads; i++) {
|
for (int i = 0; i < num_threads; i++) {
|
||||||
threads_.push_back(new std::thread([this]() { WorkerLoop(); }));
|
threads_.push_back(new std::thread([this]() { WorkerLoop(); }));
|
||||||
}
|
}
|
||||||
@ -110,8 +110,8 @@ class ThreadPool : public ThreadPoolInterface {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::mutex mu_;
|
std::mutex mu_;
|
||||||
std::vector<std::thread*> threads_; // All threads
|
MaxSizeVector<std::thread*> threads_; // All threads
|
||||||
std::vector<Waiter*> waiters_; // Stack of waiting threads.
|
MaxSizeVector<Waiter*> waiters_; // Stack of waiting threads.
|
||||||
std::deque<std::function<void()>> pending_; // Queue of pending work
|
std::deque<std::function<void()>> pending_; // Queue of pending work
|
||||||
std::condition_variable empty_; // Signaled on pending_.empty()
|
std::condition_variable empty_; // Signaled on pending_.empty()
|
||||||
bool exiting_ = false;
|
bool exiting_ = false;
|
||||||
|
@ -175,9 +175,14 @@ endif()
|
|||||||
# These tests needs nvcc
|
# These tests needs nvcc
|
||||||
find_package(CUDA 7.0)
|
find_package(CUDA 7.0)
|
||||||
if(CUDA_FOUND AND EIGEN_TEST_NVCC)
|
if(CUDA_FOUND AND EIGEN_TEST_NVCC)
|
||||||
# Mke sure to compile without the -pedantic and -Wundef flags since they trigger thousands of compilation warnings in the CUDA runtime
|
# Make sure to compile without the -pedantic, -Wundef, -Wnon-virtual-dtor
|
||||||
|
# and -fno-check-new flags since they trigger thousands of compilation warnings
|
||||||
|
# in the CUDA runtime
|
||||||
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "-Wundef" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REPLACE "-Wnon-virtual-dtor" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string(REPLACE "-fno-check-new" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
message(STATUS "Flags used to compile cuda code: " ${CMAKE_CXX_FLAGS})
|
message(STATUS "Flags used to compile cuda code: " ${CMAKE_CXX_FLAGS})
|
||||||
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user