...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::buffer_allocator — The buffer_allocator class allocates memory with buffer objects.
// In header: <boost/compute/allocator/buffer_allocator.hpp> template<typename T> class buffer_allocator { public: // types typedef T value_type; typedef unspecified pointer; typedef unspecified const_pointer; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // public member functions explicit buffer_allocator(const context &); buffer_allocator(const buffer_allocator< T > &); buffer_allocator< T > & operator=(const buffer_allocator< T > &); buffer_allocator(buffer_allocator< T > &&) noexcept; buffer_allocator< T > & operator=(buffer_allocator< T > &&) noexcept; ~buffer_allocator(); pointer allocate(size_type); void deallocate(pointer, size_type); size_type max_size() const; context get_context() const; // protected member functions void set_mem_flags(cl_mem_flags); };
See Also: buffer
buffer_allocator
public member functionsexplicit buffer_allocator(const context & context);
buffer_allocator(const buffer_allocator< T > & other);
buffer_allocator< T > & operator=(const buffer_allocator< T > & other);
buffer_allocator(buffer_allocator< T > && other) noexcept;
buffer_allocator< T > & operator=(buffer_allocator< T > && other) noexcept;
~buffer_allocator();
pointer allocate(size_type n);
void deallocate(pointer p, size_type n);
size_type max_size() const;
context get_context() const;