Skip to content

Commit 7347915

Browse files
committed
Update
[ghstack-poisoned]
2 parents f388177 + bb5d21c commit 7347915

File tree

5 files changed

+29
-62
lines changed

5 files changed

+29
-62
lines changed

backends/qualcomm/CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ add_library(qnn_executorch_logging STATIC)
126126
add_library(qnn_factory STATIC)
127127
add_library(qnn_function_interface INTERFACE)
128128
add_library(qnn_graph STATIC)
129-
add_library(qnn_header INTERFACE)
130129
add_library(qnn_implementation STATIC)
131130
add_library(qnn_logger STATIC)
132131
add_library(qnn_manager STATIC)
@@ -143,16 +142,12 @@ add_library(utils STATIC)
143142
# declare dependency
144143
#
145144
target_link_libraries(qcir_utils PRIVATE qcir)
146-
target_link_libraries(wrappers PRIVATE qnn_header qnn_executorch_logging)
147-
target_link_libraries(qnn_function_interface INTERFACE qnn_header)
145+
target_link_libraries(wrappers PRIVATE qnn_executorch_logging)
148146
target_link_libraries(
149-
qnn_implementation PRIVATE qnn_function_interface qnn_header
150-
qnn_executorch_logging ${CMAKE_DL_LIBS}
147+
qnn_implementation PRIVATE qnn_function_interface qnn_executorch_logging ${CMAKE_DL_LIBS}
151148
)
152-
target_link_libraries(qnn_sys_function_interface INTERFACE qnn_header)
153149
target_link_libraries(
154-
qnn_sys_implementation PRIVATE qnn_sys_function_interface qnn_header
155-
qnn_executorch_logging ${CMAKE_DL_LIBS}
150+
qnn_sys_implementation PRIVATE qnn_sys_function_interface qnn_executorch_logging ${CMAKE_DL_LIBS}
156151
)
157152
target_link_libraries(qnn_executorch_logging PRIVATE qnn_schema)
158153
target_link_libraries(qnn_profiler PRIVATE qnn_executorch_logging)
@@ -178,9 +173,7 @@ target_link_libraries(
178173
)
179174

180175
target_link_libraries(
181-
qnn_factory
182-
PUBLIC qnn_header
183-
PRIVATE qnn_schema qnn_backend qnn_device qnn_context qnn_graph
176+
qnn_factory PRIVATE qnn_schema qnn_backend qnn_device qnn_context qnn_graph
184177
qnn_mem_manager qnn_custom_protocol
185178
)
186179
target_link_libraries(

backends/qualcomm/runtime/backends/CMakeLists.txt

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -122,54 +122,3 @@ target_sources(
122122
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/QnnCustomProtocol.h
123123
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/QnnCustomProtocol.cpp
124124
)
125-
126-
set(qnn_header_basenames
127-
QnnBackend.h
128-
QnnCommon.h
129-
QnnContext.h
130-
QnnDevice.h
131-
GPU/QnnGpuBackend.h
132-
GPU/QnnGpuCommon.h
133-
GPU/QnnGpuContext.h
134-
GPU/QnnGpuGraph.h
135-
QnnGraph.h
136-
HTP/QnnHtpCommon.h
137-
HTP/QnnHtpDevice.h
138-
HTP/QnnHtpGraph.h
139-
HTP/QnnHtpMem.h
140-
HTP/QnnHtpPerfInfrastructure.h
141-
HTP/QnnHtpProfile.h
142-
HTP/QnnHtpProperty.h
143-
HTP/QnnHtpSystemContext.h
144-
QnnInterface.h
145-
QnnLog.h
146-
QnnMem.h
147-
QnnOpDef.h
148-
QnnOpPackage.h
149-
QnnProfile.h
150-
QnnProperty.h
151-
Saver/QnnSaver.h
152-
Saver/QnnSaverCommon.h
153-
QnnSdkBuildId.h
154-
QnnSignal.h
155-
QnnTensor.h
156-
QnnTypes.h
157-
System/QnnSystemCommon.h
158-
System/QnnSystemContext.h
159-
System/QnnSystemInterface.h
160-
)
161-
162-
set(QNN_HEADER_DIR_DST ${CMAKE_CURRENT_BINARY_DIR}/QNN/include)
163-
164-
# add the custom commands to copy each headers
165-
foreach(_qnn_header ${qnn_header_basenames})
166-
# copy at generation time to make below target_sources(qnn_header) happy.
167-
configure_file(
168-
${QNN_SDK_ROOT}/include/QNN/${_qnn_header}
169-
${QNN_HEADER_DIR_DST}/${_qnn_header} COPYONLY
170-
)
171-
list(APPEND qnn_header_files ${QNN_HEADER_DIR_DST}/${_qnn_header})
172-
endforeach()
173-
174-
# qnn_header
175-
target_sources(qnn_header INTERFACE ${qnn_header_files})

runtime/executor/program.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,13 @@ Result<const void*> Program::get_constant_buffer_data(
373373
}
374374
}
375375

376+
Result<const NamedDataMap*> Program::get_named_data_map() const {
377+
if (pte_data_map_.has_value()) {
378+
return &pte_data_map_.value();
379+
}
380+
return Error::NotFound;
381+
}
382+
376383
Result<const char*> Program::get_output_flattening_encoding(
377384
const char* method_name) const {
378385
auto plan = get_execution_plan(internal_program_, method_name);

runtime/executor/program.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ class Program final {
110110
Result<const void*> get_constant_buffer_data(size_t buffer_idx, size_t nbytes)
111111
const;
112112

113+
/**
114+
* Get the named data map from the program.
115+
* @return The named data map.
116+
*/
117+
Result<const NamedDataMap*> get_named_data_map() const;
118+
113119
/**
114120
* Returns the number of methods in the program.
115121
*/

runtime/executor/test/program_test.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,18 @@ TEST_F(ProgramTest, getMethods) {
371371
EXPECT_EQ(strcmp(res2.get(), "forward2"), 0);
372372
}
373373

374+
TEST_F(ProgramTest, GetNamedDataMap_Fail) {
375+
Result<Program> program =
376+
Program::load(add_loader_.get(), kDefaultVerification);
377+
ASSERT_EQ(program.error(), Error::Ok);
378+
379+
// Get the named data map. Expect to fail, as add.pte does not have any
380+
// named data segments.
381+
Result<const executorch::runtime::NamedDataMap*> named_data_map =
382+
program->get_named_data_map();
383+
EXPECT_EQ(named_data_map.error(), Error::NotFound);
384+
}
385+
374386
// Test that the deprecated Load method (capital 'L') still works.
375387
TEST_F(ProgramTest, DEPRECATEDLoad) {
376388
// Parse the Program from the data.

0 commit comments

Comments
 (0)