| 418 | }; |
| 419 | |
| 420 | Status CheckOptions(KernelContext* ctx) { |
| 421 | if (ctx->state() == nullptr) { |
| 422 | return Status::Invalid("Mode requires ModeOptions"); |
| 423 | } |
| 424 | const ModeOptions& options = ModeState::Get(ctx); |
| 425 | if (options.n <= 0) { |
| 426 | return Status::Invalid("ModeOptions::n must be strictly positive"); |
| 427 | } |
| 428 | return Status::OK(); |
| 429 | } |
| 430 | |
| 431 | template <typename OutTypeUnused, typename InType> |
| 432 | struct ModeExecutor { |