Fixed a bug where debug code was included in the release, resulting i… (#1)
* Fixed a bug where debug code was included in the release, resulting in an undefined function error. * Change the path of the QNN library when building in termux environment * Revert "Change the path of the QNN library when building in termux environment" This reverts commit c6e26a3679da2608940e2163e090adf75d667400. * Changed so that GGML_QNN_DEFAULT_LIB_SEARCH_PATH can be set from command line arguments
This commit is contained in:
parent
5ea980d92e
commit
dedadf2a20
2 changed files with 9 additions and 2 deletions
|
@ -885,12 +885,13 @@ if (GGML_QNN)
|
|||
find_library(LOG_LIB log)
|
||||
find_library(ANDROID_LIB android)
|
||||
set(GGML_EXTRA_LIBS ${GGML_EXTRA_LIBS} ${LOG_LIB} ${ANDROID_LIB})
|
||||
set(GGML_QNN_DEFAULT_LIB_SEARCH_PATH "\"/data/local/tmp/\"")
|
||||
set(GGML_QNN_DEFAULT_LIB_SEARCH_PATH "/data/local/tmp/" CACHE STRING "customized library search path for QNN backend")
|
||||
else()
|
||||
message(FATAL_ERROR "QNN now only available on Android")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(GGML_QNN_DEFAULT_LIB_SEARCH_PATH=${GGML_QNN_DEFAULT_LIB_SEARCH_PATH})
|
||||
string(REGEX REPLACE "/$" "" GGML_QNN_DEFAULT_LIB_SEARCH_PATH "${GGML_QNN_DEFAULT_LIB_SEARCH_PATH}")
|
||||
add_compile_definitions(GGML_QNN_DEFAULT_LIB_SEARCH_PATH="${GGML_QNN_DEFAULT_LIB_SEARCH_PATH}/")
|
||||
if (NOT DEFINED GGML_QNN_SDK_PATH)
|
||||
# try read from environment variable
|
||||
if (DEFINED ENV{QNN_SDK_PATH})
|
||||
|
|
|
@ -296,11 +296,13 @@ bool qnn_binary_op_impl(ggml_backend_qnn_context *ctx, ggml_tensor *src0, ggml_t
|
|||
succeed = execute_graph<2, 1>(graph_ptr, { src0, src1 }, { dst });
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (!succeed) {
|
||||
print_ggml_tensor(src0);
|
||||
print_ggml_tensor(src1);
|
||||
print_ggml_tensor(dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
return succeed;
|
||||
}
|
||||
|
@ -317,10 +319,12 @@ bool qnn_unary_op_impl(ggml_backend_qnn_context *ctx, ggml_tensor *src, ggml_ten
|
|||
succeed = execute_graph<1, 1>(graph_ptr, { src }, { dst });
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (!succeed) {
|
||||
print_ggml_tensor(src);
|
||||
print_ggml_tensor(dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
return succeed;
|
||||
}
|
||||
|
@ -541,10 +545,12 @@ bool ggml_qnn_supports_op(const ggml_tensor *op) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (op->op == GGML_OP_ADD && !is_tensor_dimensions_equal(op->src[0], op->src[1])) {
|
||||
QNN_LOG_DEBUG("src0 and src1 dimensions are not equal");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (op->type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue