Contents

struct

SushiRuntime::API::Dynamic

Holds opt-in late-binding controls for a task, evaluated once per step.

Declared in
include/SushiRuntime/api/vocabulary/dynamic.hpp

See also

include/SushiRuntime/api/vocabulary/README.md

Public types

using SushiRuntime::API::Dynamic::WhenProvider = Core::Delegate<bool(), PROVIDER_CAPACITY>

Enable predicate polled once per step; false skips the node.

using SushiRuntime::API::Dynamic::CountProvider = Core::Delegate<std::size_t(), PROVIDER_CAPACITY>

Size provider polled once per step; element count to iterate.

using SushiRuntime::API::Dynamic::BaseProvider = Core::Delegate<std::size_t(), PROVIDER_CAPACITY>

Base provider polled once per step; first element to iterate.

Static public attributes

static constexpr std::size_t PROVIDER_CAPACITY = 48

Inline storage for each provider; a predicate captures little.

Public attributes

WhenProvider when_pred

Empty: the node is always enabled.

CountProvider count_fn

Empty: iterate the full baked range.

const std::uint32_t * device_count = nullptr

Residency::Host slot a predecessor writes the live count into.

Set by sized_from_device(); null otherwise. When set it takes the place of count_fn entirely, because the two answer different questions and only one can win — see sized_from_device().

std::size_t device_count_index = 0

Element index of the live count within device_count.

BaseProvider base_fn

Empty: iterate from element zero.

const std::uint32_t * device_base = nullptr

Residency::Host slot a predecessor writes the live base into.

Set by based_at_device(); null otherwise. When set it replaces base_fn, for the same reason sized_from_device() replaces count_fn.

std::size_t device_base_index = 0

Element index of the live base within device_base.

Public member functions

Dynamic & and_when(WhenProvider pred) &

Sets the enable predicate on a named Dynamic.

Parameters

pred

Polled before each step; false skips the node that step.

Returns

*this, for chaining.

Dynamic and_when(WhenProvider pred) &&

Sets the enable predicate while chaining inline.

Parameters

pred

Polled before each step; false skips the node that step.

Returns

This Dynamic, moved out by value into the next call.

Dynamic & and_sized(CountProvider count) &

Sets the live-size provider on a named Dynamic.

Parameters

count

Polled before each step; must not exceed the baked capacity.

Returns

*this, for chaining.

Dynamic and_sized(CountProvider count) &&

Sets the live-size provider while chaining inline.

Parameters

count

Polled before each step; must not exceed the baked capacity.

Returns

This Dynamic, moved out by value into the next call.

Dynamic & and_sized_from_device(const std::uint32_t *counter, std::size_t index) &

Points a named Dynamic at a device-written count and drops any sized() provider.

Parameters

counter

Slot in a Residency::Host allocation a predecessor writes; checked at add().

See also

include/SushiRuntime/api/vocabulary/README.md

Dynamic and_sized_from_device(const std::uint32_t *counter, std::size_t index) &&

Points a Dynamic at a device-written count while chaining inline.

Drops any host-side sized() provider, as the lvalue overload does.

Parameters

counter

Slot in a Residency::Host allocation a predecessor writes; checked at add().

index

Element index of the count within counter.

Returns

This Dynamic, moved out by value into the next call.

Dynamic & and_based_at(BaseProvider base) &

Sets the first-element provider on a named Dynamic.

Clears any device-written base, since only one source can decide it.

Parameters

base

Polled before each step; the first element to iterate.

Returns

*this, for chaining.

Dynamic and_based_at(BaseProvider base) &&

Sets the first-element provider while chaining inline.

Clears any device-written base, as the lvalue overload does.

Parameters

base

Polled before each step; the first element to iterate.

Returns

This Dynamic, moved out by value into the next call.

Dynamic & and_based_at_device(const std::uint32_t *slot, std::size_t index) &

Points a named Dynamic at a device-written base and drops any based_at() provider.

Parameters

slot

Slot in a Residency::Host allocation a predecessor writes; checked at add().

See also

include/SushiRuntime/api/vocabulary/README.md

Dynamic and_based_at_device(const std::uint32_t *slot, std::size_t index) &&

Points a Dynamic at a device-written base while chaining inline.

Drops any host-side based_at() provider, as the lvalue overload does.

Parameters

slot

Slot in a Residency::Host allocation a predecessor writes; checked at add().

index

Element index of the base within slot.

Returns

This Dynamic, moved out by value into the next call.