OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cl::SVMAllocator< T, SVMTrait > Class Template Reference

#include <cl2.hpp>

Classes

struct  rebind
 

Public Types

typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

 SVMAllocator ()
 
 SVMAllocator (cl::Context context)
 
 SVMAllocator (const SVMAllocator &other)
 
template<typename U >
 SVMAllocator (const SVMAllocator< U, SVMTrait > &other)
 
 ~SVMAllocator ()
 
pointer address (reference r) CL_HPP_NOEXCEPT_
 
const_pointer address (const_reference r) CL_HPP_NOEXCEPT_
 
pointer allocate (size_type size, typename cl::SVMAllocator< void, SVMTrait >::const_pointer=0)
 
void deallocate (pointer p, size_type)
 
size_type max_size () const CL_HPP_NOEXCEPT_
 
template<class U , class... Args>
void construct (U *p, Args &&...args)
 
template<class U >
void destroy (U *p)
 
bool operator== (SVMAllocator const &rhs)
 
bool operator!= (SVMAllocator const &a)
 

Friends

template<typename U , typename V >
class SVMAllocator
 

Detailed Description

template<typename T, class SVMTrait>
class cl::SVMAllocator< T, SVMTrait >

STL-like allocator class for managing SVM objects provided for convenience.

Note that while this behaves like an allocator for the purposes of constructing vectors and similar objects, care must be taken when using with smart pointers. The allocator should not be used to construct a unique_ptr if we are using coarse-grained SVM mode because the coarse-grained management behaviour would behave incorrectly with respect to reference counting.

Instead the allocator embeds a Deleter which may be used with unique_ptr and is used with the allocate_shared and allocate_ptr supplied operations.

Member Typedef Documentation

template<typename T, class SVMTrait>
typedef const value_type* cl::SVMAllocator< T, SVMTrait >::const_pointer
template<typename T, class SVMTrait>
typedef const value_type& cl::SVMAllocator< T, SVMTrait >::const_reference
template<typename T, class SVMTrait>
typedef std::ptrdiff_t cl::SVMAllocator< T, SVMTrait >::difference_type
template<typename T, class SVMTrait>
typedef value_type* cl::SVMAllocator< T, SVMTrait >::pointer
template<typename T, class SVMTrait>
typedef value_type& cl::SVMAllocator< T, SVMTrait >::reference
template<typename T, class SVMTrait>
typedef std::size_t cl::SVMAllocator< T, SVMTrait >::size_type
template<typename T, class SVMTrait>
typedef T cl::SVMAllocator< T, SVMTrait >::value_type

Constructor & Destructor Documentation

template<typename T, class SVMTrait>
cl::SVMAllocator< T, SVMTrait >::SVMAllocator ( )
inline
template<typename T, class SVMTrait>
cl::SVMAllocator< T, SVMTrait >::SVMAllocator ( cl::Context  context)
inlineexplicit
template<typename T, class SVMTrait>
cl::SVMAllocator< T, SVMTrait >::SVMAllocator ( const SVMAllocator< T, SVMTrait > &  other)
inline
template<typename T, class SVMTrait>
template<typename U >
cl::SVMAllocator< T, SVMTrait >::SVMAllocator ( const SVMAllocator< U, SVMTrait > &  other)
inline
template<typename T, class SVMTrait>
cl::SVMAllocator< T, SVMTrait >::~SVMAllocator ( )
inline

Member Function Documentation

template<typename T, class SVMTrait>
pointer cl::SVMAllocator< T, SVMTrait >::address ( reference  r)
inline
template<typename T, class SVMTrait>
const_pointer cl::SVMAllocator< T, SVMTrait >::address ( const_reference  r)
inline
template<typename T, class SVMTrait>
pointer cl::SVMAllocator< T, SVMTrait >::allocate ( size_type  size,
typename cl::SVMAllocator< void, SVMTrait >::const_pointer  = 0 
)
inline

Allocate an SVM pointer.

If the allocator is coarse-grained, this will take ownership to allow containers to correctly construct data in place.

template<typename T, class SVMTrait>
template<class U , class... Args>
void cl::SVMAllocator< T, SVMTrait >::construct ( U *  p,
Args &&...  args 
)
inline
template<typename T, class SVMTrait>
void cl::SVMAllocator< T, SVMTrait >::deallocate ( pointer  p,
size_type   
)
inline
template<typename T, class SVMTrait>
template<class U >
void cl::SVMAllocator< T, SVMTrait >::destroy ( U *  p)
inline
template<typename T, class SVMTrait>
size_type cl::SVMAllocator< T, SVMTrait >::max_size ( ) const
inline

Return the maximum possible allocation size. This is the minimum of the maximum sizes of all devices in the context.

template<typename T, class SVMTrait>
bool cl::SVMAllocator< T, SVMTrait >::operator!= ( SVMAllocator< T, SVMTrait > const &  a)
inline
template<typename T, class SVMTrait>
bool cl::SVMAllocator< T, SVMTrait >::operator== ( SVMAllocator< T, SVMTrait > const &  rhs)
inline

Returns true if the contexts match.

Friends And Related Function Documentation

template<typename T, class SVMTrait>
template<typename U , typename V >
friend class SVMAllocator
friend

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