This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Mixing eigens multithreading and my own mulithreading

Tags: None
(comma "," separated)
ashteks
Registered Member
Posts
4
Karma
0
Hi,

Is it possible to mix my own multithreading with and eigen's own multhreading for matrix-matrix products ? In some parts of my code, i would like to disable eigen's multithreading and write my own multithreaded code to manipulate eigen vectors and in other parts of the code, rely on eigen's own multithreaded matrix-matrix products. The documentation says how I can disable eigen's multithreading for the entire program by defining EIGEN_DONT_PARALLELIZE. Is there a way to switch this off locally ?

My current applications don't require matrix-matrix products so I was doing my own multithreading and initializing with
Eigen::initParallel(); wherever I multithreaded.

Thanks!
Ash

P.S: I've been using eigen as the backbone of a Neural network that I'm using in my research and I'm very happy with it. Thanks so much for a wonderful tool !!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You can call Eigen::setNumThreads(1) to locally disable Eigen's multithreading.
ashteks
Registered Member
Posts
4
Karma
0
ashteks
Registered Member
Posts
4
Karma
0
I had another question. Does Eigen multithread block matrix multiplication as well ? For example, for two matrices m1 and m2,

will m1.block(p,q,r,s) * m2.block(w,x,y,z) be multithreaded ?

Thanks,

Ash
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
yes block or full matrix are the same.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]