GoclDevice

GoclDevice — Object that represents an OpenCL capable device

Stability Level

Unstable, unless otherwise indicated

Synopsis

struct              GoclDevice;
struct              GoclDeviceClass;
GoclQueue *         gocl_device_get_default_queue       (GoclDevice *self,
                                                         GError **error);
cl_device_id        gocl_device_get_id                  (GoclDevice *self);
gsize               gocl_device_get_max_work_group_size (GoclDevice *self,
                                                         GError **error);
GoclDevice *        gocl_queue_get_device               (GoclQueue *self);

Object Hierarchy

  GObject
   +----GoclDevice

Properties

  "context"                  GoclContext*          : Read / Write / Construct Only
  "id"                       gpointer              : Read / Write / Construct Only

Description

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() or gocl_context_get_default_cpu().

To obtain the work group size of a device, gocl_device_get_max_work_group_size() is used.

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.

Details

struct GoclDevice

struct GoclDevice;


struct GoclDeviceClass

struct GoclDeviceClass {
  GObjectClass parent_class;
};

The class for GoclDevice objects.

GObjectClass parent_class;

The parent class

gocl_device_get_default_queue ()

GoclQueue *         gocl_device_get_default_queue       (GoclDevice *self,
                                                         GError **error);

Returns a GoclQueue command queue associated with this device, or NULL upon error, in which case error is filled accordingly.

self :

The GoclDevice

error :

A pointer to a GError, or NULL. [out][allow-none][transfer full]

Returns :

A GoclQueue object, which is owned by the device and should not be freed. [transfer none]

gocl_device_get_id ()

cl_device_id        gocl_device_get_id                  (GoclDevice *self);

Returns the internal cl_device_id.

self :

The GoclDevice

Returns :

The device id. [transfer none][type guint64]

gocl_device_get_max_work_group_size ()

gsize               gocl_device_get_max_work_group_size (GoclDevice *self,
                                                         GError **error);

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 and error is filled with an error from OpenCL domain.

self :

The GoclDevice

error :

A pointer to a GError, or NULL. [out][allow-none]

Returns :

The maximum size of the work group for this device.

gocl_queue_get_device ()

GoclDevice *        gocl_queue_get_device               (GoclQueue *self);

Retrieves the device associated with this command queue.

self :

The GoclQueue

Returns :

The GoclDevice this queue refers to. [transfer none]

Property Details

The "context" property

  "context"                  GoclContext*          : Read / Write / Construct Only

The context of this device.


The "id" property

  "id"                       gpointer              : Read / Write / Construct Only

The id of this device.