legate::PhysicalTask#

class PhysicalTask#

A class for physical task descriptors.

Public Functions

void add_input(const PhysicalArray &array) const#

Adds an array to the task as input.

Parameters:

array – An array to add to the task as input

void add_output(const PhysicalArray &array) const#

Adds an array to the task as output.

Parameters:

array – An array to add to the task as output

void add_reduction(
const PhysicalArray &array,
std::int32_t redop_kind
) const#

Adds an array to the task for reductions.

Parameters:
  • array – An array to add to the task for reductions

  • redop_kind – ID of the reduction operator to use. The array’s type must support the operator.

void add_scalar_arg(const Scalar &scalar) const#

Adds a by-value scalar argument to the task.

Parameters:

scalar – The Scalar to add to the task

template<typename T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<T>, Scalar> && std::is_constructible_v<Scalar, T>>>
void add_scalar_arg(
T &&value
) const#

Adds a by-value scalar argument to the task.

Template Parameters:

T – The scalar value’s type. Scalar must be constructible from a value of T

Parameters:

value – The scalar value to convert to Scalar and add to the task

void set_concurrent(bool concurrent) const#

Sets whether the task needs a concurrent task launch.

Any task with at least one communicator will implicitly use concurrent task launch, so this method is to be used when the task needs a concurrent task launch for a reason unknown to Legate.

Parameters:

concurrent – A boolean value indicating whether the task needs a concurrent task launch

void set_side_effect(bool has_side_effect) const#

Sets whether the task has side effects or not.

A task is assumed to be free of side effects by default if the task only has scalar arguments.

Parameters:

has_side_effect – A boolean value indicating whether the task has side effects

void throws_exception(bool can_throw_exception) const#

Sets whether the task can throw an exception or not.

Parameters:

can_throw_exception – A boolean value indicating whether the task can throw an exception