ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::compiler::ManualSchedulerOptions Struct Reference

#include <CompilerOptions.h>

Public Member Functions

void setBackendMap (const std::string &str)
 

Data Fields

std::string backend_for_all
 
std::unordered_map< ir::OpCode, std::string > opcode_to_backend
 
std::unordered_map< ir::OperationIndex, std::string > index_to_backend
 

Detailed Description

Definition at line 33 of file CompilerOptions.h.

Member Function Documentation

◆ setBackendMap()

void onert::compiler::ManualSchedulerOptions::setBackendMap ( const std::string &  str)

Definition at line 55 of file CompilerOptions.cc.

56{
57 // TODO Support multiple subgraphs for manual scheduling
58 auto key_val_list = nnfw::misc::split(str, ';');
59 for (const auto &key_val_str : key_val_list)
60 {
61 if (key_val_str.empty())
62 {
63 continue;
64 }
65
66 auto key_val = nnfw::misc::split(key_val_str, '=');
67 if (key_val.size() != 2)
68 throw std::runtime_error{"Invalid key-value pair"};
69
70 const auto &key_str = key_val.at(0);
71 const auto &val = key_val.at(1);
72 auto key = static_cast<uint32_t>(std::stoi(key_str));
73 this->index_to_backend.emplace(ir::OperationIndex{key}, val);
74 }
75}
std::vector< std::string > split(const std::string &s, char delim)
std::unordered_map< ir::OperationIndex, std::string > index_to_backend

References index_to_backend, and nnfw::misc::split().

Field Documentation

◆ backend_for_all

std::string onert::compiler::ManualSchedulerOptions::backend_for_all

Definition at line 37 of file CompilerOptions.h.

Referenced by onert::compiler::CompilerOptions::verboseOptions().

◆ index_to_backend

std::unordered_map<ir::OperationIndex, std::string> onert::compiler::ManualSchedulerOptions::index_to_backend

Definition at line 39 of file CompilerOptions.h.

Referenced by setBackendMap().

◆ opcode_to_backend

std::unordered_map<ir::OpCode, std::string> onert::compiler::ManualSchedulerOptions::opcode_to_backend

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