API Reference Manual  1.45.0
spec/ml.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2021-2023 Nokia
3  * Copyright (c) 2021 Marvell
4  */
5 
12 #ifndef ODP_API_SPEC_ML_H_
13 #define ODP_API_SPEC_ML_H_
14 #include <odp/visibility_begin.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/event_types.h>
21 #include <odp/api/ml_types.h>
22 #include <odp/api/pool_types.h>
23 #include <odp/api/std_types.h>
24 
75 
84 
98 int odp_ml_config(const odp_ml_config_t *config);
99 
108 
134 
148 
158 
180 
199 
225 int odp_ml_model_load_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_load_result_t *result);
226 
243 
262 
288 int odp_ml_model_unload_status(odp_ml_model_t model, uint32_t compl_id,
289  odp_ml_load_result_t *result);
290 
299 
330 int odp_ml_run(odp_ml_model_t model, const odp_ml_data_t *data, const odp_ml_run_param_t *param);
331 
354  const odp_ml_run_param_t param[], int num);
355 
384  const odp_ml_compl_param_t *compl_param, const odp_ml_run_param_t *run_param);
385 
409  const odp_ml_compl_param_t compl_param[],
410  const odp_ml_run_param_t run_param[], int num);
411 
437 int odp_ml_run_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_run_result_t *result);
438 
447 
465 
478 
487 
505 
523 
536 
547 
556 
565 
574 
589 
604 uint32_t odp_ml_model_input_info(odp_ml_model_t model, odp_ml_input_info_t info[], uint32_t num);
605 
620 uint32_t odp_ml_model_output_info(odp_ml_model_t model, odp_ml_output_info_t info[], uint32_t num);
621 
630 
640 
647 void odp_ml_print(void);
648 
672 
689 int odp_ml_model_extra_stats(odp_ml_model_t model, uint64_t stats[], int num);
690 
695 #ifdef __cplusplus
696 }
697 #endif
698 
699 #include <odp/visibility_end.h>
700 #endif
ODP event API type definitions.
ODP Machine Learning (ML) types.
ODP pool.
Standard C language types and definitions for ODP.
void odp_ml_run_param_init(odp_ml_run_param_t *param)
Initialize model run parameters.
void odp_ml_model_param_init(odp_ml_model_param_t *param)
Initialize ML model parameters.
uint64_t odp_ml_model_to_u64(odp_ml_model_t model)
Convert ML model handle to a uint64_t value for debugging.
int odp_ml_compl_run_result(odp_ml_compl_t ml_compl, odp_ml_run_result_t *result)
Check ML model run results from completion event.
odp_pool_t odp_ml_compl_pool_create(const char *name, const odp_ml_compl_pool_param_t *param)
Create ML completion event pool.
void odp_ml_print(void)
Print ML debug information.
odp_ml_compl_t odp_ml_compl_from_event(odp_event_t event)
Convert event to ML completion event.
int odp_ml_run_start_multi(odp_ml_model_t model, const odp_ml_data_t data[], const odp_ml_compl_param_t compl_param[], const odp_ml_run_param_t run_param[], int num)
Start multiple model runs in asynchronous mode.
void odp_ml_config_init(odp_ml_config_t *config)
Initialize ML configuration parameters.
int odp_ml_model_unload_start(odp_ml_model_t model, const odp_ml_compl_param_t *compl_param)
Start asynchronous model unload.
int odp_ml_model_extra_stat_info(odp_ml_model_t model, odp_ml_extra_stat_info_t info[], int num)
Extra statistics counter information.
int odp_ml_run_start(odp_ml_model_t model, const odp_ml_data_t *data, const odp_ml_compl_param_t *compl_param, const odp_ml_run_param_t *run_param)
Start model run in asynchronous mode.
void * odp_ml_compl_user_area(odp_ml_compl_t ml_compl)
ML completion event user area.
odp_ml_compl_t odp_ml_compl_alloc(odp_pool_t pool)
Allocate ML completion event.
int odp_ml_config(const odp_ml_config_t *config)
Configure ML offload.
void odp_ml_compl_param_init(odp_ml_compl_param_t *param)
Initialize ML completion parameters.
int odp_ml_model_extra_stats(odp_ml_model_t model, uint64_t stats[], int num)
Read extra statistics counter values.
int odp_ml_model_load_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_load_result_t *result)
Check model load completion.
int odp_ml_run(odp_ml_model_t model, const odp_ml_data_t *data, const odp_ml_run_param_t *param)
Run the model in synchronous mode.
uint32_t odp_ml_model_output_info(odp_ml_model_t model, odp_ml_output_info_t info[], uint32_t num)
Retrieve model output information.
odp_ml_model_t odp_ml_model_lookup(const char *name)
Find a model by name.
int odp_ml_model_load_start(odp_ml_model_t model, const odp_ml_compl_param_t *compl_param)
Start asynchronous model load.
odp_ml_model_t odp_ml_model_create(const char *name, const odp_ml_model_param_t *param)
Create an ML model.
void odp_ml_compl_pool_param_init(odp_ml_compl_pool_param_t *param)
Initialize ML completion event pool parameters.
int odp_ml_model_load(odp_ml_model_t model, odp_ml_load_result_t *result)
Load ML model.
uint32_t odp_ml_model_input_info(odp_ml_model_t model, odp_ml_input_info_t info[], uint32_t num)
Retrieve model input information.
int odp_ml_model_unload_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_load_result_t *result)
Check model unload completion.
int odp_ml_run_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_run_result_t *result)
Check model run completion.
int odp_ml_model_unload(odp_ml_model_t model, odp_ml_load_result_t *result)
Unload ML model.
void odp_ml_model_print(odp_ml_model_t model)
Print debug information about the model.
int odp_ml_capability(odp_ml_capability_t *capa)
Query ML capabilities.
int odp_ml_model_info(odp_ml_model_t model, odp_ml_model_info_t *info)
Retrieve model information.
int odp_ml_model_destroy(odp_ml_model_t model)
Destroy an ML model.
void odp_ml_compl_free(odp_ml_compl_t ml_compl)
Free ML completion event.
odp_event_t odp_ml_compl_to_event(odp_ml_compl_t ml_compl)
Convert ML completion event to event.
int odp_ml_run_multi(odp_ml_model_t model, const odp_ml_data_t data[], const odp_ml_run_param_t param[], int num)
Run the model multiple times in synchronous mode.
int odp_ml_compl_load_result(odp_ml_compl_t ml_compl, odp_ml_load_result_t *result)
Check ML model load / unload results from completion event.
uint64_t odp_ml_compl_to_u64(odp_ml_compl_t ml_compl)
Convert ML completion event handle to a uint64_t value for debugging.
Machine learning capabilities.
ML completion parameters.
ML completion event pool parameters.
Machine learning configuration parameters.
Model input / output data for a model inference run.
ML extra statistics counter information.
Model input information.
Result of model load / unload operation.
Model information.
Machine learning model parameters.
Model output information.
Parameters for model run.
Results of model run operation.