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.Resources
structure 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.Resources
instance.
- get_cached_kernel(filename, kernel)¶
- Parameters:
- Raises:
- Returns:
a cl_kernel object that is load from filename or
None
on 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_gpu_nodes()¶
- Returns:
List with
Ufo.GpuNode
objects. Free with g_list_free() but not its elements.- Return type:
Get all
Ufo.GpuNode
objects managed by self.
- get_kernel(filename, kernel, options)¶
- Parameters:
- Raises:
- Returns:
a cl_kernel object that is load from filename or
None
on 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 orNone
on 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
().