legate.core.task.VariantInvoker#
- class legate.core.task.VariantInvoker(
- func: UserFunction,
- constraints: Sequence[DeferredConstraint] | None = None,
- *,
Encapsulate the calling conventions between a user-supplied task variant function, and a Legate task.
- __init__()#
Construct a
VariantInvoker- Parameters:
func (UserFunction) – The user function which is to be invoked.
constraints – The list of constraints which are to be applied to the arguments of
func, if any. Defaults to no constraints.
- Raises:
TypeError – If
funchas a non-conforming signature.
Notes
All parameters to
funcwhich are neither inputs, outputs, or reductions, are automatically considered to be scalars.All user functions must return exactly
None, and all arguments must be fully type-hinted. Furthermore, all arguments must be positional or keyword arguments,*argsand**kwargsare not allowed.
Attributes
ParamList
ParamList
ParamList
ParamList
Signature
Methods
__call__(self, TaskContext ctx, func)Invoke the given function by adapting a TaskContext to the parameters for the function.
prepare_call(self, AutoTask task, ...)Prepare a list of arguments for task call.
valid_signature(self, func)Whether the given function's signature matches the configured function signature.
validate_signature(self, func)Ensure a callable's signature matches the configured signature.