MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ml_test_device_configure

Function ml_test_device_configure

dpdk/app/test-mldev/test_common.c:129–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129int
130ml_test_device_configure(struct ml_test *test, struct ml_options *opt)
131{
132 struct test_common *t = ml_test_priv(test);
133 struct rte_ml_dev_config dev_config;
134 int ret;
135
136 ret = rte_ml_dev_info_get(opt->dev_id, &t->dev_info);
137 if (ret != 0) {
138 ml_err("Failed to get mldev info, dev_id = %d\n", opt->dev_id);
139 return ret;
140 }
141
142 /* configure device */
143 dev_config.socket_id = opt->socket_id;
144 dev_config.nb_models = t->dev_info.max_models;
145 dev_config.nb_queue_pairs = opt->queue_pairs;
146 ret = rte_ml_dev_configure(opt->dev_id, &dev_config);
147 if (ret != 0) {
148 ml_err("Failed to configure ml device, dev_id = %d\n", opt->dev_id);
149 return ret;
150 }
151
152 return 0;
153}
154
155int
156ml_test_device_close(struct ml_test *test, struct ml_options *opt)

Callers 3

ml_inference_mldev_setupFunction · 0.85
test_device_reconfigureFunction · 0.85

Calls 3

ml_test_privFunction · 0.85
rte_ml_dev_info_getFunction · 0.85
rte_ml_dev_configureFunction · 0.85

Tested by

no test coverage detected