Created additional tests for the tensor code.

This commit is contained in:
Benoit Steiner
2014-06-05 10:49:34 -07:00
parent 6fa6cdd2b9
commit 8998f4099e
7 changed files with 406 additions and 30 deletions

View File

@@ -12,6 +12,7 @@
#include "main.h"
#include <Eigen/CXX11/Tensor>
#include "thread/threadpool.h"
using Eigen::Tensor;
@@ -24,8 +25,10 @@ void test_cxx11_tensor_thread_pool()
in1.setRandom();
in2.setRandom();
Eigen::ThreadPoolDevice thread_pool_device(3);
out.device(thread_pool_device) = in1 + in2 * 3.14;
ThreadPool thread_pool(2);
thread_pool.StartWorkers();
Eigen::ThreadPoolDevice thread_pool_device(&thread_pool, 3);
out.device(thread_pool_device) = in1 + in2 * 3.14f;
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {