TestAllocator Class Reference
+ Inheritance diagram for TestAllocator:

Public Member Functions

 ~TestAllocator () EIGEN_OVERRIDE
 
EIGEN_DEVICE_FUNC void * allocate (size_t num_bytes) const EIGEN_OVERRIDE
 
EIGEN_DEVICE_FUNC void deallocate (void *buffer) const EIGEN_OVERRIDE
 
int alloc_count () const
 
int dealloc_count () const
 

Private Attributes

int alloc_count_ = 0
 
int dealloc_count_ = 0
 

Constructor & Destructor Documentation

◆ ~TestAllocator()

TestAllocator::~TestAllocator ( )
inline
20 {}

Member Function Documentation

◆ alloc_count()

int TestAllocator::alloc_count ( ) const
inline
30 { return alloc_count_; }
int alloc_count_
Definition: cxx11_tensor_thread_pool.cpp:34

References alloc_count_.

Referenced by test_threadpool_allocate().

◆ allocate()

EIGEN_DEVICE_FUNC void* TestAllocator::allocate ( size_t  num_bytes) const
inline
21  {
22  const_cast<TestAllocator*>(this)->alloc_count_++;
23  return internal::aligned_malloc(num_bytes);
24  }
Definition: cxx11_tensor_thread_pool.cpp:18
EIGEN_DEVICE_FUNC void * aligned_malloc(std::size_t size)
Definition: Memory.h:199

References Eigen::internal::aligned_malloc(), and alloc_count_.

◆ dealloc_count()

int TestAllocator::dealloc_count ( ) const
inline
31 { return dealloc_count_; }
int dealloc_count_
Definition: cxx11_tensor_thread_pool.cpp:35

References dealloc_count_.

Referenced by test_threadpool_allocate().

◆ deallocate()

EIGEN_DEVICE_FUNC void TestAllocator::deallocate ( void *  buffer) const
inline
25  {
26  const_cast<TestAllocator*>(this)->dealloc_count_++;
27  internal::aligned_free(buffer);
28  }
EIGEN_DEVICE_FUNC void aligned_free(void *ptr)
Definition: Memory.h:224

References Eigen::internal::aligned_free(), and dealloc_count_.

Member Data Documentation

◆ alloc_count_

int TestAllocator::alloc_count_ = 0
private

Referenced by alloc_count(), and allocate().

◆ dealloc_count_

int TestAllocator::dealloc_count_ = 0
private

Referenced by dealloc_count(), and deallocate().


The documentation for this class was generated from the following file: