Skip to content

Commit

Permalink
follow the principle of project and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou.weiguo committed Apr 25, 2024
1 parent f9e1b9a commit 7a420e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
15 changes: 5 additions & 10 deletions ggml-qnn.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* MIT license
* Copyright (C) 2024 GGML Authors
* SPDX-License-Identifier: MIT
*
* this is implementation of ggml QNN(Qualcomm Neural Network, aka AI Engine Direct) backend
*
* status:
Expand Down Expand Up @@ -959,7 +955,7 @@ static int free_qnn_tensor(Qnn_Tensor_t & tensor) {
QNN_LOG_INFO("it should not happen, pls check");
} else {
//TODO:why crash in here? why pointer changed with mul_mat?
//memory leak after comment above line
//memory leak after comment below line
//free(QNN_TENSOR_GET_DIMENSIONS(tensor));
}

Expand Down Expand Up @@ -1464,7 +1460,7 @@ static void ggml_qnn_log_internal(ggml_log_level level, const char * file, const
#if (defined __ANDROID__) || (defined ANDROID)
__android_log_print(level, "llamacpp", "%s", s_ggml_qnn_log_internal_buf);
#else
printf("%s", buffer); //Qualcomm's QNN could running on Window over ARM
printf("%s", buffer); //Qualcomm's QNN could running on Windows over ARM(aka WoA)
#endif
}
va_end(args);
Expand Down Expand Up @@ -2108,11 +2104,11 @@ int qnn_instance::load_system() {

_system_lib_handle = dlopen(system_lib_path.c_str(), RTLD_NOW | RTLD_LOCAL);
if (nullptr == _system_lib_handle) {
QNN_LOG_WARN("can not pen QNN library %s, error: %s\n", system_lib_path.c_str(), dlerror());
QNN_LOG_WARN("can not open QNN library %s, error: %s\n", system_lib_path.c_str(), dlerror());
return 1;
}

auto *get_providers = reinterpret_cast<_pfn_QnnSystemInterface_getProviders *>(dlsym(
auto * get_providers = reinterpret_cast<_pfn_QnnSystemInterface_getProviders *>(dlsym(
_system_lib_handle, "QnnSystemInterface_getProviders"));
if (nullptr == get_providers) {
QNN_LOG_WARN("can not load QNN symbol QnnSystemInterface_getProviders: %s\n", dlerror());
Expand Down Expand Up @@ -3605,7 +3601,6 @@ bool ggml_qnn_compute_forward(struct ggml_compute_params * params, struct ggml_t
}


//ok, real show time in Qualcomm's QNN internal
if (nullptr != func)
func(tensor->src[0], tensor->src[1], tensor);
if (nullptr != func_common)
Expand Down Expand Up @@ -3845,7 +3840,7 @@ static size_t ggml_backend_qnn_buffer_type_get_alignment(ggml_backend_buffer_typ
static size_t ggml_backend_qnn_buffer_type_get_max_size(ggml_backend_buffer_type_t buft) {
GGML_UNUSED(buft);

return (38 * 1024 * 1024);
return (96 * 1024 * 1024);
}


Expand Down
4 changes: 0 additions & 4 deletions ggml-qnn.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* MIT license
* Copyright (C) 2024 GGML Authors
* SPDX-License-Identifier: MIT
*
* this is implementation of ggml QNN(Qualcomm Nerual Network, aka AI Engine Direct) backend
*/
#pragma once
Expand Down

0 comments on commit 7a420e1

Please sign in to comment.