aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
diff options
context:
space:
mode:
authorGravatar Paul Tucker <tucker@google.com>2018-07-19 17:43:44 -0700
committerGravatar Paul Tucker <tucker@google.com>2018-07-19 17:43:44 -0700
commitd4afccde5a9553ddfb48b0f5fad0115cd8bf791a (patch)
tree8ddfe83b0d24f4cd64c3aad2bb4ada1778a6ad1a /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
parent4e9848fa8600be69dfb51405606eafa1dba8d0bf (diff)
Add test coverage for ThreadPoolDevice optional allocator.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index c9534d400..f4123b71d 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -91,6 +91,13 @@ static EIGEN_STRONG_INLINE void wait_until_ready(SyncType* n) {
}
}
+// An abstract interface to a device specific memory allocator.
+class Allocator {
+ public:
+ virtual ~Allocator() {}
+ EIGEN_DEVICE_FUNC virtual void* allocate(size_t num_bytes) const = 0;
+ EIGEN_DEVICE_FUNC virtual void deallocate(void* buffer) const = 0;
+};
// Build a thread pool device on top the an existing pool of threads.
struct ThreadPoolDevice {