mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Update TheadPoolDevice example to include ThreadPool creation and passing pointer into constructor.
This commit is contained in:
parent
66a885b61e
commit
9a3f06d836
@ -430,8 +430,11 @@ This is exactly the same as not inserting a `device()` call.
|
|||||||
|
|
||||||
#### Evaluating with a Thread Pool
|
#### Evaluating with a Thread Pool
|
||||||
|
|
||||||
|
// Create the Eigen ThreadPool
|
||||||
|
Eigen::ThreadPool pool(8 /* number of threads in pool */)
|
||||||
|
|
||||||
// Create the Eigen ThreadPoolDevice.
|
// Create the Eigen ThreadPoolDevice.
|
||||||
Eigen::ThreadPoolDevice my_device(4 /* number of threads to use */);
|
Eigen::ThreadPoolDevice my_device(&pool, 4 /* number of threads to use */);
|
||||||
|
|
||||||
// Now just use the device when evaluating expressions.
|
// Now just use the device when evaluating expressions.
|
||||||
Eigen::Tensor<float, 2> c(30, 50);
|
Eigen::Tensor<float, 2> c(30, 50);
|
||||||
|
Loading…
Reference in New Issue
Block a user