![]() |
![]() |
![]() |
Gocl - Documentation and Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
struct GoclDevice; struct GoclDeviceClass; cl_device_id gocl_device_get_id (GoclDevice *self
); gsize gocl_device_get_max_work_group_size (GoclDevice *self
); GoclQueue * gocl_device_get_default_queue (GoclDevice *self
); gboolean gocl_device_has_extension (GoclDevice *self
,const gchar *extension_name
); guint gocl_device_get_max_compute_units (GoclDevice *self
); gboolean gocl_device_acquire_gl_objects_sync (GoclDevice *self
,GList *object_list
,GList *event_wait_list
); GoclEvent * gocl_device_acquire_gl_objects (GoclDevice *self
,GList *object_list
,GList *event_wait_list
); gboolean gocl_device_release_gl_objects_sync (GoclDevice *self
,GList *object_list
,GList *event_wait_list
); GoclEvent * gocl_device_release_gl_objects (GoclDevice *self
,GList *object_list
,GList *event_wait_list
); GoclDevice * gocl_queue_get_device (GoclQueue *self
);
"context" GoclContext* : Read / Write / Construct Only "id" gpointer : Read / Write / Construct Only
A GoclDevice object is not normally created directly. Instead, it is
obtained from a GoclContext by calling any of gocl_context_get_device_by_index()
,
gocl_context_get_default_gpu_sync()
or gocl_context_get_default_cpu_sync()
.
To obtain the maximum work group size of a device,
gocl_device_get_max_work_group_size()
is used. The number of compute units can be
retrieved with gocl_device_get_max_compute_units()
.
To enqueue operations on this device, a GoclQueue provides a default command queue
which is obtained by calling gocl_device_get_default_queue()
. More device queues can
be created by passing this object as 'device' property in the GoclQueue constructor.
struct GoclDeviceClass { GObjectClass parent_class; };
The class for GoclDevice objects.
cl_device_id gocl_device_get_id (GoclDevice *self
);
Returns the internal cl_device_id.
|
The GoclDevice |
Returns : |
The device id. [transfer none][type guint64] |
gsize gocl_device_get_max_work_group_size (GoclDevice *self
);
Retrieves the maximum work group size for the device,
by querying the CL_DEVICE_MAX_WORK_GROUP_SIZE
info key through
clGetDeviceInfo()
.
Upon success a value greater than zero is returned, otherwise zero
is returned.
|
The GoclDevice |
Returns : |
The maximum size of the work group for this device. |
GoclQueue * gocl_device_get_default_queue (GoclDevice *self
);
Returns a GoclQueue command queue associated with this device, or NULL
upon
error.
|
The GoclDevice |
Returns : |
A GoclQueue object, which is owned by the device and should not be freed. [transfer none] |
gboolean gocl_device_has_extension (GoclDevice *self
,const gchar *extension_name
);
Tells whether the device supports a given OpenCL extension, described by
extension_name
.
|
The GoclDevice |
|
The OpenCL extension name, as string |
Returns : |
TRUE if the device supports the extension, FALSE otherwise |
guint gocl_device_get_max_compute_units (GoclDevice *self
);
Retrieves the number of compute units in an OpenCL device, by querying CL_DEVICE_MAX_COMPUTE_UNITS in device info.
|
The GoclDevice |
Returns : |
The number of compute units in the device |
gboolean gocl_device_acquire_gl_objects_sync (GoclDevice *self
,GList *object_list
,GList *event_wait_list
);
Enqueues a request for acquiring the GoclBuffer (or deriving) objects
contained in object_list
, which were created from OpenGL objects, blocking
the program execution until the operation finishes.
This method works only if the <i>cl_khr_gl_sharing</i> OpenCL extension is supported.
Upon success, TRUE
is returned, otherwise FALSE
is returned.
|
The GoclDevice |
|
A GList of
GoclBuffer objects, or NULL . [element-type Gocl.Buffer][allow-none]
|
|
List or GoclEvent
objects to wait for, or NULL . [element-type Gocl.Event][allow-none]
|
Returns : |
TRUE on success, FALSE on error |
GoclEvent * gocl_device_acquire_gl_objects (GoclDevice *self
,GList *object_list
,GList *event_wait_list
);
Enqueues an asynchronous request for acquiring the GoclBuffer (or deriving)
objects contained in object_list
, which were created from OpenGL objects.
For a blocking version of this method, see
gocl_device_acquire_gl_object_sync()
.
This method works only if the <i>cl_khr_gl_sharing</i> OpenCL extension is supported.
|
The GoclDevice |
|
A GList of
GoclBuffer objects, or NULL . [element-type Gocl.Buffer][allow-none]
|
|
List or GoclEvent
objects to wait for, or NULL . [element-type Gocl.Event][allow-none]
|
Returns : |
A GoclEvent to get notified when the operation finishes. [transfer none] |
gboolean gocl_device_release_gl_objects_sync (GoclDevice *self
,GList *object_list
,GList *event_wait_list
);
Enqueues a request for releasing the GoclBuffer (or deriving) objects
contained in object_list
, which were previously acquired by a call to
gocl_device_acquire_gl_objects_sync()
.
Upon success, TRUE
is returned, otherwise FALSE
is returned.
|
The GoclDevice |
|
A GList of
GoclBuffer objects, or NULL . [element-type Gocl.Buffer][allow-none]
|
|
List or GoclEvent
objects to wait for, or NULL . [element-type Gocl.Event][allow-none]
|
Returns : |
TRUE on success, FALSE on error |
GoclEvent * gocl_device_release_gl_objects (GoclDevice *self
,GList *object_list
,GList *event_wait_list
);
Enqueues an asynchronous request for releasing the GoclBuffer (or deriving)
objects contained in object_list
, which were created from OpenGL objects.
For a blocking version of this method, see
gocl_device_release_gl_object_sync()
.
This method works only if the <i>cl_khr_gl_sharing</i> OpenCL extension is supported.
|
The GoclDevice |
|
A GList of
GoclBuffer objects, or NULL . [element-type Gocl.Buffer][allow-none]
|
|
List or GoclEvent
objects to wait for, or NULL . [element-type Gocl.Event][allow-none]
|
Returns : |
A GoclEvent to get notified when the operation finishes. [transfer none] |
GoclDevice * gocl_queue_get_device (GoclQueue *self
);
Retrieves the device associated with this command queue.
|
The GoclQueue |
Returns : |
The GoclDevice this queue refers to. [transfer none] |
"context"
property"context" GoclContext* : Read / Write / Construct Only
The context of this device.