Execute operations with grammar rule pre-processing.
Applies grammar rules to the input data before any matrix operations. This allows for intelligent preprocessing, operation selection, and parameter configuration based on the input characteristics and context.
484 {})
485 {
486 static_assert(sizeof(Datum<InputType>) > 0, "Datum incomplete");
487 Datum<InputType> current = input;
488
489 if (
auto best_rule =
m_grammar->find_best_match(current, context)) {
490 if (
auto rule_result =
m_grammar->execute_rule(best_rule->name, current, context)) {
491 auto cast_result = safe_any_cast<Datum<InputType>>(*rule_result);
492 if (cast_result) {
493 current = *cast_result.value;
494 } else {
498 "Grammar rule '{}' returned incompatible type: {}",
499 best_rule->name,
500 cast_result.error);
501 }
502 }
503 }
504
505 return current;
506 }
#define MF_WARN(comp, ctx,...)
std::shared_ptr< ComputationGrammar > m_grammar
Grammar instance for rule-based operation selection.
@ Runtime
General runtime operations (default fallback)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.