xref: /dpdk/app/test-mldev/test_model_common.h (revision 24364292061f197a9f608b1020b6886ec7b1216d)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2022 Marvell.
3  */
4 
5 #ifndef TEST_MODEL_COMMON_H
6 #define TEST_MODEL_COMMON_H
7 
8 #include <rte_mldev.h>
9 
10 #include "test_common.h"
11 
12 enum model_state {
13 	MODEL_INITIAL,
14 	MODEL_LOADED,
15 	MODEL_STARTED,
16 	MODEL_ERROR,
17 };
18 
19 struct ml_model {
20 	uint16_t id;
21 	struct rte_ml_model_info info;
22 	enum model_state state;
23 
24 	uint64_t inp_dsize;
25 	uint64_t inp_qsize;
26 	uint64_t out_dsize;
27 	uint64_t out_qsize;
28 
29 	uint8_t *input;
30 	uint8_t *output;
31 	uint8_t *reference;
32 
33 	struct rte_mempool *io_pool;
34 };
35 
36 int ml_model_load(struct ml_test *test, struct ml_options *opt, struct ml_model *model,
37 		  uint16_t fid);
38 int ml_model_unload(struct ml_test *test, struct ml_options *opt, struct ml_model *model,
39 		    uint16_t fid);
40 int ml_model_start(struct ml_test *test, struct ml_options *opt, struct ml_model *model,
41 		   uint16_t fid);
42 int ml_model_stop(struct ml_test *test, struct ml_options *opt, struct ml_model *model,
43 		  uint16_t fid);
44 
45 #endif /* TEST_MODEL_COMMON_H */
46