1 #define EIGEN_USE_THREADS 7 #define CREATE_THREAD_POOL(threads) \ 8 Eigen::ThreadPool pool(threads); \ 9 Eigen::ThreadPoolDevice device(&pool, threads); 12 #define BM_FuncCPU(FUNC, THREADS) \ 13 static void BM_##FUNC##_##THREADS##T(int iters, int N) { \ 14 StopBenchmarkTiming(); \ 15 CREATE_THREAD_POOL(THREADS); \ 16 BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N); \ 19 BENCHMARK_RANGE(BM_##FUNC##_##THREADS##T, 10, 5000); 83 #define BM_FuncWithInputDimsCPU(FUNC, D1, D2, D3, THREADS) \ 84 static void BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T(int iters, int N) { \ 85 StopBenchmarkTiming(); \ 87 Eigen::DefaultDevice device; \ 88 BenchmarkSuite<Eigen::DefaultDevice, float> suite(device, D1, D2, D3); \ 91 CREATE_THREAD_POOL(THREADS); \ 92 BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, D1, D2, D3); \ 96 BENCHMARK_RANGE(BM_##FUNC##_##D1##x##D2##x##D3##_##THREADS##T, 10, 5000); 137 #define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS) \ 138 static void BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T(int iters, int N) { \ 139 StopBenchmarkTiming(); \ 140 CREATE_THREAD_POOL(THREADS); \ 141 BenchmarkSuite<Eigen::ThreadPoolDevice, float> suite(device, N); \ 142 suite.FUNC(iters, DIM1, DIM2); \ 144 BENCHMARK_RANGE(BM_##FUNC##_##DIM1##x##DIM2##_##THREADS##T, 128, 5000); #define BM_FuncWithKernelDimsCPU(FUNC, DIM1, DIM2, THREADS)
#define BM_FuncWithInputDimsCPU(FUNC, D1, D2, D3, THREADS)
const mpreal random(unsigned int seed=0)
#define BM_FuncCPU(FUNC, THREADS)