ggml-zdnn: switch to std vector instead of array

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
Aaron Teo
2025-07-24 01:09:01 +08:00
parent b7f4b6fde3
commit 63fbc45ed6

View File

@@ -119,7 +119,7 @@ struct ggml_backend_zdnn_buffer_context {
bool owned; bool owned;
int n_buffers; int n_buffers;
struct ggml_backend_zdnn_buffer buffers[64]; std::vector<struct ggml_backend_zdnn_buffer> buffers;
}; };
// finds the zTensor that contains the tensor data // finds the zTensor that contains the tensor data
@@ -247,11 +247,6 @@ static enum ggml_status ggml_backend_zdnn_buffer_init_tensor(ggml_backend_buffer
// Create a dedicated buffer entry for this tensor // Create a dedicated buffer entry for this tensor
const int64_t tsize = ggml_nbytes(tensor); const int64_t tsize = ggml_nbytes(tensor);
if (ctx->n_buffers >= 64) {
GGML_LOG_ERROR("%s: too many tensors, maximum 64 supported\n", __func__);
return GGML_STATUS_FAILED;
}
int buffer_idx = ctx->n_buffers; int buffer_idx = ctx->n_buffers;
// Initialize the buffer entry for this specific tensor // Initialize the buffer entry for this specific tensor