Top | ![]() |
![]() |
![]() |
![]() |
#define | UFO_RESOURCES_CHECK_CLERR() |
#define | UFO_RESOURCES_CHECK_AND_SET() |
UfoResources * | ufo_resources_new () |
|
ufo_resources_add_path () |
|
ufo_resources_get_kernel () |
|
ufo_resources_get_kernel_with_opts () |
|
ufo_resources_get_cached_kernel () |
|
ufo_resources_get_kernel_from_source () |
|
ufo_resources_get_context () |
|
ufo_resources_get_cmd_queues () |
|
ufo_resources_get_devices () |
|
ufo_resources_get_gpu_nodes () |
|
ufo_resources_get_remote_nodes () |
const |
ufo_resources_clerr () |
|
ufo_resources_error_quark () |
UfoDeviceType | device-type | Read / Write / Construct Only |
platform-index | Read / Write | |
|
remotes | Read / Write |
#define | UFO_RESOURCES_ERROR |
enum | UfoResourcesError |
enum | UfoDeviceType |
struct | UfoResources |
struct | UfoResourcesClass |
The UfoResources creates the OpenCL environment and loads OpenCL kernels
from text files. Users should in general not create a resources object
themselves but use one that is created automatically by
#define UFO_RESOURCES_CHECK_CLERR(error)
Check the return value of OpenCL functions and issue a warning with file and line number if an error occurred.
#define UFO_RESOURCES_CHECK_AND_SET(error, g_error_loc)
Check error
and set g_error_loc
accordingly.
UfoResources *
ufo_resources_new (GError **error
);
Create a new UfoResources instance.
gpointer ufo_resources_get_kernel (UfoResources *resources
,const
,gchar *filenameconst
,gchar *kernel);
GError **error
Loads a and builds a kernel from a file. The file is searched in the current
working directory and all paths added through ufo_resources_add_path()
. If
kernel
is NULL
resources |
A UfoResources object |
|
filename |
Name of the .cl kernel file |
|
kernel |
Name of a kernel, or |
|
error |
Return location for a GError from UfoResourcesError, or |
gpointer ufo_resources_get_kernel_with_opts (UfoResources *resources
,const
,gchar *filenameconst
,gchar *kernel_nameconst
,gchar *options);
GError **error
Loads a and builds a kernel from a file. The file is searched in the current
working directory and all paths added through ufo_resources_add_paths()
kernel
is NULL
resources |
A UfoResources object |
|
filename |
Name of the .cl kernel file |
|
kernel_name |
Name of a kernel, or |
|
options |
Options passed to the OpenCL compiler |
|
error |
Return location for a GError from UfoResourcesError, or |
gpointer ufo_resources_get_cached_kernel (UfoResources *resources
,const
,gchar *filenameconst
,gchar *kernel);
GError **error
Loads a and builds a kernel from a file. The file is searched in the current
working directory and all paths added through ufo_resources_add_path()
. If
kernel
is NULL
resources |
A UfoResources object |
|
filename |
Name of the .cl kernel file |
|
kernel |
Name of a kernel, or |
|
error |
Return location for a GError from UfoResourcesError, or |
gpointer ufo_resources_get_kernel_from_source (UfoResources *resources
,const
,gchar *sourceconst
,gchar *kernel);
GError **error
Loads and builds a kernel from a string. If kernel
is NULL
source
is used.
resources |
||
source |
OpenCL source string |
|
kernel |
Name of a kernel or |
|
error |
Return location for a GError from UfoResourcesError, or NULL |
gpointer ufo_resources_get_context (UfoResources *resources
);
Returns the OpenCL context object that is used by the resource resources. This context can be used to initialize othe third-party libraries.
[skip]
GList * ufo_resources_get_cmd_queues (UfoResources *resources
);
Get all command queues managed by resources
.
[skip]
GList * ufo_resources_get_devices (UfoResources *resources
);
Get all devices queues managed by resources
.
[skip]
GList * ufo_resources_get_gpu_nodes (UfoResources *resources
);
Get all UfoGpuNode objects managed by resources
.
List with
UfoGpuNode objects. Free with g_list_free()
[transfer container][element-type Ufo.GpuNode]
GList * ufo_resources_get_remote_nodes (UfoResources *resources
);
Get all resources
.
constgchar * ufo_resources_clerr ();
int error
Get a human-readable string representation of error
.
OpenCL related errors.
struct UfoResources;
Manages OpenCL resources. The contents of the UfoResources structure are private and should only be accessed via the provided API.
“device-type”
property“device-type” UfoDeviceType
Type of the devices that should be used exclusively for computation.
See: UfoDeviceType for the device classes.
Flags: Read / Write / Construct Only
Default value: UFO_DEVICE_GPU
“platform-index”
property“platform-index”gint
Platform index, -1 denotes any platform.
Flags: Read / Write
Allowed values: [-1,16]
Default value: 0