API Reference Manual  1.48.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 #include <odp/api/event_types.h>
17 #include <odp/api/ml_types.h>
18 #include <odp/api/pool_types.h>
19 #include <odp/api/std_types.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
73 
89 
106 int odp_ml_engine_capability(uint32_t engine_id, odp_ml_capability_t *capa);
107 
116 
130 int odp_ml_config(const odp_ml_config_t *config);
131 
140 
166 
180 
190 
212 
231 
257 int odp_ml_model_load_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_load_result_t *result);
258 
275 
294 
320 int odp_ml_model_unload_status(odp_ml_model_t model, uint32_t compl_id,
321  odp_ml_load_result_t *result);
322 
331 
362 int odp_ml_run(odp_ml_model_t model, const odp_ml_data_t *data, const odp_ml_run_param_t *param);
363 
386  const odp_ml_run_param_t param[], int num);
387 
416  const odp_ml_compl_param_t *compl_param, const odp_ml_run_param_t *run_param);
417 
441  const odp_ml_compl_param_t compl_param[],
442  const odp_ml_run_param_t run_param[], int num);
443 
469 int odp_ml_run_status(odp_ml_model_t model, uint32_t compl_id, odp_ml_run_result_t *result);
470 
479 
497 
510 
519 
537 
555 
568 
579 
588 
597 
606 
621 
636 uint32_t odp_ml_model_input_info(odp_ml_model_t model, odp_ml_input_info_t info[], uint32_t num);
637 
652 uint32_t odp_ml_model_output_info(odp_ml_model_t model, odp_ml_output_info_t info[], uint32_t num);
653 
662 
672 
679 void odp_ml_print(void);
680 
704 
721 int odp_ml_model_extra_stats(odp_ml_model_t model, uint64_t stats[], int num);
722 
727 #ifdef __cplusplus
728 }
729 #endif
730 
731 #include <odp/visibility_end.h>
732 #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.
int odp_ml_num_engines(void)
Query number of ML engines.
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.
int odp_ml_engine_capability(uint32_t engine_id, odp_ml_capability_t *capa)
Query ML capabilities of a specific engine.
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.