cl::Context Class Reference

Class interface for cl_context. More...

`#include <cl.hpp>`

Inheritance diagram for cl::Context:
[legend]
Collaboration diagram for cl::Context:
[legend]

## Public Member Functions

| Context (const VECTOR_CLASS< Device > &devices, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Constructs a context including a list of specified devices. More...
| Context (const Device &device, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Context (cl_device_type type, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Constructs a context including all or a subset of devices of a specified type. More...
| Context (const Context &ctx)
| Copy constructor to forward copy to the superclass correctly. Required for MSVC. More...
Context & | operator= (const Context &ctx)
| Copy assignment to forward copy to the superclass correctly. Required for MSVC. More...
| Context ()
| Default constructor - initializes to NULL. More...
__CL_EXPLICIT_CONSTRUCTORS | Context (const cl_context &context)
| 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_int name>
detail::param_traits< detail::cl_context_info, name >::param_type | getInfo (cl_int *err=NULL) const
| Wrapper for clGetContextInfo() that returns by value. More...
cl_int | getSupportedImageFormats (cl_mem_flags flags, cl_mem_object_type type, VECTOR_CLASS< ImageFormat > *formats) const
| Gets a list of supported image formats. More...
| Context (const VECTOR_CLASS< Device > &devices, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Constructs a context including a list of specified devices. More...
| Context (const Device &device, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Context (cl_device_type type, cl_context_properties *properties=NULL, void(CL_CALLBACK *notifyFptr)(const char *, const void *, ::size_t, void *)=NULL, void *data=NULL, cl_int *err=NULL)
| Constructs a context including all or a subset of devices of a specified type. More...
| Context (const Context &ctx)
| Copy constructor to forward copy to the superclass correctly. Required for MSVC. More...
Context & | operator= (const Context &ctx)
| Copy assignment to forward copy to the superclass correctly. Required for MSVC. More...
| Context ()
| Default constructor - initializes to NULL. More...
__CL_EXPLICIT_CONSTRUCTORS | Context (const cl_context &context)
| 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_int name>
detail::param_traits< detail::cl_context_info, name >::param_type | getInfo (cl_int *err=NULL) const
| Wrapper for clGetContextInfo() that returns by value. More...
cl_int | getSupportedImageFormats (cl_mem_flags flags, cl_mem_object_type type, VECTOR_CLASS< ImageFormat > *formats) const
| Gets a list of supported image formats. More...
Public Member Functions inherited from cl::detail::Wrapper< cl_context >
| Wrapper ()
| Wrapper (const cl_type &obj)
| Wrapper (const Wrapper< cl_type > &rhs)
| Wrapper ()
| Wrapper (const cl_type &obj)
| Wrapper (const Wrapper< cl_type > &rhs)
| ~Wrapper ()
| ~Wrapper ()
Wrapper< cl_type > & | operator= (const Wrapper< cl_type > &rhs)
Wrapper< cl_type > & | operator= (const cl_type &rhs)
Wrapper< cl_type > & | operator= (const Wrapper< cl_type > &rhs)
Wrapper< cl_type > & | operator= (const cl_type &rhs)
cl_type | operator() () const
cl_type & | operator() ()
cl_type | operator() () const
cl_type & | operator() ()

## Static Public Member Functions

static Context | getDefault (cl_int *err=NULL)
| Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT. More...
static Context | getDefault (cl_int *err=NULL)
| Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT. More...

## Additional Inherited Members

Public Types inherited from cl::detail::Wrapper< cl_context >
typedef cl_context | cl_type
typedef cl_context | cl_type
Protected Member Functions inherited from cl::detail::Wrapper< cl_context >
cl_int | retain () const
cl_int | retain () const
cl_int | release () const
cl_int | release () const
Protected Attributes inherited from cl::detail::Wrapper< cl_context >
cl_type | object_

## Detailed Description

Class interface for cl_context.

Deprecated APIs for 1.2

Note
  Copies of these objects are shallow, meaning that the copy will refer to the same underlying cl_context as the original. For details, see clRetainContext() and clReleaseContext().

See also
  cl_context

Definition at line 2341 of file cl.hpp.

## Constructor & Destructor Documentation

## Context() [1/12]

cl::Context::Context | ( | const VECTOR_CLASS< Device > & | devices,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Constructs a context including a list of specified devices.

Wraps clCreateContext().

Definition at line 2358 of file cl.hpp.

## Context() [2/12]

cl::Context::Context | ( | const Device & | device,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Definition at line 2388 of file cl.hpp.

## Context() [3/12]

cl::Context::Context | ( | cl_device_type | type,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Constructs a context including all or a subset of devices of a specified type.

Wraps clCreateContextFromType().

Definition at line 2418 of file cl.hpp.

## Context() [4/12]

cl::Context::Context | ( | const Context & | ctx | ) |

inline

Copy constructor to forward copy to the superclass correctly. Required for MSVC.

Definition at line 2502 of file cl.hpp.

## Context() [5/12]

cl::Context::Context | ( |  | ) |

inline

Default constructor - initializes to NULL.

Definition at line 2582 of file cl.hpp.

## Context() [6/12]

__CL_EXPLICIT_CONSTRUCTORS cl::Context::Context | ( | const cl_context & | context | ) |

inline

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 2589 of file cl.hpp.

## Context() [7/12]

cl::Context::Context | ( | const VECTOR_CLASS< Device > & | devices,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Constructs a context including a list of specified devices.

Wraps clCreateContext().

Definition at line 2358 of file cl.hpp.

## Context() [8/12]

cl::Context::Context | ( | const Device & | device,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Definition at line 2388 of file cl.hpp.

## Context() [9/12]

cl::Context::Context | ( | cl_device_type | type,
|  | cl_context_properties * | properties = `NULL`,
|  | void(CL_CALLBACK *notifyFptr)( const char *, const void *, ::size_t, void *) | = `NULL`,
|  | void * | data = `NULL`,
|  | cl_int * | err = `NULL`
| ) |  |

inline

Constructs a context including all or a subset of devices of a specified type.

Wraps clCreateContextFromType().

Definition at line 2418 of file cl.hpp.

## Context() [10/12]

cl::Context::Context | ( | const Context & | ctx | ) |

inline

Copy constructor to forward copy to the superclass correctly. Required for MSVC.

Definition at line 2502 of file cl.hpp.

## Context() [11/12]

cl::Context::Context | ( |  | ) |

inline

Default constructor - initializes to NULL.

Definition at line 2582 of file cl.hpp.

## Context() [12/12]

__CL_EXPLICIT_CONSTRUCTORS cl::Context::Context | ( | const cl_context & | context | ) |

inline

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 2589 of file cl.hpp.

## Member Function Documentation

## getDefault() [1/2]

static Context cl::Context::getDefault | ( | cl_int * | err = `NULL` | ) |

inline static

Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT.

Note
  All calls to this function return the same cl_context as the first.

Definition at line 2533 of file cl.hpp.

## getDefault() [2/2]

static Context cl::Context::getDefault | ( | cl_int * | err = `NULL` | ) |

inline static

Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT.

Note
  All calls to this function return the same cl_context as the first.

Definition at line 2533 of file cl.hpp.

## getInfo() [1/4]

template<typename T >

cl_int cl::Context::getInfo | ( | cl_context_info | name,
|  | T * | param
| ) |  | const

inline

Wrapper for clGetContextInfo().

Definition at line 2604 of file cl.hpp.

## getInfo() [2/4]

template<typename T >

cl_int cl::Context::getInfo | ( | cl_context_info | name,
|  | T * | param
| ) |  | const

inline

Wrapper for clGetContextInfo().

Definition at line 2604 of file cl.hpp.

## getInfo() [3/4]

template<cl_int name>

detail::param_traits<detail::cl_context_info, name>::param_type cl::Context::getInfo | ( | cl_int * | err = `NULL` | ) | const

inline

Wrapper for clGetContextInfo() that returns by value.

Definition at line 2614 of file cl.hpp.

## getInfo() [4/4]

template<cl_int name>

detail::param_traits<detail::cl_context_info, name>::param_type cl::Context::getInfo | ( | cl_int * | err = `NULL` | ) | const

inline

Wrapper for clGetContextInfo() that returns by value.

Definition at line 2614 of file cl.hpp.

## getSupportedImageFormats() [1/2]

cl_int cl::Context::getSupportedImageFormats | ( | cl_mem_flags | flags,
|  | cl_mem_object_type | type,
|  | VECTOR_CLASS< ImageFormat > * | formats
| ) |  | const

inline

Gets a list of supported image formats.

Wraps clGetSupportedImageFormats().

Definition at line 2629 of file cl.hpp.

## getSupportedImageFormats() [2/2]

cl_int cl::Context::getSupportedImageFormats | ( | cl_mem_flags | flags,
|  | cl_mem_object_type | type,
|  | VECTOR_CLASS< ImageFormat > * | formats
| ) |  | const

inline

Gets a list of supported image formats.

Wraps clGetSupportedImageFormats().

Definition at line 2629 of file cl.hpp.

## operator=() [1/4]

Context& cl::Context::operator= | ( | const cl_context & | rhs | ) |

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 2596 of file cl.hpp.

## operator=() [2/4]

Context& cl::Context::operator= | ( | const cl_context & | rhs | ) |

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 2596 of file cl.hpp.

## operator=() [3/4]

Context& cl::Context::operator= | ( | const Context & | ctx | ) |

inline

Copy assignment to forward copy to the superclass correctly. Required for MSVC.

Definition at line 2507 of file cl.hpp.

## operator=() [4/4]

Context& cl::Context::operator= | ( | const Context & | ctx | ) |

inline

Copy assignment to forward copy to the superclass correctly. Required for MSVC.

Definition at line 2507 of file cl.hpp.

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

- /build/asl-1Fw6fH/asl-0.1.7/debian/tmp/usr/include/ASL/acl/cl.hpp