#ifndef __EIGEN_DEVICE__
#define __EIGEN_DEVICE__

#ifndef EIGEN_USE_THREADS
 #define EIGEN_USE_THREADS
#endif

#include "unsupported/Eigen/CXX11/ThreadPool"
#include "unsupported/Eigen/CXX11/Tensor"

static constexpr const unsigned int THREAD_POOL_SIZE = 12;

Eigen::ThreadPool tp(THREAD_POOL_SIZE);
Eigen::ThreadPoolDevice device(&tp, THREAD_POOL_SIZE);

const Eigen::ThreadPoolDevice& GetDefaultDevice() {
  return device;
}

#endif
