legate.core.task.VariantInvoker#
- class legate.core.task.VariantInvoker(func: UserFunction)#
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.
- 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.Default arguments are not yet supported either.
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.