Add test coverage for ThreadPoolDevice optional allocator.

This commit is contained in:
Paul Tucker
2018-07-19 17:43:44 -07:00
parent 4e9848fa86
commit d4afccde5a
2 changed files with 48 additions and 4 deletions

View File

@@ -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 {