ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert_micro::optimize::OMOptimizer Struct Reference

#include <OMOptimizer.h>

Static Public Member Functions

static OMStatus optimize (core::OMRuntimeStorage &storage, core::OMRuntimeContext &context, const OMConfig &configs)
 

Detailed Description

Definition at line 30 of file OMOptimizer.h.

Member Function Documentation

◆ optimize()

OMStatus OMOptimizer::optimize ( core::OMRuntimeStorage storage,
core::OMRuntimeContext context,
const OMConfig configs 
)
static

Definition at line 26 of file OMOptimizer.cpp.

28{
29 OMGraphStatus graph_status = {Unchanged, Ok};
30
31 const uint32_t number_of_passes = optimize_passes.getPassNumber();
32
33 do
34 {
35 for (uint32_t i = 0; i < number_of_passes; ++i)
36 {
37 OptimizePassFunc *cur_pass_func;
38 OMStatus status = optimize_passes.getOptimizeFunc(i, &cur_pass_func);
39 assert(status == Ok && "Unsupported pass");
40 if (status != Ok)
41 return status;
42
43 graph_status = cur_pass_func(storage, context, configs);
44 assert(graph_status.main_status == Ok);
45 if (graph_status.main_status != Ok)
46 return graph_status.main_status;
47 }
48 } while (graph_status.graph_status == Changed);
49
50 return Ok;
51}
OMStatus getOptimizeFunc(uint32_t idx, OptimizePassFunc **optimize_func) const
OMGraphStatus(core::OMRuntimeStorage &storage, core::OMRuntimeContext &context, const OMConfig &configs) OptimizePassFunc
constexpr OptimizePassRegistry optimize_passes
OMGraphOptimizationStatus graph_status

References onert_micro::optimize::Changed, onert_micro::optimize::OptimizePassRegistry::getOptimizeFunc(), onert_micro::optimize::OptimizePassRegistry::getPassNumber(), onert_micro::optimize::OMGraphStatus::graph_status, onert_micro::optimize::OMGraphStatus::main_status, onert_micro::Ok, onert_micro::optimize::optimize_passes, and onert_micro::optimize::Unchanged.

Referenced by onert_micro::core::OMRuntimeModule::importModel().


The documentation for this struct was generated from the following files: