#include <cl.hpp>
List of all members.
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) |
| 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) |
| Context () |
| Context (const Context &context) |
| Context (const cl_context &context) |
Context & | operator= (const Context &rhs) |
Context & | operator= (const cl_context &rhs) |
template<typename T > |
cl_int | getInfo (cl_context_info name, T *param) const |
template<cl_int name> |
detail::param_traits
< detail::cl_context_info,
name >::param_type | getInfo (cl_int *err=NULL) const |
cl_int | getSupportedImageFormats (cl_mem_flags flags, cl_mem_object_type type, VECTOR_CLASS< ImageFormat > *formats) const |
Static Public Member Functions |
static Context | getDefault (cl_int *err=NULL) |
Static Private Attributes |
static volatile int | default_initialized_ |
static Context | default_ |
static volatile cl_int | default_error_ |
Detailed Description
Definition at line 1609 of file cl.hpp.
Constructor & Destructor Documentation
Definition at line 1616 of file cl.hpp.
{
cl_int error;
object_ = ::clCreateContext(
properties, (cl_uint) devices.size(),
(cl_device_id*) &devices.front(),
notifyFptr, data, &error);
detail::errHandler(error, __CREATE_CONTEXT_ERR);
if (err != NULL) {
*err = error;
}
}
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] |
Definition at line 1639 of file cl.hpp.
{
cl_int error;
#if !defined(__APPLE__) || !defined(__MACOS)
cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 };
if (properties == NULL) {
prop[1] = (cl_context_properties)Platform::get(&error)();
if (error != CL_SUCCESS) {
detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR);
if (err != NULL) {
*err = error;
return;
}
}
properties = &prop[0];
}
#endif
object_ = ::clCreateContextFromType(
properties, type, notifyFptr, data, &error);
detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR);
if (err != NULL) {
*err = error;
}
}
Definition at line 1719 of file cl.hpp.
: detail::Wrapper<cl_type>() { }
Definition at line 1721 of file cl.hpp.
: detail::Wrapper<cl_type>(context) { }
Definition at line 1723 of file cl.hpp.
: detail::Wrapper<cl_type>(context) { }
Member Function Documentation
Definition at line 1749 of file cl.hpp.
{
typename detail::param_traits<
detail::cl_context_info, name>::param_type param;
cl_int result = getInfo(name, ¶m);
if (err != NULL) {
*err = result;
}
return param;
}
Definition at line 1760 of file cl.hpp.
{
cl_uint numEntries;
cl_int err = ::clGetSupportedImageFormats(
object_,
flags,
type,
0,
NULL,
&numEntries);
if (err != CL_SUCCESS) {
return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
}
ImageFormat* value = (ImageFormat*)
alloca(numEntries * sizeof(ImageFormat));
err = ::clGetSupportedImageFormats(
object_,
flags,
type,
numEntries,
(cl_image_format*) value,
NULL);
if (err != CL_SUCCESS) {
return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
}
formats->assign(&value[0], &value[numEntries]);
return CL_SUCCESS;
}
Context& cl::Context::operator= |
( |
const cl_context & |
rhs | ) |
[inline] |
Member Data Documentation
The documentation for this class was generated from the following file: