Runtime and Library Contexts#
Library#
A Library
class is an interface that every library descriptor needs to
implement. Each library should tell the Legate runtime how to initialize and
configure the library, and this class provides a common way to reveal that
information to the runtime. Each library should register to the runtime a
library descriptor object that implements Library
directly or via duck
typing. (See legate.core.runtime.Runtime.register_library()
.)
Returns a name of the library |
|
Returns the path to the shared library |
|
Returns a compiled C header string for the library |
|
Returns the name of a C registration callback for the library |
|
Returns a ResourceConfig object that configures the library |
Resource configuration#
A ResourceConfig
object describes the maximum number of handles that a
library uses.
Context#
A Context
object provides APIs for creating stores and issuing tasks and
other kinds of operations. When a library registers itself to the Legate
runtime, the runtime gives back a context object unique to the library.
|
Creates a fresh store. |
|
Creates a task. |
|
Type safe version of |
|
Type safe version of |
|
Creates a copy operation. |
|
Creates a fill operation. |
Issues an execution fence. |
|
|
Performs a user-defined reduction by building a tree of reduction tasks. |
|
Queries a tunable parameter to the mapper. |
Returns the current provenance string. |
|
Returns the current set of annotations. |
|
|
Sets a new provenance string |
Clears the provenance string that is currently set |
|
|
Pushes a provenance string to the stack |
Pops the provenance string on top the stack |
|
|
Wraps a function with provenance tracking. |
Legate Runtime#
Returns the total number of CPUs in the system |
|
Returns the total number of OpenMP processors in the system |
|
Returns the total number of GPUs in the system |
|
|
Registers a library to the runtime. |
|
Creates a future from a buffer holding a scalar value. |
Annotation#
An Annotation
is a context manager to set library specific annotations that
are to be attached to operations issued within a scope. A typical usage of
Annotation
would look like this:
with Annotation(lib_context, { "key1" : "value1", "key2" : "value2", ... }:
...
Then each operation in the scope is annotated with the key-value pairs, which are later rendered in execution profiles.
|
Constructs a new annotation object |