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
func
has a non-conforming signature.
Notes
All parameters to
func
which 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,*args
and**kwargs
are not allowed.
Attributes
ParamList
ParamList Return the derived output parameters for a user variant function.
ParamList
ParamList Return the derived scalar parameters for a user variant function.
Signature Return the signature of the user function.
Methods
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.