Compiled Model

Overview

The operations about compiled model. More…

// structs

struct ov_compiled_model_t;

// global functions

ov_compiled_model_inputs_size(
    const ov_compiled_model_t \* compiled_model,
    size_t \* size
    );

ov_compiled_model_input(
    const ov_compiled_model_t \* compiled_model,
    ov_output_const_port_t \*\* input_port
    );

ov_compiled_model_input_by_index(
    const ov_compiled_model_t \* compiled_model,
    const size_t index,
    ov_output_const_port_t \*\* input_port
    );

ov_compiled_model_input_by_name(
    const ov_compiled_model_t \* compiled_model,
    const char \* name,
    ov_output_const_port_t \*\* input_port
    );

ov_compiled_model_outputs_size(
    const ov_compiled_model_t \* compiled_model,
    size_t \* size
    );

ov_compiled_model_output(
    const ov_compiled_model_t \* compiled_model,
    ov_output_const_port_t \*\* output_port
    );

ov_compiled_model_output_by_index(
    const ov_compiled_model_t \* compiled_model,
    const size_t index,
    ov_output_const_port_t \*\* output_port
    );

ov_compiled_model_output_by_name(
    const ov_compiled_model_t \* compiled_model,
    const char \* name,
    ov_output_const_port_t \*\* output_port
    );

ov_compiled_model_get_runtime_model(
    const ov_compiled_model_t \* compiled_model,
    ov_model_t \*\* model
    );

ov_compiled_model_create_infer_request(
    const ov_compiled_model_t \* compiled_model,
    ov_infer_request_t \*\* infer_request
    );

ov_compiled_model_set_property(const ov_compiled_model_t \* compiled_model, ...);

ov_compiled_model_get_property(
    const ov_compiled_model_t \* compiled_model,
    const char \* property_key,
    char \*\* property_value
    );

ov_compiled_model_export_model(
    const ov_compiled_model_t \* compiled_model,
    const char \* export_model_path
    );

ov_compiled_model_free(ov_compiled_model_t \* compiled_model);

Detailed Documentation

The operations about compiled model.

Global Functions

ov_compiled_model_inputs_size(
    const ov_compiled_model_t \* compiled_model,
    size_t \* size
    )

Get the input size of ov_compiled_model_t.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

input_size

the compiled_model’s input size.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_input(
    const ov_compiled_model_t \* compiled_model,
    ov_output_const_port_t \*\* input_port
    )

Get the single const input port of ov_compiled_model_t, which only support single input model.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

input_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_input_by_index(
    const ov_compiled_model_t \* compiled_model,
    const size_t index,
    ov_output_const_port_t \*\* input_port
    )

Get a const input port of ov_compiled_model_t by port index.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

index

input index.

input_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_input_by_name(
    const ov_compiled_model_t \* compiled_model,
    const char \* name,
    ov_output_const_port_t \*\* input_port
    )

Get a const input port of ov_compiled_model_t by name.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

name

input tensor name (char *).

input_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_outputs_size(
    const ov_compiled_model_t \* compiled_model,
    size_t \* size
    )

Get the output size of ov_compiled_model_t.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

size

the compiled_model’s output size.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_output(
    const ov_compiled_model_t \* compiled_model,
    ov_output_const_port_t \*\* output_port
    )

Get the single const output port of ov_compiled_model_t, which only support single output model.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

output_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_output_by_index(
    const ov_compiled_model_t \* compiled_model,
    const size_t index,
    ov_output_const_port_t \*\* output_port
    )

Get a const output port of ov_compiled_model_t by port index.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

index

input index.

output_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_output_by_name(
    const ov_compiled_model_t \* compiled_model,
    const char \* name,
    ov_output_const_port_t \*\* output_port
    )

Get a const output port of ov_compiled_model_t by name.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

name

input tensor name (char *).

output_port

A pointer to the ov_output_const_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_get_runtime_model(
    const ov_compiled_model_t \* compiled_model,
    ov_model_t \*\* model
    )

Gets runtime model information from a device.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

model

A pointer to the ov_model_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_create_infer_request(
    const ov_compiled_model_t \* compiled_model,
    ov_infer_request_t \*\* infer_request
    )

Creates an inference request object used to infer the compiled model.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

infer_request

A pointer to the ov_infer_request_t.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_set_property(const ov_compiled_model_t \* compiled_model, ...)

Sets properties for a device, acceptable keys can be found in ov_property_key_xxx.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

variadic paramaters The format is <char *property_key, char* property_value>. Supported property key please see ov_property.h.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_get_property(
    const ov_compiled_model_t \* compiled_model,
    const char \* property_key,
    char \*\* property_value
    )

Gets properties for current compiled model.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

property_key

Property key.

property_value

A pointer to property value.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_export_model(
    const ov_compiled_model_t \* compiled_model,
    const char \* export_model_path
    )

Exports the current compiled model to an output stream std::ostream. The exported model can also be imported via the ov::Core::import_model method.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t.

export_model_path

Path to the file.

Returns:

Status code of the operation: OK(0) for success.

ov_compiled_model_free(ov_compiled_model_t \* compiled_model)

Release the memory allocated by ov_compiled_model_t.

Parameters:

compiled_model

A pointer to the ov_compiled_model_t to free memory.