Skip to content

Commit 3a38081

Browse files
author
zhouwg
committed
ggml-hexagon: fix a typo in ggml-hexagon.cpp
1 parent 889bf86 commit 3a38081

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,13 +5086,15 @@ static bool ggmlhexagon_can_handle_op_through_cdsp(ggml_backend_dev_t dev, const
50865086
case GGML_OP_MUL_MAT:
50875087
{
50885088
ggmlhexagon_dump_op_info(op_tensor);
5089-
if (1 == g_hexagon_appcfg.enable_q_mulmat)
5089+
if (1 == g_hexagon_appcfg.enable_q_mulmat) {
50905090
return (src0->type == GGML_TYPE_F32
50915091
|| src0->type == GGML_TYPE_Q4_0 || src0->type == GGML_TYPE_Q8_0
50925092
|| src0->type == GGML_TYPE_Q6_K || src0->type == GGML_TYPE_Q8_K
50935093
) && (src1->type == GGML_TYPE_F32) && (op_tensor->type == GGML_TYPE_F32);
5094-
else
5095-
return (src0->type == GGML_TYPE_F32) && (src1->type == GGML_TYPE_F32) && (op_tensor->type == GGML_TYPE_F32);
5094+
} else {
5095+
return (src0->type == GGML_TYPE_F32) && (src1->type == GGML_TYPE_F32) &&
5096+
(op_tensor->type == GGML_TYPE_F32);
5097+
}
50965098
}
50975099
case GGML_OP_SOFT_MAX:{
50985100
if (!ggml_is_contiguous(op_tensor))
@@ -5124,13 +5126,9 @@ static bool ggmlhexagon_can_handle_op_through_qnn(ggml_backend_dev_t dev, const
51245126

51255127
struct ggml_tensor * src0 = op_tensor->src[0];
51265128
struct ggml_tensor * src1 = op_tensor->src[1];
5127-
int64_t ne00 = 0;
5128-
uint32_t src0_rank = 0;
5129-
uint32_t src1_rank = 0;
5130-
if (nullptr != src0) {
5131-
src0_rank = ggml_n_dims(src0);
5132-
ne00 = src0->ne[0];
5133-
}
5129+
const int64_t ne00 = src0->ne[0];;
5130+
const int src0_rank = ggml_n_dims(src0);
5131+
int src1_rank = 0;
51345132
if (nullptr != src1) {
51355133
src1_rank = ggml_n_dims(src1);
51365134
}
@@ -6023,7 +6021,7 @@ const char * ggml_backend_hexagon_get_devname(size_t dev_num) {
60236021
case HEXAGON_BACKEND_QNNNPU:
60246022
return "HEXAGON_BACKEND_QNN_NPU";
60256023
case HEXAGON_BACKEND_GGML:
6026-
return "ggml"; //"fake" QNN backend, used for compare performance between hexagon backend and the default ggml backend
6024+
return "ggml"; //"fake" hexagon backend, used for compare performance between hexagon backend and the default ggml backend
60276025
default:
60286026
return "unknown";
60296027
}

ggml/src/ggml-hexagon/kernels/ggml-dsp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ extern "C" {
5050
#define GGML_FP32_TO_FP16(x) GGML_COMPUTE_FP32_TO_FP16(x)
5151
#define GGML_FP16_TO_FP32(x) ggml_lookup_fp16_to_fp32(x)
5252

53-
#ifdef NDEBUG
53+
//NPU performance will be slower when enable GGMLHEXAGON_DEBUG
54+
#if 1//def NDEBUG
5455
#define GGMLHEXAGON_DEBUG 0
5556
#else
5657
#define GGMLHEXAGON_DEBUG 1

scripts/build-run-android.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ QNN_SDK_INSTALL_PATH=/opt/qcom/aistack/qairt/
1818
QNN_SDK_VERSION=2.32.0.250228
1919
QNN_SDK_PATH=${QNN_SDK_INSTALL_PATH}/${QNN_SDK_VERSION}
2020

21+
#5.5.3.0 should be also ok because someone told me can't find 6.2.0.1 on 04/05/2025
2122
HEXAGON_SDK_PATH=/opt/qcom/Hexagon_SDK/6.2.0.1
2223
#available htp arch version:
2324
#v68 --- Snapdragon 888

0 commit comments

Comments
 (0)