Base class for custom evaluation overrides in the evaluation manager.
More...
#include <MPxCustomEvaluator.h>
Defines the type of consolidation during cluster creation.
Enumerator |
---|
kConsolidateNone |
Create single cluster per node/cycle cluster.
|
kConsolidateSubgraph |
Group nodes to form subgraph cluster, favoring long clusters.
|
kConsolidateFlood |
Group nodes to form subgraph cluster, favoring big clusters and partitioning speed.
|
Constructor.
Also creates our internal evaluator.
bool active |
( |
MStatus * |
ReturnStatus = NULL | ) |
const |
Is evaluator active.
- Parameters
-
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
- Returns
- true if evaluator should receive scheduling then evaluation notifications.
void setActive |
( |
bool |
isNowActive, |
|
|
MStatus * |
ReturnStatus = NULL |
|
) |
| |
Change evaluator active state.
- Parameters
-
[in] | isNowActive | New active state |
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
bool ready |
( |
MStatus * |
ReturnStatus = NULL | ) |
const |
Is evaluator ready to be used for evaluation.
- Parameters
-
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
- Returns
- true when evaluator is ready for to preform evaluation
void setReady |
( |
bool |
isNowReady, |
|
|
MStatus * |
ReturnStatus = NULL |
|
) |
| |
Change evaluator ready state.
- Parameters
-
[in] | isNowReady | New ready state |
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
Get current consolidation type used during cluster creation.
- Parameters
-
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
- Returns
- Current consolidation type set for this evaluator
Set the consolidation type to be used when clusters are created.
- Parameters
-
[in] | newType | New consolidation type to set for this evaluator |
[out] | ReturnStatus | Returns success or object error when internal object is not associated with this evaluator |
Mark supported nodes.
This call marks node as supported by the evaluator. It is safe to cause evaluation in this call, but this evaluation cost will increase partitioning time and won't reduce the next evaluation time. It is up to the developer to decide whether evaluation is required or the already-evaluated data in the datablock can be used. Call .outputValue/.outputArrayValue in the first case and .inputValue/.inputArrayValue in the second (the first is preferred).
Zero, one or more nodes can be marked by this call, since the dependency node design can involve multiple nodes being joined in a single setup (e.g. IK chains).
- Parameters
-
[in] | node | Node to set or clear supported bit |
- Examples:
- constraintEvaluator/constraintEvaluator.cpp, evaluationPruningEvaluator/evaluationPruningEvaluator.cpp, and simpleEvaluator/simpleEvaluator.cpp.
Prepare cluster for evaluation.
This is called just before the cluster begins evaluation.
- Parameters
-
[in] | cluster | Cluster node to initialize |
- Returns
- true if initialization was successful
- Examples:
- simpleEvaluator/simpleEvaluator.cpp.
Check to see if the cluster is ready for evaluation.
It can happen that cluster initialization takes longer and is performed in a background thread. Instead of waiting, the evaluation manager will compute the cluster's node values using an evaluation node until the evaluator is ready to take over.
It is safe and allowed for custom evaluator to switch back to unready state.
- Parameters
-
[in] | cluster | Cluster node to check for readiness |
- Returns
- true if the cluster is ready for evaluation
Cleanup for cluster.
The cluster will be deleted every time the graph is invalidated, but it's up to the custom evaluator to decide if it wants to clear its internal representation or maybe it's possible to have some of this setup reusable.
To reuse internal representation of an cluster, developer can decide to keep hash of depend nodes that were in the cluster.
- Parameters
-
[in] | cluster | Cluster node to terminate |
- Examples:
- constraintEvaluator/constraintEvaluator.cpp, and simpleEvaluator/simpleEvaluator.cpp.
bool wantPruneExecution |
( |
| ) |
const |
|
virtual |
Introduced in 2022.0
Whether the custom evaluator wants to manage the evaluation of supported nodes.
- 2022.0:
- Introduced in this version.
The method returns false by default, which means the custom evaluator doesn't interfer the evaluation of its supported nodes and they will be evaluated as normal.
- Returns
- Whether the custom evaluator will get a chance to prune execution of a node and its downstream. Pruning execution saves the cost of computing the node and the entire downstream. It as well saves the cost of scheduling any of this work.
- Examples:
- evaluationPruningEvaluator/evaluationPruningEvaluator.cpp.
Introduced in 2022.0
Whether to skip evaluation of the input cluster node and its downstream.
- 2022.0:
- Introduced in this version.
The method returns false by default, which means to evaluate the input cluster node as normal.
- Parameters
-
[in] | cluster | Cluster node to skip evaluation |
- Returns
- Whether to skip evaluation of the input cluster node
- Examples:
- evaluationPruningEvaluator/evaluationPruningEvaluator.cpp.
const char * className |
( |
| ) |
|
|
static |
Returns the name of this class.
- Returns
- Name of this class.
The documentation for this class was generated from the following files:
- MPxCustomEvaluator.h
- MPxCustomEvaluator.cpp