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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40578>
This commit is contained in:
Tomeu Vizoso 2026-02-27 12:06:48 +01:00
parent aff92add98
commit 6bae0b55d0

View file

@ -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);
};