1010
1111#include < executorch/runtime/core/memory_allocator.h>
1212#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
1318
1419namespace executorch {
15- namespace bundled_program {
20+ namespace BUNDLED_PROGRAM_NAMESPACE {
1621
1722/* *
1823 * An opaque pointer to a serialized bundled program.
@@ -94,7 +99,7 @@ ET_DEPRECATED inline bool is_bundled_program(void* file_data) {
9499 return is_bundled_program (file_data, 128 );
95100}
96101
97- } // namespace bundled_program
102+ } // namespace BUNDLED_PROGRAM_NAMESPACE
98103} // namespace executorch
99104
100105namespace torch {
@@ -103,13 +108,13 @@ namespace bundled_program {
103108// TODO(T197294990): Remove these deprecated aliases once all users have moved
104109// to the new `::executorch` namespaces.
105110using serialized_bundled_program =
106- ::executorch::bundled_program ::SerializedBundledProgram;
111+ ::executorch::BUNDLED_PROGRAM_NAMESPACE ::SerializedBundledProgram;
107112
108113ET_NODISCARD inline ::executorch::runtime::Error LoadBundledInput (
109114 Method& method,
110115 serialized_bundled_program* bundled_program_ptr,
111116 size_t testset_idx) {
112- return ::executorch::bundled_program ::load_bundled_input (
117+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::load_bundled_input (
113118 method, bundled_program_ptr, testset_idx);
114119}
115120
@@ -120,7 +125,7 @@ VerifyResultWithBundledExpectedOutput(
120125 size_t testset_idx,
121126 double rtol = 1e-5 ,
122127 double atol = 1e-8 ) {
123- return ::executorch::bundled_program ::verify_method_outputs (
128+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::verify_method_outputs (
124129 method, bundled_program_ptr, testset_idx, rtol, atol);
125130}
126131
@@ -129,13 +134,14 @@ ET_NODISCARD inline ::executorch::runtime::Error GetProgramData(
129134 size_t file_data_len,
130135 const void ** out_program_data,
131136 size_t * out_program_data_len) {
132- return ::executorch::bundled_program ::get_program_data (
137+ return ::executorch::BUNDLED_PROGRAM_NAMESPACE ::get_program_data (
133138 file_data, file_data_len, out_program_data, out_program_data_len);
134139}
135140
136141inline bool IsBundledProgram (void * file_data) {
137142 // 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 );
139145}
140146} // namespace bundled_program
141147} // namespace executor
0 commit comments