10
10
11
11
#include < executorch/runtime/core/memory_allocator.h>
12
12
#include < executorch/runtime/executor/method.h>
13
+ #ifdef USE_ATEN_LIB
14
+ #define BUNDLED_PROGRAM_NAMESPACE bundled_program::aten
15
+ #else // !USE_ATEN_LIB
16
+ #define BUNDLED_PROGRAM_NAMESPACE bundled_program
17
+ #endif // USE_ATEN_LIB
13
18
14
19
namespace executorch {
15
- namespace bundled_program {
20
+ namespace BUNDLED_PROGRAM_NAMESPACE {
16
21
17
22
/* *
18
23
* An opaque pointer to a serialized bundled program.
@@ -94,7 +99,7 @@ ET_DEPRECATED inline bool is_bundled_program(void* file_data) {
94
99
return is_bundled_program (file_data, 128 );
95
100
}
96
101
97
- } // namespace bundled_program
102
+ } // namespace BUNDLED_PROGRAM_NAMESPACE
98
103
} // namespace executorch
99
104
100
105
namespace torch {
@@ -103,13 +108,13 @@ namespace bundled_program {
103
108
// TODO(T197294990): Remove these deprecated aliases once all users have moved
104
109
// to the new `::executorch` namespaces.
105
110
using serialized_bundled_program =
106
- ::executorch::bundled_program ::SerializedBundledProgram;
111
+ ::executorch::BUNDLED_PROGRAM_NAMESPACE ::SerializedBundledProgram;
107
112
108
113
ET_NODISCARD inline ::executorch::runtime::Error LoadBundledInput (
109
114
Method& method,
110
115
serialized_bundled_program* bundled_program_ptr,
111
116
size_t testset_idx) {
112
- return ::executorch::bundled_program ::load_bundled_input (
117
+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::load_bundled_input (
113
118
method, bundled_program_ptr, testset_idx);
114
119
}
115
120
@@ -120,7 +125,7 @@ VerifyResultWithBundledExpectedOutput(
120
125
size_t testset_idx,
121
126
double rtol = 1e-5 ,
122
127
double atol = 1e-8 ) {
123
- return ::executorch::bundled_program ::verify_method_outputs (
128
+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::verify_method_outputs (
124
129
method, bundled_program_ptr, testset_idx, rtol, atol );
125
130
}
126
131
@@ -129,13 +134,14 @@ ET_NODISCARD inline ::executorch::runtime::Error GetProgramData(
129
134
size_t file_data_len,
130
135
const void ** out_program_data,
131
136
size_t * out_program_data_len) {
132
- return ::executorch::bundled_program ::get_program_data (
137
+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::get_program_data (
133
138
file_data, file_data_len, out_program_data, out_program_data_len);
134
139
}
135
140
136
141
inline bool IsBundledProgram (void * file_data) {
137
142
// 128 is enough data to contain the identifier in the flatbuffer header.
138
- return ::executorch::bundled_program::is_bundled_program (file_data, 128 );
143
+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE::is_bundled_program (
144
+ file_data, 128 );
139
145
}
140
146
} // namespace bundled_program
141
147
} // namespace executor
0 commit comments