Skip to content

Commit 02af8ff

Browse files
committed
fix qnn only build flag
1 parent 0ce53ce commit 02af8ff

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

ggml/src/ggml-qnn/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ add_subdirectory(shared)
4848

4949
if(GGML_HEXAGON_NPU_ONLY)
5050
message("GGML_HEXAGON_NPU_ONLY is enabled")
51-
add_compile_definitions(GGML_HEXAGON_NPU_ONLY)
5251
set(GGML_QNN_ENABLE_HEXAGON_BACKEND ON)
5352
else()
5453
message("GGML_HEXAGON_NPU_ONLY is disabled")

ggml/src/ggml-qnn/qnn/qnn-lib.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -323,30 +323,6 @@ bool qnn_instance::qnn_init(const QnnSaver_Config_t ** saver_config) {
323323
}
324324
}
325325

326-
{
327-
auto & op_package_info = get_op_package_lib_info(_soc_info.soc_model, _soc_info.htp_arch);
328-
if (op_package_info.extra_lib_name) {
329-
_custom_op_extra_lib_handle =
330-
load_lib_with_fallback(op_package_info.extra_lib_name, _additional_lib_load_path);
331-
}
332-
333-
qnn_status = _qnn_interface->qnn_backend_register_op_package(_qnn_backend_handle, op_package_info.lib_name,
334-
op_package_info.interface, op_package_info.type);
335-
if (qnn_status != QNN_SUCCESS) {
336-
QNN_LOG_WARN("failed to register op package %s, interface: %s, error: %s\n", op_package_info.lib_name,
337-
op_package_info.interface, qnn::get_qnn_error_string(qnn_status));
338-
} else {
339-
QNN_LOG_DEBUG("register op package %s successfully, ID %u\n", op_package_info.lib_name,
340-
_qnn_interface->get_backend_id());
341-
_has_custom_op_package = true;
342-
}
343-
}
344-
345-
/* TODO: not used, keep it for further usage
346-
QnnContext_Config_t qnn_context_config = QNN_CONTEXT_CONFIG_INIT;
347-
qnn_context_config.priority = QNN_PRIORITY_DEFAULT;
348-
const QnnContext_Config_t * context_configs[] = {&qnn_context_config, nullptr};
349-
*/
350326
_qnn_interface->qnn_context_create(_qnn_backend_handle, _qnn_device_handle, nullptr, &_qnn_context_handle);
351327
if (!_qnn_context_handle) {
352328
QNN_LOG_WARN("failed to initialize qnn context\n");

ggml/src/ggml-qnn/shared/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ target_include_directories(runtime-common PUBLIC
1212
${CMAKE_CURRENT_LIST_DIR}/../../../include/ # TODO: figure out how to remove this
1313
)
1414

15+
if(GGML_HEXAGON_NPU_ONLY)
16+
add_compile_definitions(GGML_HEXAGON_NPU_ONLY)
17+
endif()
18+
1519
if(GGML_QNN_ENABLE_HEXAGON_BACKEND)
1620
if(DEFINED ENV{QNN_SDK_PATH})
1721
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})

0 commit comments

Comments
 (0)