19 #ifndef GEOSX_BUFFER_ALLOCATOR_HPP 20 #define GEOSX_BUFFER_ALLOCATOR_HPP 25 #include <umpire/ResourceManager.hpp> 26 #include <umpire/TypedAllocator.hpp> 35 void setPreferPinned(
bool p );
42 bool getPreferPinned( );
58 template<
typename T >
66 umpire::TypedAllocator< value_type > m_alloc;
67 bool m_prefer_pinned_l;
75 : m_alloc( umpire::TypedAllocator< T >( umpire::ResourceManager::getInstance().getAllocator( umpire::resource::Host )))
76 , m_prefer_pinned_l( getPreferPinned( ) )
78 auto & rm = umpire::ResourceManager::getInstance();
79 if( rm.isAllocator(
"PINNED" ) && m_prefer_pinned_l )
80 m_alloc = umpire::TypedAllocator< T >( rm.getAllocator( umpire::resource::Pinned ));
87 value_type * allocate(
size_t sz )
89 return m_alloc.allocate( sz );
96 void deallocate( value_type * buffer,
size_t sz )
98 if( buffer !=
nullptr )
99 m_alloc.deallocate( buffer, sz );
117 bool operator==(
const BufferAllocator & other )
bool operator!=(InputFlags const left, InputFlags const right)
Comparison operator for InputFlags enumeration.
bool operator==(InputFlags const left, InputFlags const right)
Comparison operator for InputFlags enumeration.