OpenCL 2.0 C++ Bindings  2.0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Namespaces | Classes | Typedefs | Enumerations | Functions
cl Namespace Reference

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

Namespaces

 compatibility
 
 detail
 

Classes

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  CommandQueue
 CommandQueue interface for cl_command_queue. More...
 
class  Context
 Class interface for cl_context. More...
 
class  Device
 Class interface for cl_device_id. More...
 
class  DeviceCommandQueue
 DeviceCommandQueue interface for device cl_command_queues. More...
 
class  EnqueueArgs
 
class  Event
 Class interface for cl_event. More...
 
class  Image
 C++ base class for Image Memory objects. More...
 
class  Image1D
 Class interface for 1D Image Memory objects. More...
 
class  Image1DArray
 Image interface for arrays of 1D images. More...
 
class  Image1DBuffer
 Image interface for 1D buffer 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...
 
struct  ImageFormat
 Adds constructors and member functions for cl_image_format. 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  Kernel
 Class interface for cl_kernel. More...
 
class  KernelFunctor
 
struct  LocalSpaceArg
 Local address wrapper for use with Kernel::setArg. More...
 
class  Memory
 Class interface for cl_mem. More...
 
class  NDRange
 Class interface for specifying NDRange values. More...
 
class  Pipe
 Class interface for Pipe Memory Objects. More...
 
class  Platform
 Class interface for cl_platform_id. More...
 
class  Program
 Program interface that implements cl_program. More...
 
class  Sampler
 Class interface for cl_sampler. More...
 
class  SVMAllocator
 
class  SVMAllocator< void, SVMTrait >
 
class  SVMTraitAtomic
 
class  SVMTraitCoarse
 
class  SVMTraitFine
 
class  SVMTraitReadOnly
 
class  SVMTraitReadWrite
 
class  SVMTraitWriteOnly
 
class  UserEvent
 Class interface for user events (a subset of cl_event's). More...
 

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, 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, 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>

Definition at line 543 of file cl2.hpp.

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.

Definition at line 3590 of file cl2.hpp.

using cl::BuildLogType = typedef vector<std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info, CL_PROGRAM_BUILD_LOG>::param_type>>

Definition at line 1827 of file cl2.hpp.

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.

Definition at line 3578 of file cl2.hpp.

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.

Definition at line 3584 of file cl2.hpp.

template<class T , class D >
using cl::pointer = typedef std::unique_ptr<T, D>

Definition at line 535 of file cl2.hpp.

using cl::size_type = typedef size_t

Definition at line 503 of file cl2.hpp.

using cl::string = typedef std::string

Definition at line 523 of file cl2.hpp.

template<class T , class Alloc = std::allocator<T>>
using cl::vector = typedef std::vector<T, Alloc>

Definition at line 516 of file cl2.hpp.

Enumeration Type Documentation

enum cl::DeviceQueueProperties : cl_command_queue_properties
strong
Enumerator
None 
Profiling 

Definition at line 8077 of file cl2.hpp.

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

Definition at line 6553 of file cl2.hpp.

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.

Definition at line 3531 of file cl2.hpp.

template<class T , class SVMTrait , class... Args>
cl::pointer<T, detail::Deleter<SVMAllocator<T, SVMTrait> > > cl::allocate_svm ( Args...  args)

Definition at line 3560 of file cl2.hpp.

template<class T , class SVMTrait , class... Args>
cl::pointer<T, detail::Deleter<SVMAllocator<T, SVMTrait> > > cl::allocate_svm ( const cl::Context c,
Args...  args 
)

Definition at line 3567 of file cl2.hpp.

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.

Definition at line 8704 of file cl2.hpp.

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.

Definition at line 8720 of file cl2.hpp.

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.

Definition at line 8736 of file cl2.hpp.

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.

Definition at line 8775 of file cl2.hpp.

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

Definition at line 8679 of file cl2.hpp.

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

Definition at line 8895 of file cl2.hpp.

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

Definition at line 9042 of file cl2.hpp.

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

Definition at line 8990 of file cl2.hpp.

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

Definition at line 9016 of file cl2.hpp.

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

Definition at line 8478 of file cl2.hpp.

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.

Definition at line 8517 of file cl2.hpp.

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.

Definition at line 8541 of file cl2.hpp.

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.

Definition at line 8565 of file cl2.hpp.

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

Definition at line 8440 of file cl2.hpp.

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

Definition at line 8823 of file cl2.hpp.

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

Definition at line 8930 of file cl2.hpp.

cl_int cl::enqueueUnmapMemObject ( const Memory &  memory,
void *  mapped_ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Definition at line 8584 of file cl2.hpp.

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.

Definition at line 8619 of file cl2.hpp.

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.

Definition at line 8641 of file cl2.hpp.

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.

Definition at line 8662 of file cl2.hpp.

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

Definition at line 8459 of file cl2.hpp.

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,
void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Definition at line 8859 of file cl2.hpp.

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,
void *  ptr,
const vector< Event > *  events = NULL,
Event *  event = NULL 
)
inline

Definition at line 8960 of file cl2.hpp.

cl_int cl::finish ( void  )
inline

Definition at line 9081 of file cl2.hpp.

cl_int cl::flush ( void  )
inline

Definition at line 9069 of file cl2.hpp.

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

Definition at line 6422 of file cl2.hpp.

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

Definition at line 6458 of file cl2.hpp.

LocalSpaceArg cl::Local ( size_type  size)
inline

Helper function for generating LocalSpaceArg objects.

Local

Definition at line 5604 of file cl2.hpp.

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

Blocking SVM map operation - performs a blocking map underneath.

Definition at line 8806 of file cl2.hpp.

QueueProperties cl::operator| ( QueueProperties  lhs,
QueueProperties  rhs 
)

Definition at line 6560 of file cl2.hpp.

DeviceQueueProperties cl::operator| ( DeviceQueueProperties  lhs,
DeviceQueueProperties  rhs 
)

Definition at line 8083 of file cl2.hpp.

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

Blocking SVM map operation - performs a blocking map underneath.

Definition at line 8815 of file cl2.hpp.