OpenCL C++ Bindings: cl Namespace Reference

OpenCL C++ Bindings

Classes | Typedefs | Enumerations | Functions | Variables
cl Namespace Reference

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

## 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 | Image2DGL
| Class interface for GL 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 | Image3DGL
| Class interface for GL 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.
template<class T >
using | fine_svm_vector = vector< T, cl::SVMAllocator< int, cl::SVMTraitFine<> >>
| Vector alias to simplify contruction of fine-grained SVM containers.
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.

## Enumerations
enum class | QueueProperties : cl_command_queue_properties { None = 0 , Profiling = CL_QUEUE_PROFILING_ENABLE , OutOfOrder = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE }
enum class | DeviceQueueProperties : cl_command_queue_properties { None = 0 , Profiling = CL_QUEUE_PROFILING_ENABLE }

## Functions
CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int | UnloadCompiler () CL_API_SUFFIX__VERSION_1_1_DEPRECATED
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)

## Variables
cl::Image2DGL | CL_API_SUFFIX__VERSION_1_1_DEPRECATED

## Detailed Description

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

## Function Documentation

## ◆ allocate_pointer()

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 3823 of file opencl.hpp.

## ◆ copy() [1/4]

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 9497 of file opencl.hpp.

## ◆ copy() [2/4]

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 9552 of file opencl.hpp.

## ◆ copy() [3/4]

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 9513 of file opencl.hpp.

## ◆ copy() [4/4]

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 9481 of file opencl.hpp.

## ◆ enqueueMapSVM() [1/3]

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 9318 of file opencl.hpp.

## ◆ enqueueMapSVM() [2/3]

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 9342 of file opencl.hpp.

## ◆ enqueueMapSVM() [3/3]

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 9294 of file opencl.hpp.

## ◆ enqueueUnmapSVM() [1/3]

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 9418 of file opencl.hpp.

## ◆ enqueueUnmapSVM() [2/3]

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 9439 of file opencl.hpp.

## ◆ enqueueUnmapSVM() [3/3]

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 9396 of file opencl.hpp.

## ◆ Local()

LocalSpaceArg cl::Local | ( | size_type | size | ) |
| inline

Helper function for generating LocalSpaceArg objects.

Local

Definition at line 5877 of file opencl.hpp.

## ◆ mapSVM()

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 9583 of file opencl.hpp.

## ◆ UnloadCompiler()

cl_int cl::UnloadCompiler | ( |  | ) |
| inline

Deprecated APIs for 1.2 Unload the OpenCL compiler.

Note
  Deprecated for OpenCL 1.2. Use Platform::unloadCompiler instead.

Definition at line 2793 of file opencl.hpp.

## ◆ unmapSVM()

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 9592 of file opencl.hpp.