From: Matt Corallo Date: Thu, 21 May 2026 06:24:40 +0000 (+0000) Subject: ggml : Check the right iface method before using the fallback 2d get (#23306) X-Git-Tag: upstream/0.0.10438~1171 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2754ce1b3e0ba3fd00bde22301bc42da40fdfea7;p=pkg%2Fggml%2Fsources%2Fllama.cpp ggml : Check the right iface method before using the fallback 2d get (#23306) Probably no backends implement only one of 2d get/set, but this might be annoying for some future backend developer trying to add 2d get/set. --- diff --git a/ggml/src/ggml-backend.cpp b/ggml/src/ggml-backend.cpp index 4e36909f4..5c0e5b1b9 100644 --- a/ggml/src/ggml-backend.cpp +++ b/ggml/src/ggml-backend.cpp @@ -379,7 +379,7 @@ void ggml_backend_tensor_get_2d(const struct ggml_tensor * tensor, void * data, ggml_backend_buffer_t buf = tensor->view_src ? tensor->view_src->buffer : tensor->buffer; GGML_ASSERT(buf != NULL && "tensor buffer not set"); - if (n_copies <= 1 || buf->iface.set_tensor_2d == NULL) { + if (n_copies <= 1 || buf->iface.get_tensor_2d == NULL) { for (size_t i = 0; i < n_copies; i++) { ggml_backend_tensor_get(tensor, (char *) data + i*stride_data, offset + i*stride_tensor, size); }