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 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.

Default arguments are not yet supported either.

Attributes

inputs

ParamList

outputs

ParamList Return the derived output parameters for a user variant function.

reductions

ParamList

scalars

ParamList Return the derived scalar parameters for a user variant function.

signature

Signature Return the signature of the user function.

Methods

__call__

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.