| 469 | public: |
| 470 | template <class PropagatorStateType> |
| 471 | static ExecutorState<PropagatorStateType>* Create( |
| 472 | const Executor::Args& args, ExecutorImpl* impl) { |
| 473 | ImmutableExecutorState& immutable_state = impl->GetImmutableState(); |
| 474 | ExecutorInternal::KernelStats* kernel_stats = impl->GetKernelStat(); |
| 475 | |
| 476 | // InlineExecuteState |
| 477 | if (args.executor_policy == ExecutorPolicy::USE_INLINE_EXECUTOR) { |
| 478 | return new InlineExecutorState<PropagatorStateType>( |
| 479 | args, immutable_state, kernel_stats); |
| 480 | } else if (args.cost_runner && |
| 481 | args.executor_policy == ExecutorPolicy::USE_COST_MODEL_EXECUTOR) { |
| 482 | // TODO: FIXME consider function lib executor, set cost_runner for it? |
| 483 | // Schedule by cost model |
| 484 | ExecutorInternal::ExecuteCostModel* cm = impl->TryToBuildCostModel(); |
| 485 | return new CostExecutorState<PropagatorStateType>( |
| 486 | args, immutable_state, kernel_stats, cm); |
| 487 | } else { |
| 488 | // normal schedule |
| 489 | return new ExecutorState<PropagatorStateType>( |
| 490 | args, immutable_state, kernel_stats); |
| 491 | } |
| 492 | } |
| 493 | }; |
| 494 | |
| 495 | // Sort node according cost from which ExecutorState |
nothing calls this directly
no test coverage detected