Skip to content

Commit f5247de

Browse files
author
zhouwg
committed
ggml-qnn: Windows port --- step4
1 parent a792651 commit f5247de

File tree

9 files changed

+346
-395
lines changed

9 files changed

+346
-395
lines changed

common/console.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ namespace console {
241241
(void)codepoint;
242242
return 1;
243243
#else
244-
return wcwidth(codepoint);
244+
//return wcwidth(codepoint);
245+
(void)codepoint;
246+
return 1;
245247
#endif
246248
}
247249

ggml/src/ggml-qnn/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
66
set(QNN_DEFAULT_LIB_SEARCH_PATH "/data/local/tmp/" CACHE STRING "customized library search path for QNN backend")
77
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
88
set(QNN_DEFAULT_LIB_SEARCH_PATH "C:\\" CACHE STRING "customized library search path for QNN backend")
9+
elseif(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
10+
set(QNN_DEFAULT_LIB_SEARCH_PATH "/cygdrive/c/qairt/2.31.0.250130/" CACHE STRING "customized library search path for QNN backend")
911
else()
1012
message(FATAL_ERROR "QNN now only available on Android and Windows(Windows on ARM)")
1113
endif()

ggml/src/ggml-qnn/ggml-qnn-impl.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
#include "android/log.h"
6565
#endif
6666

67-
#if defined(_WIN32)
67+
#if !defined(__ANDROID__) && !defined(__linux__)
6868
#include <wchar.h>
69+
#include <malloc.h>
6970
#include <Windows.h>
7071
#endif
7172

@@ -141,7 +142,8 @@ void ggmlqnn_log_internal(ggml_log_level level, const char * file, const char
141142

142143
#define GQCGT ggmlqnn_create_general_tensor
143144

144-
#if defined(_WIN32)
145+
//#if defined(_WIN32)
146+
#if !defined(__ANDROID__) && !defined(__linux__)
145147
#define RTLD_GLOBAL 0x100
146148
#define RTLD_LOCAL 0x000
147149
#define RTLD_LAZY 0x000
@@ -188,7 +190,7 @@ enum qcom_chipset_soc_model {
188190
SM8550 = 43, // v73, SD 8 Gen 2
189191
SM8650 = 57, // v75, SD 8 Gen 3
190192
SM8750 = 69, // v79, SD 8 Gen 4
191-
#if defined(_MSC_VER)
193+
#if !defined(__ANDROID__) && !defined(__linux__)
192194
SC7280X = 44,
193195
SC8280X = 37,
194196
SC8380XP = 60,

ggml/src/ggml-qnn/ggml-qnn-ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void ggml_qnn_general_node(ggml_backend_qnn_context * ctx, ggml_tensor * op) {
124124
*p_tensor2
125125
};
126126
Qnn_OpConfig_t op_config = {
127-
QNN_OPCONFIG_VERSION_1, .v1 = {
127+
QNN_OPCONFIG_VERSION_1, {
128128
ggml_op_name,
129129
QNN_OP_PACKAGE_NAME_QTI_AISW,
130130
qnn_op_name,

0 commit comments

Comments
 (0)