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
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "tensor_benchmarks.h"
|
||||
|
||||
#define CREATE_THREAD_POOL(threads) \
|
||||
Eigen::ThreadPool pool(threads); \
|
||||
Eigen::ThreadPoolDevice device(&pool, threads);
|
||||
#define CREATE_THREAD_POOL(threads) \
|
||||
Eigen::ThreadPool pool(threads); \
|
||||
Eigen::ThreadPoolDevice device(&pool, threads);
|
||||
|
||||
// Simple functions
|
||||
#define BM_FuncCPU(FUNC, THREADS) \
|
||||
@@ -78,7 +78,6 @@ BM_FuncCPU(colReduction, 4);
|
||||
BM_FuncCPU(colReduction, 8);
|
||||
BM_FuncCPU(colReduction, 12);
|
||||
|
||||
|
||||
// Contractions
|
||||
#define BM_FuncWithInputDimsCPU(FUNC, D1, D2, D3, THREADS) \
|
||||
static void BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T(int iters, int N) { \
|
||||
@@ -95,7 +94,6 @@ BM_FuncCPU(colReduction, 12);
|
||||
} \
|
||||
BENCHMARK_RANGE(BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T, 10, 5000);
|
||||
|
||||
|
||||
BM_FuncWithInputDimsCPU(contraction, N, N, N, 1);
|
||||
BM_FuncWithInputDimsCPU(contraction, N, N, N, 4);
|
||||
BM_FuncWithInputDimsCPU(contraction, N, N, N, 8);
|
||||
@@ -132,15 +130,14 @@ BM_FuncWithInputDimsCPU(contraction, N, N, 1, 8);
|
||||
BM_FuncWithInputDimsCPU(contraction, N, N, 1, 12);
|
||||
BM_FuncWithInputDimsCPU(contraction, N, N, 1, 16);
|
||||
|
||||
|
||||
// Convolutions
|
||||
#define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS) \
|
||||
static void BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T(int iters, int N) { \
|
||||
StopBenchmarkTiming(); \
|
||||
CREATE_THREAD_POOL(THREADS); \
|
||||
BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N); \
|
||||
suite.FUNC(iters, DIM1, DIM2); \
|
||||
} \
|
||||
#define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS) \
|
||||
static void BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T(int iters, int N) { \
|
||||
StopBenchmarkTiming(); \
|
||||
CREATE_THREAD_POOL(THREADS); \
|
||||
BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N); \
|
||||
suite.FUNC(iters, DIM1, DIM2); \
|
||||
} \
|
||||
BENCHMARK_RANGE(BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T, 128, 5000);
|
||||
|
||||
BM_FuncWithKernelDimsCPU(convolution, 7, 1, 4);
|
||||
|
||||
Reference in New Issue
Block a user