ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 31 of file CompilerOptions.h.

Member Function Documentation

◆ setBackendMap()

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

Definition at line 53 of file CompilerOptions.cc.

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