fix: check all dimentions in can offload
This commit is contained in:
parent
b1b5cc10b1
commit
1679dcf47e
2 changed files with 12 additions and 1 deletions
|
@ -359,7 +359,16 @@ GGML_CALL static bool ggml_backend_qnn_supports_op(ggml_backend_t backend, const
|
|||
GGML_CALL static bool ggml_backend_qnn_offload_op(ggml_backend_t backend, const ggml_tensor *op) {
|
||||
GGML_UNUSED(backend);
|
||||
|
||||
return op->ne[0] > 1 && op->ne[1] > 1;
|
||||
size_t dims = ggml_n_dims(op);
|
||||
bool can_offload = false;
|
||||
for (size_t i = 0; i < dims; i++) {
|
||||
if (op->ne[i] > 1) {
|
||||
can_offload = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return can_offload;
|
||||
}
|
||||
|
||||
static ggml_backend_i ggml_backend_qnn_interface = {
|
||||
|
|
|
@ -153,6 +153,8 @@ const char *opname_from_ggmlop(enum ggml_op ggmlop) {
|
|||
}
|
||||
|
||||
const char *get_qnn_error_string(Qnn_ErrorHandle_t error) {
|
||||
// A complete list of error codes can be found at here:
|
||||
// https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/api_error_codes.html
|
||||
switch (error) {
|
||||
case QNN_SUCCESS:
|
||||
return "QNN_SUCCESS";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue