Provide EIGEN_OVERRIDE and EIGEN_FINAL macros to mark virtual function overrides

This commit is contained in:
Christoph Hertzberg
2018-09-24 18:01:17 +02:00
parent 626942d9dd
commit 2c083ace3e
3 changed files with 25 additions and 7 deletions

View File

@@ -18,12 +18,12 @@ using Eigen::Tensor;
class TestAllocator : public Allocator {
public:
~TestAllocator() override {}
EIGEN_DEVICE_FUNC void* allocate(size_t num_bytes) const override {
~TestAllocator() EIGEN_OVERRIDE {}
EIGEN_DEVICE_FUNC void* allocate(size_t num_bytes) const EIGEN_OVERRIDE {
const_cast<TestAllocator*>(this)->alloc_count_++;
return internal::aligned_malloc(num_bytes);
}
EIGEN_DEVICE_FUNC void deallocate(void* buffer) const override {
EIGEN_DEVICE_FUNC void deallocate(void* buffer) const EIGEN_OVERRIDE {
const_cast<TestAllocator*>(this)->dealloc_count_++;
internal::aligned_free(buffer);
}