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 Namespace Reference

The OpenCL C++ bindings are defined within this namespace. More...

Namespaces

 compatibility
 
 detail
 

Classes

struct  ImageFormat
 Adds constructors and member functions for cl_image_format. More...
 
class  Device
 Class interface for cl_device_id. More...
 
class  Platform
 Class interface for cl_platform_id. More...
 
class  Context
 Class interface for cl_context. More...
 
class  Event
 Class interface for cl_event. More...
 
class  UserEvent
 Class interface for user events (a subset of cl_event's). More...
 
class  Memory
 Class interface for cl_mem. More...
 
class  SVMTraitReadWrite
 
class  SVMTraitReadOnly
 
class  SVMTraitWriteOnly
 
class  SVMTraitCoarse
 
class  SVMTraitFine
 
class  SVMTraitAtomic
 
class  SVMAllocator
 
class  SVMAllocator< void, SVMTrait >
 
class  Buffer
 Class interface for Buffer Memory Objects. More...
 
class  BufferGL
 Class interface for GL Buffer Memory Objects. More...
 
class  BufferRenderGL
 Class interface for GL Render Buffer Memory Objects. More...
 
class  Image
 C++ base class for Image Memory objects. More...
 
class  Image1D
 Class interface for 1D Image Memory objects. More...
 
class  Image1DBuffer
 Image interface for 1D buffer images. More...
 
class  Image1DArray
 Image interface for arrays of 1D images. More...
 
class  Image2D
 Class interface for 2D Image Memory objects. More...
 
class  Image2DArray
 Image interface for arrays of 2D images. More...
 
class  Image3D
 Class interface for 3D Image Memory objects. More...
 
class  ImageGL
 general image interface for GL interop. We abstract the 2D and 3D GL images into a single instance here that wraps all GL sourced images on the grounds that setup information was performed by OpenCL anyway. More...
 
class  Pipe
 Class interface for Pipe Memory Objects. More...
 
class  Sampler
 Class interface for cl_sampler. More...
 
class  NDRange
 Class interface for specifying NDRange values. More...
 
struct  LocalSpaceArg
 Local address wrapper for use with Kernel::setArg. More...
 
class  Kernel
 Class interface for cl_kernel. More...
 
class  Program
 Program interface that implements cl_program. More...
 
class  CommandQueue
 CommandQueue interface for cl_command_queue. More...
 
class  DeviceCommandQueue
 DeviceCommandQueue interface for device cl_command_queues. More...
 
class  EnqueueArgs
 
class  KernelFunctor
 

Typedefs

using size_type = size_t
 
template<class T , class Alloc = std::allocator<T>>
using vector = std::vector< T, Alloc >
 
using string = std::string
 
template<class T , class D >
using pointer = std::unique_ptr< T, D >
 
template<class T , size_type N>
using array = std::array< T, N >
 
using BuildLogType = vector< std::pair< cl::Device, typename detail::param_traits< detail::cl_program_build_info, CL_PROGRAM_BUILD_LOG >::param_type >>
 
template<class T >
using coarse_svm_vector = vector< T, cl::SVMAllocator< int, cl::SVMTraitCoarse<>>>
 Vector alias to simplify contruction of coarse-grained SVM containers. More...
 
template<class T >
using fine_svm_vector = vector< T, cl::SVMAllocator< int, cl::SVMTraitFine<>>>
 Vector alias to simplify contruction of fine-grained SVM containers. More...
 
template<class T >
using atomic_svm_vector = vector< T, cl::SVMAllocator< int, cl::SVMTraitAtomic<>>>
 Vector alias to simplify contruction of fine-grained SVM containers that support platform atomics. More...
 

Enumerations

enum  QueueProperties : cl_command_queue_properties { QueueProperties::None = 0, QueueProperties::Profiling = CL_QUEUE_PROFILING_ENABLE, QueueProperties::OutOfOrder = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE }
 
enum  DeviceQueueProperties : cl_command_queue_properties { DeviceQueueProperties::None = 0, DeviceQueueProperties::Profiling = CL_QUEUE_PROFILING_ENABLE }
 

Functions

template<typename IteratorType >
cl_int copy (IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer)
 
template<typename IteratorType >
cl_int copy (const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator)
 
template<typename IteratorType >
cl_int copy (const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer)
 
template<typename IteratorType >
cl_int copy (const CommandQueue &queue, const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator)
 
template<typename T >
cl_int enqueueMapSVM (T *ptr, cl_bool blocking, cl_map_flags flags, size_type size, const vector< Event > *events=NULL, Event *event=NULL)
 
template<class T , class Alloc , class... Args>
cl::pointer< T,
detail::Deleter< Alloc > > 
allocate_pointer (const Alloc &alloc_, Args &&...args)
 
template<class T , class SVMTrait , class... Args>
cl::pointer< T,
detail::Deleter< SVMAllocator
< T, SVMTrait > > > 
allocate_svm (Args...args)
 
template<class T , class SVMTrait , class... Args>
cl::pointer< T,
detail::Deleter< SVMAllocator
< T, SVMTrait > > > 
allocate_svm (const cl::Context &c, Args...args)
 
LocalSpaceArg Local (size_type size)
 Helper function for generating LocalSpaceArg objects. More...
 
Program linkProgram (Program input1, Program input2, const char *options=NULL, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=NULL, void *data=NULL, cl_int *err=NULL)
 
Program linkProgram (vector< Program > inputPrograms, const char *options=NULL, void(CL_CALLBACK *notifyFptr)(cl_program, void *)=NULL, void *data=NULL, cl_int *err=NULL)
 
QueueProperties operator| (QueueProperties lhs, QueueProperties rhs)
 
DeviceQueueProperties operator| (DeviceQueueProperties lhs, DeviceQueueProperties rhs)
 
cl_int enqueueReadBuffer (const Buffer &buffer, cl_bool blocking, size_type offset, size_type size, void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueWriteBuffer (const Buffer &buffer, cl_bool blocking, size_type offset, size_type size, const void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
void * enqueueMapBuffer (const Buffer &buffer, cl_bool blocking, cl_map_flags flags, size_type offset, size_type size, const vector< Event > *events=NULL, Event *event=NULL, cl_int *err=NULL)
 
template<typename T , class D >
cl_int enqueueMapSVM (cl::pointer< T, D > ptr, cl_bool blocking, cl_map_flags flags, size_type size, const vector< Event > *events=NULL, Event *event=NULL)
 
template<typename T , class Alloc >
cl_int enqueueMapSVM (cl::vector< T, Alloc > container, cl_bool blocking, cl_map_flags flags, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueUnmapMemObject (const Memory &memory, void *mapped_ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
template<typename T >
cl_int enqueueUnmapSVM (T *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
template<typename T , class D >
cl_int enqueueUnmapSVM (cl::pointer< T, D > &ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
template<typename T , class Alloc >
cl_int enqueueUnmapSVM (cl::vector< T, Alloc > &container, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueCopyBuffer (const Buffer &src, const Buffer &dst, size_type src_offset, size_type dst_offset, size_type size, const vector< Event > *events=NULL, Event *event=NULL)
 
template<typename T , class Alloc >
cl_int mapSVM (cl::vector< T, Alloc > &container)
 
template<typename T , class Alloc >
cl_int unmapSVM (cl::vector< T, Alloc > &container)
 
cl_int enqueueReadBufferRect (const Buffer &buffer, cl_bool blocking, const array< size_type, 3 > &buffer_offset, const array< size_type, 3 > &host_offset, const array< size_type, 3 > &region, size_type buffer_row_pitch, size_type buffer_slice_pitch, size_type host_row_pitch, size_type host_slice_pitch, void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueWriteBufferRect (const Buffer &buffer, cl_bool blocking, const array< size_type, 3 > &buffer_offset, const array< size_type, 3 > &host_offset, const array< size_type, 3 > &region, size_type buffer_row_pitch, size_type buffer_slice_pitch, size_type host_row_pitch, size_type host_slice_pitch, const void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueCopyBufferRect (const Buffer &src, const Buffer &dst, const array< size_type, 3 > &src_origin, const array< size_type, 3 > &dst_origin, const array< size_type, 3 > &region, size_type src_row_pitch, size_type src_slice_pitch, size_type dst_row_pitch, size_type dst_slice_pitch, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueReadImage (const Image &image, cl_bool blocking, const array< size_type, 3 > &origin, const array< size_type, 3 > &region, size_type row_pitch, size_type slice_pitch, void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueWriteImage (const Image &image, cl_bool blocking, const array< size_type, 3 > &origin, const array< size_type, 3 > &region, size_type row_pitch, size_type slice_pitch, const void *ptr, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueCopyImage (const Image &src, const Image &dst, const array< size_type, 3 > &src_origin, const array< size_type, 3 > &dst_origin, const array< size_type, 3 > &region, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueCopyImageToBuffer (const Image &src, const Buffer &dst, const array< size_type, 3 > &src_origin, const array< size_type, 3 > &region, size_type dst_offset, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int enqueueCopyBufferToImage (const Buffer &src, const Image &dst, size_type src_offset, const array< size_type, 3 > &dst_origin, const array< size_type, 3 > &region, const vector< Event > *events=NULL, Event *event=NULL)
 
cl_int flush (void)
 
cl_int finish (void)
 

Detailed Description

The OpenCL C++ bindings are defined within this namespace.

Typedef Documentation

template<class T , size_type N>
using cl::array = typedef std::array<T, N>
template<class T >
using cl::atomic_svm_vector = typedef vector<T, cl::SVMAllocator<int, cl::SVMTraitAtomic<>>>

Vector alias to simplify contruction of fine-grained SVM containers that support platform atomics.

using cl::BuildLogType = typedef vector<std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info, CL_PROGRAM_BUILD_LOG>::param_type>>
template<class T >
using cl::coarse_svm_vector = typedef vector<T, cl::SVMAllocator<int, cl::SVMTraitCoarse<>>>

Vector alias to simplify contruction of coarse-grained SVM containers.

template<class T >
using cl::fine_svm_vector = typedef vector<T, cl::SVMAllocator<int, cl::SVMTraitFine<>>>

Vector alias to simplify contruction of fine-grained SVM containers.

template<class T , class D >
using cl::pointer = typedef std::unique_ptr<T, D>
using cl::size_type = typedef size_t
using cl::string = typedef std::string
template<class T , class Alloc = std::allocator<T>>
using cl::vector = typedef std::vector<T, Alloc>

Enumeration Type Documentation

enum cl::DeviceQueueProperties : cl_command_queue_properties
strong
Enumerator
None 
Profiling 
enum cl::QueueProperties : cl_command_queue_properties
strong
Enumerator
None 
Profiling 
OutOfOrder 

Function Documentation

template<class T , class Alloc , class... Args>
cl::pointer<T, detail::Deleter<Alloc> > cl::allocate_pointer ( const Alloc &  alloc_,
Args &&...  args 
)

Allocation operation compatible with std::allocate_ptr. Creates a unique_ptr<T> by default. This requirement is to ensure that the control block is not allocated in memory inaccessible to the host.

template<class T , class SVMTrait , class... Args>
cl::pointer<T, detail::Deleter<SVMAllocator<T, SVMTrait> > > cl::allocate_svm ( Args...  args)
template<class T , class SVMTrait , class... Args>
cl::pointer<T, detail::Deleter<SVMAllocator<T, SVMTrait> > > cl::allocate_svm ( const cl::Context c,
Args...  args 
)
template<typename IteratorType >
cl_int cl::copy ( IteratorType  startIterator,
IteratorType  endIterator,
cl::Buffer buffer 
)
inline

Blocking copy operation between iterators and a buffer. Host to Device. Uses default command queue.

template<typename IteratorType >
cl_int cl::copy ( const cl::Buffer buffer,
IteratorType  startIterator,
IteratorType  endIterator 
)
inline

Blocking copy operation between iterators and a buffer. Device to Host. Uses default command queue.

template<typename IteratorType >
cl_int cl::copy ( const CommandQueue &  queue,
IteratorType  startIterator,
IteratorType  endIterator,
cl::Buffer buffer 
)
inline

Blocking copy operation between iterators and a buffer. Host to Device. Uses specified queue.

template<typename IteratorType >
cl_int cl::copy ( const CommandQueue &  queue,
const cl::Buffer buffer,
IteratorType  startIterator,
IteratorType  endIterator 
)
inline

Blocking copy operation between iterators and a buffer. Device to Host. Uses specified queue.

cl_int cl::enqueueCopyBuffer ( const Buffer &  src,
const Buffer &  dst,
size_type  src_offset,
size_type  dst_offset,
size_type  size,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueCopyBufferRect ( const Buffer &  src,
const Buffer &  dst,
const array< size_type, 3 > &  src_origin,
const array< size_type, 3 > &  dst_origin,
const array< size_type, 3 > &  region,
size_type  src_row_pitch,
size_type  src_slice_pitch,
size_type  dst_row_pitch,
size_type  dst_slice_pitch,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueCopyBufferToImage ( const Buffer &  src,
const Image &  dst,
size_type  src_offset,
const array< size_type, 3 > &  dst_origin,
const array< size_type, 3 > &  region,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueCopyImage ( const Image &  src,
const Image &  dst,
const array< size_type, 3 > &  src_origin,
const array< size_type, 3 > &  dst_origin,
const array< size_type, 3 > &  region,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueCopyImageToBuffer ( const Image &  src,
const Buffer &  dst,
const array< size_type, 3 > &  src_origin,
const array< size_type, 3 > &  region,
size_type  dst_offset,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
void* cl::enqueueMapBuffer ( const Buffer &  buffer,
cl_bool  blocking,
cl_map_flags  flags,
size_type  offset,
size_type  size,
const vector< Event > *  events = NULL,
Event *  event = NULL,
cl_int *  err = NULL 
)
inline
template<typename T >
cl_int cl::enqueueMapSVM ( T *  ptr,
cl_bool  blocking,
cl_map_flags  flags,
size_type  size,
const vector< Event > *  events,
Event *  event 
)
inline

Enqueues to the default queue a command that will allow the host to update a region of a coarse-grained SVM buffer. This variant takes a raw SVM pointer.

template<typename T , class D >
cl_int cl::enqueueMapSVM ( cl::pointer< T, D >  ptr,
cl_bool  blocking,
cl_map_flags  flags,
size_type  size,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Enqueues to the default queue a command that will allow the host to update a region of a coarse-grained SVM buffer. This variant takes a cl::pointer instance.

template<typename T , class Alloc >
cl_int cl::enqueueMapSVM ( cl::vector< T, Alloc >  container,
cl_bool  blocking,
cl_map_flags  flags,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Enqueues to the default queue a command that will allow the host to update a region of a coarse-grained SVM buffer. This variant takes a cl::vector instance.

cl_int cl::enqueueReadBuffer ( const Buffer &  buffer,
cl_bool  blocking,
size_type  offset,
size_type  size,
void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueReadBufferRect ( const Buffer &  buffer,
cl_bool  blocking,
const array< size_type, 3 > &  buffer_offset,
const array< size_type, 3 > &  host_offset,
const array< size_type, 3 > &  region,
size_type  buffer_row_pitch,
size_type  buffer_slice_pitch,
size_type  host_row_pitch,
size_type  host_slice_pitch,
void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueReadImage ( const Image &  image,
cl_bool  blocking,
const array< size_type, 3 > &  origin,
const array< size_type, 3 > &  region,
size_type  row_pitch,
size_type  slice_pitch,
void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueUnmapMemObject ( const Memory &  memory,
void *  mapped_ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
template<typename T >
cl_int cl::enqueueUnmapSVM ( T *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Enqueues to the default queue a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. This variant takes a raw SVM pointer.

template<typename T , class D >
cl_int cl::enqueueUnmapSVM ( cl::pointer< T, D > &  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Enqueues to the default queue a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. This variant takes a cl::pointer instance.

template<typename T , class Alloc >
cl_int cl::enqueueUnmapSVM ( cl::vector< T, Alloc > &  container,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Enqueues to the default queue a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. This variant takes a cl::vector instance.

cl_int cl::enqueueWriteBuffer ( const Buffer &  buffer,
cl_bool  blocking,
size_type  offset,
size_type  size,
const void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueWriteBufferRect ( const Buffer &  buffer,
cl_bool  blocking,
const array< size_type, 3 > &  buffer_offset,
const array< size_type, 3 > &  host_offset,
const array< size_type, 3 > &  region,
size_type  buffer_row_pitch,
size_type  buffer_slice_pitch,
size_type  host_row_pitch,
size_type  host_slice_pitch,
const void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::enqueueWriteImage ( const Image &  image,
cl_bool  blocking,
const array< size_type, 3 > &  origin,
const array< size_type, 3 > &  region,
size_type  row_pitch,
size_type  slice_pitch,
const void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline
cl_int cl::finish ( void  )
inline
cl_int cl::flush ( void  )
inline
Program cl::linkProgram ( Program  input1,
Program  input2,
const char *  options = NULL,
void(CL_CALLBACK *notifyFptr)(cl_program, void *)  = NULL,
void *  data = NULL,
cl_int *  err = NULL 
)
inline
Program cl::linkProgram ( vector< Program >  inputPrograms,
const char *  options = NULL,
void(CL_CALLBACK *notifyFptr)(cl_program, void *)  = NULL,
void *  data = NULL,
cl_int *  err = NULL 
)
inline
LocalSpaceArg cl::Local ( size_type  size)
inline

Helper function for generating LocalSpaceArg objects.

Local

template<typename T , class Alloc >
cl_int cl::mapSVM ( cl::vector< T, Alloc > &  container)
inline

Blocking SVM map operation - performs a blocking map underneath.

QueueProperties cl::operator| ( QueueProperties  lhs,
QueueProperties  rhs 
)
inline
DeviceQueueProperties cl::operator| ( DeviceQueueProperties  lhs,
DeviceQueueProperties  rhs 
)
inline
template<typename T , class Alloc >
cl_int cl::unmapSVM ( cl::vector< T, Alloc > &  container)
inline

Blocking SVM map operation - performs a blocking map underneath.