19
19
namespace executorch {
20
20
namespace extension {
21
21
22
+ using ET_RUNTIME_NAMESPACE::Method;
23
+ using ET_RUNTIME_NAMESPACE::MethodMeta;
24
+ using ET_RUNTIME_NAMESPACE::NamedDataMap;
25
+ using ET_RUNTIME_NAMESPACE::Program;
26
+
22
27
/* *
23
28
* A facade class for loading programs and executing methods within them.
24
29
*/
@@ -95,7 +100,7 @@ class Module {
95
100
* @param[in] data_map_loader A DataLoader used for loading external weights.
96
101
*/
97
102
explicit Module (
98
- std::shared_ptr<runtime:: Program> program,
103
+ std::shared_ptr<Program> program,
99
104
std::unique_ptr<runtime::MemoryAllocator> memory_allocator = nullptr ,
100
105
std::unique_ptr<runtime::MemoryAllocator> temp_allocator = nullptr ,
101
106
std::unique_ptr<runtime::EventTracer> event_tracer = nullptr ,
@@ -116,8 +121,8 @@ class Module {
116
121
*/
117
122
ET_NODISCARD
118
123
runtime::Error load (
119
- const runtime:: Program::Verification verification =
120
- runtime:: Program::Verification::Minimal);
124
+ const Program::Verification verification =
125
+ Program::Verification::Minimal);
121
126
122
127
/* *
123
128
* Checks if the program is loaded.
@@ -134,7 +139,7 @@ class Module {
134
139
*
135
140
* @returns Shared pointer to the program or nullptr if it's not yet loaded.
136
141
*/
137
- inline std::shared_ptr<runtime:: Program> program () const {
142
+ inline std::shared_ptr<Program> program () const {
138
143
return program_;
139
144
}
140
145
@@ -224,8 +229,7 @@ class Module {
224
229
* @returns A method metadata, or an error if the program or method failed to
225
230
* load.
226
231
*/
227
- runtime::Result<runtime::MethodMeta> method_meta (
228
- const std::string& method_name);
232
+ runtime::Result<MethodMeta> method_meta (const std::string& method_name);
229
233
230
234
/* *
231
235
* Execute a specific method with the given input values and retrieve the
@@ -473,20 +477,20 @@ class Module {
473
477
std::vector<runtime::Span<uint8_t >> planned_spans;
474
478
std::unique_ptr<runtime::HierarchicalAllocator> planned_memory;
475
479
std::unique_ptr<runtime::MemoryManager> memory_manager;
476
- std::unique_ptr<runtime:: Method> method;
480
+ std::unique_ptr<Method> method;
477
481
std::vector<runtime::EValue> inputs;
478
482
};
479
483
480
484
std::string file_path_;
481
485
std::string data_map_path_;
482
486
LoadMode load_mode_{LoadMode::MmapUseMlock};
483
- std::shared_ptr<runtime:: Program> program_;
487
+ std::shared_ptr<Program> program_;
484
488
std::unique_ptr<runtime::DataLoader> data_loader_;
485
489
std::unique_ptr<runtime::MemoryAllocator> memory_allocator_;
486
490
std::unique_ptr<runtime::MemoryAllocator> temp_allocator_;
487
491
std::unique_ptr<runtime::EventTracer> event_tracer_;
488
492
std::unique_ptr<runtime::DataLoader> data_map_loader_;
489
- std::unique_ptr<runtime:: NamedDataMap> data_map_;
493
+ std::unique_ptr<NamedDataMap> data_map_;
490
494
491
495
protected:
492
496
std::unordered_map<std::string, MethodHolder> methods_;
0 commit comments