From 6bae0b55d084a12d488f617ef178de3940e5f4ef Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Fri, 27 Feb 2026 12:06:48 +0100 Subject: [PATCH] gallium: add pipe_context::ml_subgraph_deserialize() Add ml_subgraph_deserialize() to pipe_context for reconstructing a previously-serialized ML subgraph at runtime. This complements ml_subgraph_serialize() on pipe_ml_device and allows the runtime to load pre-compiled subgraphs. Part-of: --- src/gallium/include/pipe/p_context.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index f706ce49467..51bb420ea8a 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -1276,6 +1276,18 @@ struct pipe_context { struct pipe_ml_subgraph *subgraph, unsigned outputs_count, unsigned output_idxs[], void *outputs[], bool is_signed[]); + + /** + * Deserialize a previously-serialized ML subgraph. + * + * \param context pipe context + * \param data serialized subgraph data + * \param size size of the serialized data in bytes + * \return a newly allocated pipe_ml_subgraph, or NULL on failure + */ + struct pipe_ml_subgraph *(*ml_subgraph_deserialize)(struct pipe_context *context, + const uint8_t *data, + size_t size); };