Skip to content

Commit

Permalink
linux-gen: ml: clean up comments and whitespace
Browse files Browse the repository at this point in the history
Minor clean up of some comments and whitespace.

Signed-off-by: Jere Leppänen <[email protected]>
Reviewed-by: Tuomas Taipale <[email protected]>
  • Loading branch information
JereLeppanen authored and MatiasElo committed Sep 27, 2024
1 parent eb4a3ae commit 649450d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions platform/linux-generic/odp_ml.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum {
/* Bad input */
ML_BAD_INPUT,

/* Fail from underlying library onnxruntime */
/* Fail from underlying library */
ML_LIB_FAILED,

/* Bad output */
Expand Down Expand Up @@ -90,7 +90,7 @@ typedef struct ml_input_t {
uint64_t size;
} ml_input_t;

/* Onnxruntime model info */
/* Model info */
typedef struct ml_model_t {
/* Guards state, which must be accessed atomically */
odp_ticketlock_t lock;
Expand Down Expand Up @@ -836,7 +836,8 @@ odp_ml_model_t odp_ml_model_create(const char *name, const odp_ml_model_param_t
}

if (odp_unlikely(param->size > _odp_ml_glb->ml_config.max_model_size)) {
_ODP_ERR("Model size %" PRIu64 " exceeds maximum model size configured %" PRIu64 "\n",
_ODP_ERR("Model size %" PRIu64 " exceeds maximum model size configured %" PRIu64
"\n",
param->size, _odp_ml_glb->ml_config.max_model_size);
return ODP_ML_MODEL_INVALID;
}
Expand All @@ -853,7 +854,7 @@ odp_ml_model_t odp_ml_model_create(const char *name, const odp_ml_model_param_t
return ODP_ML_MODEL_INVALID;
}

/* Find an emtpy slot to store the new model */
/* Find an empty slot to store the new model */
for (i = 0; i < ML_MAX_MODELS_CREATED; i++) {
if (_odp_ml_glb->models[i].state)
continue;
Expand Down Expand Up @@ -1139,10 +1140,10 @@ static void print_shape(const odp_ml_shape_info_t *shape)

void odp_ml_model_print(odp_ml_model_t model)
{
ml_model_t *mdl = ml_model_from_handle(model);
const odp_ml_model_info_t * const info = &mdl->info;
const odp_ml_input_info_t * const input_info = mdl->input_info;
const odp_ml_output_info_t * const output_info = mdl->output_info;
ml_model_t *mdl = ml_model_from_handle(model);
const odp_ml_model_info_t *const info = &mdl->info;
const odp_ml_input_info_t *const input_info = mdl->input_info;
const odp_ml_output_info_t *const output_info = mdl->output_info;

if (odp_unlikely(model == ODP_ML_MODEL_INVALID)) {
_ODP_ERR("Bad ML model handle\n");
Expand Down Expand Up @@ -1409,8 +1410,8 @@ void odp_ml_compl_param_init(odp_ml_compl_param_t *compl_param)
{
memset(compl_param, 0, sizeof(odp_ml_compl_param_t));

compl_param->queue = ODP_QUEUE_INVALID;
compl_param->event = ODP_EVENT_INVALID;
compl_param->queue = ODP_QUEUE_INVALID;
compl_param->event = ODP_EVENT_INVALID;
}

int odp_ml_model_load(odp_ml_model_t model, odp_ml_load_result_t *result)
Expand Down

0 comments on commit 649450d

Please sign in to comment.