Ufo.Resources¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Platform index, -1 denotes any platform |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Ufo.Resources(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Manages OpenCL resources. The contents of the
Ufo.Resourcesstructure are private and should only be accessed via the provided API.- classmethod clerr(error)¶
-
Get a human-readable string representation of error.
- classmethod new()¶
- Raises:
- Returns:
A new
Ufo.Resources- Return type:
Create a new
Ufo.Resourcesinstance.
- get_cached_kernel(filename, kernel)¶
- Parameters:
- Raises:
- Returns:
a cl_kernel object that is load from filename or
Noneon error- Return type:
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 isNone, the first encountered kernel is returned. The kernel object is cached and should not be used by two threads concurrently.
- get_context()¶
-
Returns the OpenCL context object that is used by the resource resources. This context can be used to initialize othe third-party libraries.
- get_gpu_nodes()¶
- Returns:
List with
Ufo.GpuNodeobjects. Free with g_list_free() but not its elements.- Return type:
Get all
Ufo.GpuNodeobjects managed by self.
- get_kernel(filename, kernel, options)¶
- Parameters:
- Raises:
- Returns:
a cl_kernel object that is load from filename or
Noneon error- Return type:
Loads 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 isNone, the first encountered kernel is returned. Options are passed verbatim to the OpenCL compiler and ignored ifNone.
- get_kernel_from_source(source, kernel, options)¶
- Parameters:
- Raises:
- Returns:
a cl_kernel object that is load from filename
- Return type:
Loads and builds a kernel from a string. If kernel is
None, the first kernel defined in source is used.
- get_kernel_source(filename)¶
- Parameters:
filename (
str) – Name of the .cl kernel file- Raises:
- Returns:
a string (
str) load from filename orNoneon error, user is responsible for free() it after using it.- Return type:
Loads a file present in the kernel PATH search list. The file is searched in the current working directory and all paths added through
Ufo.Resources.add_path().