Actually add optional Allocator* arg to ThreadPoolDevice().

This commit is contained in:
Paul Tucker 2018-07-16 17:53:36 -07:00
parent b3e7c9132d
commit 4e9848fa86

View File

@ -95,8 +95,8 @@ static EIGEN_STRONG_INLINE void wait_until_ready(SyncType* n) {
// Build a thread pool device on top the an existing pool of threads.
struct ThreadPoolDevice {
// The ownership of the thread pool remains with the caller.
ThreadPoolDevice(ThreadPoolInterface* pool, int num_cores)
: pool_(pool), num_threads_(num_cores), allocator_(nullptr) { }
ThreadPoolDevice(ThreadPoolInterface* pool, int num_cores, Allocator* allocator = nullptr)
: pool_(pool), num_threads_(num_cores), allocator_(allocator) { }
EIGEN_STRONG_INLINE void* allocate(size_t num_bytes) const {
return allocator_ ? allocator_->allocate(num_bytes)