product_threaded.cpp File Reference
#include "main.h"

Macros

#define EIGEN_GEMM_THREADPOOL
 

Functions

void test_parallelize_gemm ()
 
 EIGEN_DECLARE_TEST (product_threaded)
 

Macro Definition Documentation

◆ EIGEN_GEMM_THREADPOOL

#define EIGEN_GEMM_THREADPOOL

Function Documentation

◆ EIGEN_DECLARE_TEST()

EIGEN_DECLARE_TEST ( product_threaded  )
#define CALL_SUBTEST(FUNC)
Definition: main.h:382
void test_parallelize_gemm()
Definition: product_threaded.cpp:13

References CALL_SUBTEST, and test_parallelize_gemm().

◆ test_parallelize_gemm()

void test_parallelize_gemm ( )
13  {
14  constexpr int n = 1024;
15  constexpr int num_threads = 4;
16  MatrixXf a = MatrixXf::Random(n, n);
17  MatrixXf b = MatrixXf::Random(n, n);
18  MatrixXf c = MatrixXf::Random(n, n);
19  c.noalias() = a * b;
20 
21  ThreadPool pool(num_threads);
22  Eigen::setGemmThreadPool(&pool);
23  MatrixXf c_threaded(n, n);
24  c_threaded.noalias() = a * b;
25 
26  VERIFY_IS_APPROX(c, c_threaded);
27 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
Definition: NonBlockingThreadPool.h:19
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
const Scalar * a
Definition: level2_cplx_impl.h:32
int c
Definition: calibrate.py:100

References a, b, calibrate::c, n, and VERIFY_IS_APPROX.

Referenced by EIGEN_DECLARE_TEST().