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

Tensor module: how to use multi threading?

Tags: None
(comma "," separated)
hantschal
Registered Member
Posts
2
Karma
0
Hi,

the Tensor documentation (https://bitbucket.org/eigen/eigen/src/677c9f1577810e869f4f09881cabc3e503a810c1/unsupported/Eigen/CXX11/src/Tensor/README.md?at=default#markdown-header-contraction) seems to be incomplete or buggy.

The following minimal code snippet does not compile:
Code: Select all
#include <unsupported/Eigen/CXX11/Tensor>
#include <unsupported/Eigen/CXX11/ThreadPool>

void main(int argc, char** argv)
{
   Eigen::ThreadPoolDevice my_device(4);
}


The compile error is the following:
Code: Select all
error: incomplete type is not allowed
    Eigen::ThreadPoolDevice my_device(4);


Given that this simple code snipped (which adheres to the provided documentation) does not compile, I am wondering how one can make use of multiple threads within the tensor module.

Does a different documentation for the tensor module exist (other than the one mentioned above)?

Thanks
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
It seems you need to #define EIGEN_USE_THREADS before include Eigen/Tensor.


Bookmarks



Who is online

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