OpenCL C++ Bindings
|
Class interface for cl_context. More...
#include <opencl.hpp>
Public Member Functions | |
Context (const vector< Device > &devices, const cl_context_properties *properties=nullptr, void(CL_CALLBACK *notifyFptr)(const char *, const void *, size_type, void *)=nullptr, void *data=nullptr, cl_int *err=nullptr) | |
Constructs a context including a list of specified devices. More... | |
Context (const Device &device, const cl_context_properties *properties=nullptr, void(CL_CALLBACK *notifyFptr)(const char *, const void *, size_type, void *)=nullptr, void *data=nullptr, cl_int *err=nullptr) | |
Constructs a context including a specific device. More... | |
Context (cl_device_type type, const cl_context_properties *properties=nullptr, void(CL_CALLBACK *notifyFptr)(const char *, const void *, size_type, void *)=nullptr, void *data=nullptr, cl_int *err=nullptr) | |
Constructs a context including all or a subset of devices of a specified type. More... | |
Context () | |
Default constructor - initializes to nullptr. More... | |
Context (const cl_context &context, bool retainObject=false) | |
Constructor from cl_context - takes ownership. More... | |
Context & | operator= (const cl_context &rhs) |
Assignment operator from cl_context - takes ownership. More... | |
template<typename T > | |
cl_int | getInfo (cl_context_info name, T *param) const |
Wrapper for clGetContextInfo(). More... | |
template<cl_context_info name> | |
detail::param_traits< detail::cl_context_info, name >::param_type | getInfo (cl_int *err=nullptr) const |
Wrapper for clGetContextInfo() that returns by value. More... | |
cl_int | getSupportedImageFormats (cl_mem_flags flags, cl_mem_object_type type, vector< ImageFormat > *formats) const |
Gets a list of supported image formats. More... | |
cl_int | setDestructorCallback (void(CL_CALLBACK *pfn_notify)(cl_context, void *), void *user_data=nullptr) |
Registers a destructor callback function with a context. More... | |
![]() | |
Wrapper (const cl_type &obj, bool retainObject) | |
Wrapper (const Wrapper< cl_type > &rhs) | |
Wrapper (Wrapper< cl_type > &&rhs) CL_HPP_NOEXCEPT_ | |
Wrapper< cl_type > & | operator= (const Wrapper< cl_type > &rhs) |
Wrapper< cl_type > & | operator= (Wrapper< cl_type > &&rhs) |
Wrapper< cl_type > & | operator= (const cl_type &rhs) |
const cl_type & | operator() () const |
cl_type & | operator() () |
cl_type | get () const |
Static Public Member Functions | |
static Context | getDefault (cl_int *err=nullptr) |
Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT. More... | |
static Context | setDefault (const Context &default_context) |
Additional Inherited Members | |
![]() | |
typedef cl_context | cl_type |
![]() | |
cl_int | retain () const |
cl_int | release () const |
![]() | |
cl_type | object_ |
Class interface for cl_context.
Definition at line 3033 of file opencl.hpp.
|
inline |
Constructs a context including a list of specified devices.
Wraps clCreateContext().
Definition at line 3105 of file opencl.hpp.
|
inline |
Constructs a context including a specific device.
Wraps clCreateContext().
Definition at line 3140 of file opencl.hpp.
|
inline |
Constructs a context including all or a subset of devices of a specified type.
Wraps clCreateContextFromType().
Definition at line 3170 of file opencl.hpp.
|
inline |
Default constructor - initializes to nullptr.
Definition at line 3283 of file opencl.hpp.
|
inlineexplicit |
Constructor from cl_context - takes ownership.
This effectively transfers ownership of a refcount on the cl_context into the new Context object.
Definition at line 3290 of file opencl.hpp.
|
inlinestatic |
Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT.
Definition at line 3258 of file opencl.hpp.
|
inline |
Wrapper for clGetContextInfo().
Definition at line 3306 of file opencl.hpp.
|
inline |
Wrapper for clGetContextInfo() that returns by value.
Definition at line 3316 of file opencl.hpp.
|
inline |
Gets a list of supported image formats.
Wraps clGetSupportedImageFormats().
Definition at line 3331 of file opencl.hpp.
|
inline |
Assignment operator from cl_context - takes ownership.
This effectively transfers ownership of a refcount on the rhs and calls clReleaseContext() on the value previously held by this instance.
Definition at line 3298 of file opencl.hpp.
Modify the default context to be used by subsequent operations. Will only set the default if no default was previously created.
Definition at line 3275 of file opencl.hpp.
|
inline |
Registers a destructor callback function with a context.
Wraps clSetContextDestructorCallback().
Each call to this function registers the specified callback function on a destructor callback stack associated with context. The registered callback functions are called in the reverse order in which they were registered. If a context callback function was specified when context was created, it will not be called after any context destructor callback is called.
Definition at line 3387 of file opencl.hpp.