mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -15,13 +15,15 @@
|
||||
#include "main.h"
|
||||
#include <Eigen/CXX11/Tensor>
|
||||
|
||||
static void test_notification_single()
|
||||
{
|
||||
static void test_notification_single() {
|
||||
ThreadPool thread_pool(1);
|
||||
|
||||
std::atomic<int> counter(0);
|
||||
Eigen::Notification n;
|
||||
auto func = [&n, &counter](){ n.Wait(); ++counter;};
|
||||
auto func = [&n, &counter]() {
|
||||
n.Wait();
|
||||
++counter;
|
||||
};
|
||||
thread_pool.Schedule(func);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
|
||||
@@ -39,13 +41,15 @@ static void test_notification_single()
|
||||
|
||||
// Like test_notification_single() but enqueues multiple threads to
|
||||
// validate that all threads get notified by Notify().
|
||||
static void test_notification_multiple()
|
||||
{
|
||||
static void test_notification_multiple() {
|
||||
ThreadPool thread_pool(1);
|
||||
|
||||
std::atomic<int> counter(0);
|
||||
Eigen::Notification n;
|
||||
auto func = [&n, &counter](){ n.Wait(); ++counter;};
|
||||
auto func = [&n, &counter]() {
|
||||
n.Wait();
|
||||
++counter;
|
||||
};
|
||||
thread_pool.Schedule(func);
|
||||
thread_pool.Schedule(func);
|
||||
thread_pool.Schedule(func);
|
||||
@@ -57,8 +61,7 @@ static void test_notification_multiple()
|
||||
VERIFY_IS_EQUAL(counter, 4);
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(cxx11_tensor_notification)
|
||||
{
|
||||
EIGEN_DECLARE_TEST(cxx11_tensor_notification) {
|
||||
CALL_SUBTEST(test_notification_single());
|
||||
CALL_SUBTEST(test_notification_multiple());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user