mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add runtime API to control multithreading
This commit is contained in:
@@ -112,7 +112,8 @@ int main(int argc, char ** argv)
|
||||
if(procs>1)
|
||||
{
|
||||
BenchTimer tmono;
|
||||
omp_set_num_threads(1);
|
||||
//omp_set_num_threads(1);
|
||||
Eigen::setNbThreads(1);
|
||||
BENCH(tmono, tries, rep, gemm(a,b,c));
|
||||
std::cout << "eigen mono cpu " << tmono.best(CPU_TIMER)/rep << "s \t" << (double(m)*n*p*rep*2/tmono.best(CPU_TIMER))*1e-9 << " GFLOPS \t(" << tmono.total(CPU_TIMER) << "s)\n";
|
||||
std::cout << "eigen mono real " << tmono.best(REAL_TIMER)/rep << "s \t" << (double(m)*n*p*rep*2/tmono.best(REAL_TIMER))*1e-9 << " GFLOPS \t(" << tmono.total(REAL_TIMER) << "s)\n";
|
||||
|
||||
Reference in New Issue
Block a user