Top | ![]() |
![]() |
![]() |
![]() |
cl_device_id | gocl_device_get_id () |
gsize | gocl_device_get_max_work_group_size () |
GoclQueue * | gocl_device_get_default_queue () |
gboolean | gocl_device_has_extension () |
guint | gocl_device_get_max_compute_units () |
gboolean | gocl_device_acquire_gl_objects_sync () |
GoclEvent * | gocl_device_acquire_gl_objects () |
gboolean | gocl_device_release_gl_objects_sync () |
GoclEvent * | gocl_device_release_gl_objects () |
GoclDevice * | gocl_queue_get_device () |
GoclContext * | context | Read / Write / Construct Only |
gpointer | id | 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.
cl_device_id
gocl_device_get_id (GoclDevice *self
);
Returns the internal cl_device_id.
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.
GoclQueue *
gocl_device_get_default_queue (GoclDevice *self
);
Returns a GoclQueue command queue associated with this device, or NULL
upon
error.
gboolean gocl_device_has_extension (GoclDevice *self
,const gchar *extension_name
);
Tells whether the device supports a given OpenCL extension, described by
extension_name
.
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.
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.
self |
The GoclDevice |
|
object_list |
A GList of
GoclBuffer objects, or |
[element-type Gocl.Buffer][allow-none] |
event_wait_list |
List or GoclEvent
objects to wait for, or |
[element-type Gocl.Event][allow-none] |
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_objects_sync()
.
This method works only if the <i>cl_khr_gl_sharing</i> OpenCL extension is supported.
self |
The GoclDevice |
|
object_list |
A GList of
GoclBuffer objects, or |
[element-type Gocl.Buffer][allow-none] |
event_wait_list |
List or GoclEvent
objects to wait for, or |
[element-type Gocl.Event][allow-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.
self |
The GoclDevice |
|
object_list |
A GList of
GoclBuffer objects, or |
[element-type Gocl.Buffer][allow-none] |
event_wait_list |
List or GoclEvent
objects to wait for, or |
[element-type Gocl.Event][allow-none] |
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_objects_sync()
.
This method works only if the <i>cl_khr_gl_sharing</i> OpenCL extension is supported.
self |
The GoclDevice |
|
object_list |
A GList of
GoclBuffer objects, or |
[element-type Gocl.Buffer][allow-none] |
event_wait_list |
List or GoclEvent
objects to wait for, or |
[element-type Gocl.Event][allow-none] |
GoclDevice *
gocl_queue_get_device (GoclQueue *self
);
Retrieves the device associated with this command queue.
“context”
property“context” GoclContext *
The context of this device.
Owner: GoclDevice
Flags: Read / Write / Construct Only