Clang-format tests, examples, libraries, benchmarks, etc.

This commit is contained in:
Antonio Sánchez
2023-12-05 21:22:55 +00:00
committed by Rasmus Munk Larsen
parent 3252ecc7a4
commit 46e9cdb7fe
876 changed files with 33453 additions and 37795 deletions

View File

@@ -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());
}