Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ggml/src/ggml-hexagon/ggml-hexagon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,18 @@ static bool ggml_hexagon_supported_ssm_conv(const struct ggml_hexagon_session *
return true;
}

static bool ggml_hexagon_supported_pad(const struct ggml_hexagon_session * sess, const struct ggml_tensor * op) {
const struct ggml_tensor * src0 = op->src[0];
const struct ggml_tensor * dst = op;

if (src0->type != GGML_TYPE_F32 || dst->type != GGML_TYPE_F32) {
return false;
}

GGML_UNUSED(sess);
return true;
}

static bool ggml_hexagon_supported_cumsum(const struct ggml_hexagon_session * sess, const struct ggml_tensor * op) {
const struct ggml_tensor * src0 = op->src[0];
const struct ggml_tensor * dst = op;
Expand Down Expand Up @@ -2803,6 +2815,8 @@ static htp_op_code op_remap_to_htp(const ggml_tensor * t) {
case GGML_OP_FILL: return HTP_OP_FILL;
case GGML_OP_DIAG: return HTP_OP_DIAG;
case GGML_OP_SOLVE_TRI: return HTP_OP_SOLVE_TRI;
case GGML_OP_PAD: return HTP_OP_PAD;

case GGML_OP_UNARY:
switch (ggml_get_unary_op(t)) {
case GGML_UNARY_OP_SILU: return HTP_OP_UNARY_SILU;
Expand Down Expand Up @@ -3351,6 +3365,10 @@ static bool ggml_backend_hexagon_device_supports_op(ggml_backend_dev_t dev, cons
case GGML_OP_SOLVE_TRI:
supp = ggml_hexagon_supported_solve_tri(sess, op);
break;

case GGML_OP_PAD:
supp = ggml_hexagon_supported_pad(sess, op);
break;

default:
break;
Expand Down
1 change: 1 addition & 0 deletions ggml/src/ggml-hexagon/htp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ add_library(${HTP_LIB} SHARED
fill-ops.c
diag-ops.c
solve-tri-ops.c
pad-ops.c
)

target_compile_definitions(${HTP_LIB} PRIVATE
Expand Down
1 change: 1 addition & 0 deletions ggml/src/ggml-hexagon/htp/htp-ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ int op_cumsum(struct htp_ops_context * octx);
int op_fill(struct htp_ops_context * octx);
int op_diag(struct htp_ops_context * octx);
int op_solve_tri(struct htp_ops_context * octx);
int op_pad(struct htp_ops_context * octx);

#endif /* HTP_CTX_H */
2 changes: 2 additions & 0 deletions ggml/src/ggml-hexagon/htp/htp-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ enum htp_op_code {
HTP_OP_FILL,
HTP_OP_DIAG,
HTP_OP_SOLVE_TRI,
HTP_OP_PAD,

HTP_OP_INVALID
};

Expand Down
3 changes: 3 additions & 0 deletions ggml/src/ggml-hexagon/htp/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ static int execute_op(struct htp_ops_context * octx) {

case HTP_OP_SOLVE_TRI:
return op_solve_tri(octx);

case HTP_OP_PAD:
return op_pad(octx);

case HTP_OP_INVALID:
break;
Expand Down
Loading