omni::graph::exec::unstable::IPartitionPass

Defined in omni/graph/exec/unstable/IPartitionPass.h

class IPartitionPass : public omni::core::Generated<omni::graph::exec::unstable::IPartitionPass_abi>

Base class for graph partitioning passes.

See Pass Concepts for an in-depth guide on how this object is used during graph construction.

Partition passes are typically run just after population passes and only on newly modified omni::graph::exec::unstable::INodeGraphDef objects. The job of a partition pass is to recognize patterns in the newly populated graph and replace them with a new definition or augment existing ones.

Partition passes can only mutate the graph from the omni::graph::exec::unstable::IPartitionPass::commit method using the provided omni::graph::exec::unstable::IGraphBuilder. This will guarantee that the rest of the pipeline is aware of changes made to the graph and avoid potential threading issues.

See Passes for more pass related functionality.

Public Functions

inline bool initialize(omni::core::ObjectParam<omni::graph::exec::unstable::ITopology> topology) noexcept

Call from pass pipeline to initialize the pass for topology.

This interface method implementation must not mutate the given topology. Multiple passes can run concurrently on it.

topology must not be nullptr.

Returns true if initialization was successful and the pipeline should issue calls to run and commit. Otherwise, this pass will be destroyed and will not participate in partitioning topology.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.

inline void run(omni::core::ObjectParam<omni::graph::exec::unstable::INode> node) noexcept

Call from pass pipeline to discover nodes requiring partitioning.

No topology changes are permitted at this point. Multiple passes will get a chance to receive this notification.

The given node must not be nullptr.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.

inline void commit(omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilder> builder) noexcept

Call to verify generated partitions and commit new definition/s replacing discovered partitions.

Commit of partitions is done serially and in the priority order of the pass. Passes with higher order will get the chance first. This is the only partition pass method that can mutate the graph.

Because higher priority partition passes may mutate the graph, care must be taken by lower priority passes in this method to recognize if the nodes selected in omni::graph::exec::unstable::IPartitionPass::run() still make sense to partition.

The given builder must not be nullptr.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.

Protected Functions

virtual bool initialize_abi(ITopology *topology) noexcept = 0

Call from pass pipeline to initialize the pass for topology.

This interface method implementation must not mutate the given topology. Multiple passes can run concurrently on it.

topology must not be nullptr.

Returns true if initialization was successful and the pipeline should issue calls to run and commit. Otherwise, this pass will be destroyed and will not participate in partitioning topology.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.

virtual void run_abi(INode *node) noexcept = 0

Call from pass pipeline to discover nodes requiring partitioning.

No topology changes are permitted at this point. Multiple passes will get a chance to receive this notification.

The given node must not be nullptr.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.

virtual void commit_abi(IGraphBuilder *builder) noexcept = 0

Call to verify generated partitions and commit new definition/s replacing discovered partitions.

Commit of partitions is done serially and in the priority order of the pass. Passes with higher order will get the chance first. This is the only partition pass method that can mutate the graph.

Because higher priority partition passes may mutate the graph, care must be taken by lower priority passes in this method to recognize if the nodes selected in omni::graph::exec::unstable::IPartitionPass::run() still make sense to partition.

The given builder must not be nullptr.

Thread Safety

omni::graph::exec::unstable::IPassPipeline will never call this method concurrently.