Crate openvino_sys

source
Expand description

This crate provides low-level, unsafe, Rust bindings to OpenVINO™ using its C API. If you are looking to use OpenVINO™ from Rust, you likely should look at the ergonomic, safe bindings in openvino, which depends on this crate. See the repository README for more information, including build instructions.

An example interaction with raw openvino-sys:

openvino_sys::library::load().expect("to have an OpenVINO library available");
let mut ov_version = openvino_sys::ov_version_t {
    // Initialize the fields to default values
    description: std::ptr::null(),
    buildNumber: std::ptr::null(),
};
let code = unsafe { openvino_sys::ov_get_openvino_version(&mut ov_version) };
assert_eq!(code, openvino_sys::ov_status_e::OK);
let version_ptr = { ov_version }.buildNumber;
let string_version = unsafe { CStr::from_ptr(version_ptr) }.to_string_lossy().into_owned();
unsafe { openvino_sys::ov_version_free(std::ptr::addr_of_mut!(ov_version)) };
assert!(string_version.starts_with("2"));

Modules§

  • Contains extra utilities for finding and loading the OpenVINO shared libraries.

Structs§

Enums§

  • @enum ov_color_format_e @ingroup ov_prepostprocess_c_api @brief This enum contains enumerations for color format.
  • @enum ov_element_type_e @ingroup ov_base_c_api @brief This enum contains codes for element type, which is aligned with ov::element::Type_t in src/core/include/openvino/core/type/element_type.hpp
  • @enum ov_preprocess_resize_algorithm_e @ingroup ov_prepostprocess_c_api @brief This enum contains codes for all preprocess resize algorithm.
  • @enum ov_status_e @ingroup ov_base_c_api @brief This enum contains codes for all possible return values of the interface functions

Functions§

  • Load all of the function definitions from a shared library.
  • @brief Releases memory occpuied by ov_available_devices_t @ingroup ov_core_c_api @param devices A pointer to the ov_available_devices_t instance. @return Status code of the operation: OK(0) for success.
  • @brief Creates an inference request object used to infer the compiled model. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param infer_request A pointer to the ov_infer_request_t. @return Status code of the operation: OK(0) for success.
  • @brief 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. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param export_model_path Path to the file. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_compiled_model_t. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t to free memory.
  • @brief Returns pointer to device-specific shared context on a remote accelerator device that was used to create this CompiledModel. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param context Return context. @return Status code of the operation: OK(0) for success.
  • @brief Gets properties for current compiled model. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param property_key Property key. @param property_value A pointer to property value. @return Status code of the operation: OK(0) for success.
  • @brief Gets runtime model information from a device. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param model A pointer to the ov_model_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the single const input port of ov_compiled_model_t, which only support single input model. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const input port of ov_compiled_model_t by port index. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param index input index. @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const input port of ov_compiled_model_t by name. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param name input tensor name (char *). @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the input size of ov_compiled_model_t. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param input_size the compiled_model’s input size. @return Status code of the operation: OK(0) for success.
  • @brief Get the single const output port of ov_compiled_model_t, which only support single output model. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const output port of ov_compiled_model_t by port index. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param index input index. @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const output port of ov_compiled_model_t by name. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param name input tensor name (char *). @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the output size of ov_compiled_model_t. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param size the compiled_model’s output size. @return Status code of the operation: OK(0) for success.
  • @brief Sets properties for a device, acceptable keys can be found in ov_property_key_xxx. @ingroup ov_compiled_model_c_api @param compiled_model A pointer to the ov_compiled_model_t. @param … variadic paramaters The format is <char property_key, char property_value>. Supported property key please see ov_property.h. @return Status code of the operation: OK(0) for success.
  • @brief Get the shape of port object. @ingroup ov_node_c_api @param port A pointer to ov_output_const_port_t. @param tensor_shape tensor shape. @return Status code of the operation: OK(0) for success.
  • @brief Creates a compiled model from a source model object. Users can create as many compiled models as they need and use them simultaneously (up to the limitation of the hardware resources). @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model Model object acquired from Core::read_model. @param device_name Name of a device to load a model to. @param property_args_size How many properties args will be passed, each property contains 2 args: key and value. @param compiled_model A pointer to the newly created compiled_model. @param … property paramater: Optional pack of pairs: <char* property_key, char* property_value> relevant only for this load operation operation. Supported property key please see ov_property.h. @return Status code of the operation: OK(0) for success.
  • @brief Reads a model and creates a compiled model from the IR/ONNX/PDPD file. This can be more efficient than using the ov_core_read_model_from_XXX + ov_core_compile_model flow, especially for cases when caching is enabled and a cached model is available. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model_path Path to a model. @param device_name Name of a device to load a model to. @param property_args_size How many properties args will be passed, each property contains 2 args: key and value. @param compiled_model A pointer to the newly created compiled_model. @param … Optional pack of pairs: <char* property_key, char* property_value> relevant only for this load operation operation. Supported property key please see ov_property.h. @return Status code of the operation: OK(0) for success.
  • @brief Reads a model and creates a compiled model from the IR/ONNX/PDPD file. This can be more efficient than using the ov_core_read_model_from_XXX + ov_core_compile_model flow, especially for cases when caching is enabled and a cached model is available. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model_path Path to a model. @param device_name Name of a device to load a model to. @param property_args_size How many properties args will be passed, each property contains 2 args: key and value. @param compiled_model A pointer to the newly created compiled_model. @param … Optional pack of pairs: <char* property_key, char* property_value> relevant only for this load operation operation. Supported property key please see ov_property.h. @return Status code of the operation: OK(0) for success.
  • @brief Creates a compiled model from a source model within a specified remote context. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model Model object acquired from ov_core_read_model. @param context A pointer to the newly created remote context. @param property_args_size How many args will be for this compiled model. @param compiled_model A pointer to the newly created compiled_model. @param … variadic parmameters Actual property parameter for remote context @return Status code of the operation: OK(0) for success.
  • @brief Constructs OpenVINO Core instance by default. See RegisterPlugins for more details. @ingroup ov_core_c_api @param core A pointer to the newly created ov_core_t. @return Status code of the operation: OK(0) for success.
  • @brief Creates a new remote shared context object on the specified accelerator device using specified plugin-specific low-level device API parameters (device handle, pointer, context, etc.). @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param device_name Device name to identify a plugin. @param context_args_size How many property args will be for this remote context creation. @param context A pointer to the newly created remote context. @param … variadic parmameters Actual context property parameter for remote context @return Status code of the operation: OK(0) for success.
  • @brief Constructs OpenVINO Core instance using XML configuration file with devices description. See RegisterPlugins for more details. @ingroup ov_core_c_api @param xml_config_file A path to .xml file with devices to load from. If XML configuration file is not specified, then default plugin.xml file will be used. @param core A pointer to the newly created ov_core_t. @return Status code of the operation: OK(0) for success.
  • @brief Constructs OpenVINO Core instance. See RegisterPlugins for more details. @ingroup ov_core_c_api @param xml_config_file_ws A path to model file with unicode. @param core A pointer to the newly created ov_core_t. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_core_t. @ingroup ov_core_c_api @param core A pointer to the ov_core_t to free memory.
  • @brief Returns devices available for inference. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param devices A pointer to the ov_available_devices_t instance. Core objects go over all registered plugins and ask about available devices. @return Status code of the operation: OK(0) for success.
  • @brief Gets a pointer to default (plugin-supplied) shared context object for the specified accelerator device. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param device_name Name of a device to get a default shared context from. @param context A pointer to the referenced remote context. @return Status code of the operation: OK(0) for success.
  • @brief Gets properties related to device behaviour. The method extracts information that can be set via the set_property method. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param device_name Name of a device to get a property value. @param property_key Property key. @param property_value A pointer to property value with string format. @return Status code of the operation: OK(0) for success.
  • @brief Returns device plugins version information. Device name can be complex and identify multiple devices at once like HETERO:CPU,GPU; in this case, std::map contains multiple entries, each per device. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param device_name Device name to identify a plugin. @param versions A pointer to versions corresponding to device_name. @return Status code of the operation: OK(0) for success.
  • @brief Imports a compiled model from the previously exported one. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param content A pointer to content of the exported model. @param content_size Number of bytes in the exported network. @param device_name Name of a device to import a compiled model for. @param compiled_model A pointer to the newly created compiled_model. @return Status code of the operation: OK(0) for success.
  • @brief Reads models from IR / ONNX / PDPD / TF / TFLite formats. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model_path Path to a model. @param bin_path Path to a data file. For IR format (*.bin):
  • @brief Reads models from IR / ONNX / PDPD / TF / TFLite formats with models string size. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model_str String with a model in IR / ONNX / PDPD / TF / TFLite format, support model string containing several null chars. @param str_len The length of model string. @param weights Shared pointer to a constant tensor with weights. @param model A pointer to the newly created model. Reading ONNX / PDPD / TF / TFLite models does not support loading weights from the @p weights tensors. @note Created model object shares the weights with the @p weights object. Thus, do not create @p weights on temporary data that can be freed later, since the model constant data will point to an invalid memory. @return Status code of the operation: OK(0) for success.
  • @brief Reads models from IR / ONNX / PDPD / TF / TFLite formats, path is unicode. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param model_path Path to a model. @param bin_path Path to a data file. For IR format (*.bin):
  • @brief Sets properties for a device, acceptable keys can be found in ov_property_key_xxx. @ingroup ov_core_c_api @param core A pointer to the ov_core_t instance. @param device_name Name of a device. @param … variadic paramaters The format is <char* property_key, char* property_value>. Supported property key please see ov_property.h. @return Status code of the operation: OK(0) for success.
  • @brief Releases memory occupied by ov_core_version_list_t. @ingroup ov_core_c_api @param versions A pointer to the ov_core_version_list_t to free memory.
  • @brief Check this dimension whether is dynamic @ingroup ov_dimension_c_api @param dim The dimension pointer that will be checked. @return Boolean, true is dynamic and false is static.
  • @brief free char @ingroup ov_base_c_api @param content The pointer to the char to free.
  • @brief Print the error info. @ingroup ov_base_c_api @param ov_status_e a status code.
  • @brief Get the last error msg. @ingroup ov_base_c_api
  • @brief Get version of OpenVINO. @ingroup ov_core_c_api @param ov_version_t a pointer to the version @return Status code of the operation: OK(0) for success.
  • @brief Cancel inference request. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_infer_request_t. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t to free memory.
  • @brief Get an input tensor from the model with only one input tensor. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Get an input tensor by the index of input tensor. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param idx Index of the tensor to get. @p idx. If the tensor with the specified @p idx is not found, an error will return. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Get an output tensor from the model with only one output tensor. @note If model has several outputs, an error will return. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Get an output tensor by the index of output tensor. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param idx Index of the tensor to get. @p idx. If the tensor with the specified @p idx is not found, an error will return. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Query performance measures per layer to identify the most time consuming operation. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param profiling_infos Vector of profiling information for operations in a model. @return Status code of the operation: OK(0) for success.
  • @brief Get an input/output tensor by the name of tensor. @note If model has several outputs, an error will return. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor_name Name of the input or output tensor to get. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Get an input/output tensor by const port. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param port Port of the tensor to get. @p port is not found, an error will return. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Get an input/output tensor by port. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param port Port of the tensor to get. @p port is not found, an error will return. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Infer specified input(s) in synchronous mode. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @return Status code of the operation: OK(0) for success.
  • @brief Set callback function, which will be called when inference is done. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param callback A function to be called. @return Status code of the operation: OK(0) for success.
  • @brief Set an input tensor for the model with single input to infer on. @note If model has several inputs, an error will return. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an input tensor to infer on by the index of tensor. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param idx Index of the input port. If @p idx is greater than the number of model inputs, an error will return. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an output tensor to infer models with single output. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an output tensor to infer by the index of output tensor. @note Index of the output preserved accross ov_model_t, ov_compiled_model_t. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param idx Index of the output tensor. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an input/output tensor to infer on by the name of tensor. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param tensor_name Name of the input or output tensor. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an input/output tensor to infer request for the port. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param port Const port of the input or output tensor, which can be got by call interface from ov_model_t/ov_compiled_model_t. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Set an input/output tensor to infer request for the port. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param port Port of the input or output tensor, which can be got by calling ov_model_t/ov_compiled_model_t interface. @param tensor Reference to the tensor. @return Status code of the operation: OK(0) for success.
  • @brief Start inference of specified input(s) in asynchronous mode. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @return Status code of the operation: OK(0) for success.
  • @brief Wait for the result to become available. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @return Status code of the operation: OK(0) for success.
  • @brief Waits for the result to become available. Blocks until the specified timeout has elapsed or the result becomes available, whichever comes first. @ingroup ov_infer_request_c_api @param infer_request A pointer to the ov_infer_request_t. @param timeout Maximum duration, in milliseconds, to block for. @return Status code of the operation: OK(0) for success.
  • @brief Create a layout object. @ingroup ov_layout_c_api @param layout The layout input pointer. @param layout_desc The description of layout. @return ov_status_e a status code, return OK if successful
  • @brief Free layout object. @ingroup ov_layout_c_api @param layout will be released.
  • @brief Convert layout object to a readable string. @ingroup ov_layout_c_api @param layout will be converted. @return string that describes the layout content.
  • @brief Get a const input port of ov_model_t,which only support single input model. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const input port of ov_model_t by port index. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param index input tensor index. @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const input port of ov_model_t by name. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_name The name of input tensor. @param input_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a single const output port of ov_model_t, which only support single output model. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const output port of ov_model_t by port index. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param index input tensor index. @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a const output port of ov_model_t by name. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_name input tensor name (char *). @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_model_t. @ingroup ov_model_c_api @param model A pointer to the ov_model_t to free memory.
  • @brief Gets the friendly name for a model. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param friendly_name the model’s friendly name. @return Status code of the operation: OK(0) for success.
  • @brief Get single input port of ov_model_t, which only support single input model. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param input_port A pointer to the ov_output_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get an input port of ov_model_t by port index. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param index input tensor index. @param input_port A pointer to the ov_output_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get an input port of ov_model_t by name. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_name input tensor name (char *). @param input_port A pointer to the ov_output_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the input size of ov_model_t. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param input_size the model’s input size. @return Status code of the operation: OK(0) for success.
  • @brief Returns true if any of the ops defined in the model is dynamic shape. @param model A pointer to the ov_model_t. @return true if model contains dynamic shapes
  • @brief Get a single output port of ov_model_t, which only support single output model. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param output_port A pointer to the ov_output_const_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get an output port of ov_model_t by port index. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param index input tensor index. @param output_port A pointer to the ov_output_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get an output port of ov_model_t by name. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_name output tensor name (char *). @param output_port A pointer to the ov_output_port_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the output size of ov_model_t. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param output_size the model’s output size. @return Status code of the operation: OK(0) for success.
  • @brief Do reshape in model with a list of <name, partial shape>. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_names The list of input tensor names. @param partialShape A PartialShape list. @param size The item count in the list. @return Status code of the operation: OK(0) for success.
  • @brief Do reshape in model with a list of <port id, partial shape>. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param port_indexes The array of port indexes. @param partialShape A PartialShape list. @param size The item count in the list. @return Status code of the operation: OK(0) for success.
  • @brief Do reshape in model with a list of <ov_output_port_t, partial shape>. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param output_ports The ov_output_port_t list. @param partialShape A PartialShape list. @param size The item count in the list. @return Status code of the operation: OK(0) for success.
  • @brief Do reshape in model with partial shape for a specified name. @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param tensor_name The tensor name of input tensor. @param partialShape A PartialShape. @return Status code of the operation: OK(0) for success.
  • @brief Do reshape in model for one node(port 0). @ingroup ov_model_c_api @param model A pointer to the ov_model_t. @param partialShape A PartialShape. @return Status code of the operation: OK(0) for success.
  • @brief free const port @ingroup ov_node_c_api @param port The pointer to the instance of the ov_output_const_port_t to free.
  • @brief free port object @ingroup ov_node_c_api @param port The pointer to the instance of the ov_output_port_t to free.
  • @brief Initialze a partial shape with static rank and dynamic dimension. @ingroup ov_partial_shape_c_api @param rank support static rank. @param dims support dynamic and static dimension. Static rank, but dynamic dimensions on some or all axes. Examples: {1,2,?,4} or {?,?,?} or {1,2,-1,4} Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}
  • @brief Initialze a partial shape with dynamic rank and dynamic dimension. @ingroup ov_partial_shape_c_api @param rank support dynamic and static rank. @param dims support dynamic and static dimension. Dynamic rank: Example: ? Static rank, but dynamic dimensions on some or all axes. Examples: {1,2,?,4} or {?,?,?} or {1,2,-1,4} Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}"
  • @brief Initialize a partial shape with static rank and static dimension. @ingroup ov_partial_shape_c_api @param rank support static rank. @param dims support static dimension. Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}
  • @brief Release internal memory allocated in partial shape. @ingroup ov_partial_shape_c_api @param partial_shape The object’s internal memory will be released. @return Status code of the operation: OK(0) for success.
  • @brief Check this partial_shape whether is dynamic @ingroup ov_partial_shape_c_api @param partial_shape The partial_shape pointer. @return Status code of the operation: OK(0) for success.
  • @brief Convert partial shape without dynamic data to a static shape. @ingroup ov_partial_shape_c_api @param partial_shape The partial_shape pointer. @param shape The shape pointer. @return Status code of the operation: OK(0) for success.
  • @brief Helper function, convert a partial shape to readable string. @ingroup ov_partial_shape_c_api @param partial_shape The partial_shape pointer. @return A string reprensts partial_shape’s content.
  • @brief Get the tensor name of port. @ingroup ov_node_c_api @param port A pointer to the ov_output_const_port_t. @param tensor_name A pointer to the tensor name. @return Status code of the operation: OK(0) for success.
  • @brief Get the tensor type of port. @ingroup ov_node_c_api @param port A pointer to the ov_output_const_port_t. @param tensor_type tensor type. @return Status code of the operation: OK(0) for success.
  • @brief Get the partial shape of port. @ingroup ov_node_c_api @param port A pointer to the ov_output_const_port_t. @param partial_shape Partial shape. @return Status code of the operation: OK(0) for success.
  • @brief Get the shape of port object. @ingroup ov_node_c_api @param port A pointer to ov_output_port_t. @param tensor_shape tensor shape. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_input_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_input_info A pointer to the ov_preprocess_input_info_t to free memory.
  • @brief Get current input model information. @ingroup ov_prepostprocess_c_api @param preprocess_input_info A pointer to the ov_preprocess_input_info_t. @param preprocess_input_model_info A pointer to the ov_preprocess_input_model_info_t @return Status code of the operation: OK(0) for success.
  • @brief Get a ov_preprocess_preprocess_steps_t. @ingroup ov_prepostprocess_c_api @param ov_preprocess_input_info_t A pointer to the ov_preprocess_input_info_t. @param preprocess_input_steps A pointer to ov_preprocess_preprocess_steps_t. @return Status code of the operation: OK(0) for success.
  • @brief Get a ov_preprocess_input_tensor_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_input_info A pointer to the ov_preprocess_input_info_t. @param preprocess_input_tensor_info A pointer to ov_preprocess_input_tensor_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_input_model_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_input_model_info A pointer to the ov_preprocess_input_model_info_t to free memory.
  • @brief Set layout for model’s input tensor. @ingroup ov_prepostprocess_c_api @param preprocess_input_model_info A pointer to the ov_preprocess_input_model_info_t @param layout A point to ov_layout_t @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_input_tensor_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t to free memory.
  • @brief Set ov_preprocess_input_tensor_info_t color format. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param colorFormat The enumerate of colorFormat @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t color format with subname. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param colorFormat The enumerate of colorFormat @param sub_names_size The size of sub_names @param … variadic params sub_names Optional list of sub-names assigned for each plane (e.g. “Y”, “UV”). @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t precesion. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param element_type A point to element_type @return Status code of the operation: OK(0) for success.
  • @brief Helper function to reuse element type and shape from user’s created tensor. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t layout. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param layout A point to ov_layout_t @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t memory type. @ingroup prepostprocess @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param mem_type Memory type. Refer to ov_remote_context.h to get memory type string info. @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t spatial_static_shape. @ingroup ov_prepostprocess_c_api @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t. @param input_height The height of input @param input_width The width of input @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_output_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_output_info A pointer to the ov_preprocess_output_info_t to free memory.
  • @brief Get a ov_preprocess_input_tensor_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_output_info A pointer to the ov_preprocess_output_info_t. @param preprocess_output_tensor_info A pointer to the ov_preprocess_output_tensor_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Set ov_preprocess_input_tensor_info_t precesion. @ingroup ov_prepostprocess_c_api @param preprocess_output_tensor_info A pointer to the ov_preprocess_output_tensor_info_t. @param element_type A point to element_type @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_output_tensor_info_t. @ingroup ov_prepostprocess_c_api @param preprocess_output_tensor_info A pointer to the ov_preprocess_output_tensor_info_t to free memory.
  • @brief Adds pre/post-processing operations to function passed in constructor. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param model A pointer to the ov_model_t. @return Status code of the operation: OK(0) for success.
  • @brief Create a ov_preprocess_prepostprocessor_t instance. @ingroup ov_prepostprocess_c_api @param model A pointer to the ov_model_t. @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_prepostprocessor_t. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t to free memory.
  • @brief Get the input info of ov_preprocess_prepostprocessor_t instance. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param preprocess_input_info A pointer to the ov_preprocess_input_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor order. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param tensor_index The order of input. @param preprocess_input_info A pointer to the ov_preprocess_input_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor name. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param tensor_name The name of input. @param preprocess_input_info A pointer to the ov_preprocess_input_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the output info of ov_preprocess_output_info_t instance. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param preprocess_output_info A pointer to the ov_preprocess_output_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the output info of ov_preprocess_output_info_t instance. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param tensor_index The tensor index @param preprocess_output_info A pointer to the ov_preprocess_output_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Get the output info of ov_preprocess_output_info_t instance. @ingroup ov_prepostprocess_c_api @param preprocess A pointer to the ov_preprocess_prepostprocessor_t. @param tensor_name The name of input. @param preprocess_output_info A pointer to the ov_preprocess_output_info_t. @return Status code of the operation: OK(0) for success.
  • @brief Convert ov_preprocess_preprocess_steps_t color. @ingroup ov_prepostprocess_c_api @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t. @param colorFormat The enumerate of colorFormat. @return Status code of the operation: OK(0) for success.
  • @brief Convert ov_preprocess_preprocess_steps_t element type. @ingroup ov_prepostprocess_c_api @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t. @param element_type preprocess input element type. @return Status code of the operation: OK(0) for success.
  • @brief Add ‘convert layout’ operation to specified layout. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param layout A point to ov_layout_t @return Status code of the operation: OK(0) for success.
  • @brief Crop input tensor between begin and end coordinates. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param begin Pointer to begin indexes for input tensor cropping. Negative values represent counting elements from the end of input tensor @param begin_size The size of begin array @param end Pointer to end indexes for input tensor cropping. End indexes are exclusive, which means values including end edge are not included in the output slice. Negative values represent counting elements from the end of input tensor @param end_size The size of end array @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_preprocess_preprocess_steps_t. @ingroup ov_prepostprocess_c_api @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t to free memory.
  • @brief Add mean preprocess operation. Subtract specified value from each element of input. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param value Value to subtract from each element. @return Status code of the operation: OK(0) for success.
  • @brief Add mean preprocess operation. Subtract each channel element of input by different specified value. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param values Value array to subtract from each element. @param value_size Mean value size @return Status code of the operation: OK(0) for success.
  • @brief Add resize operation to model’s dimensions. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param resize_algorithm A ov_preprocess_resizeAlgorithm instance @return Status code of the operation: OK(0) for success.
  • @brief Reverse channels operation. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @return Status code of the operation: OK(0) for success.
  • @brief Add scale preprocess operation. Divide each element of input by specified value. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param value Scaling value @return Status code of the operation: OK(0) for success.
  • @brief Add scale preprocess operation. Divide each channel element of input by different specified value. @ingroup ov_prepostprocess_c_api @param preprocess_input_process_steps A pointer to ov_preprocess_preprocess_steps_t. @param values Scaling values array for each channels @param value_size Scaling value size @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_profiling_info_list_t. @ingroup ov_infer_request_c_api @param profiling_infos A pointer to the ov_profiling_info_list_t to free memory.
  • @brief Check this rank whether is dynamic @ingroup ov_rank_c_api @param rank The rank pointer that will be checked. @return bool The return value.
  • @brief This method is used to create a host tensor object friendly for the device in current context. For example, GPU context may allocate USM host memory (if corresponding extension is available), which could be more efficient than regular host memory. @ingroup ov_remote_context_c_api @param context A pointer to the ov_remote_context_t instance. @param type Defines the element type of the tensor. @param shape Defines the shape of the tensor. @param tensor Pointer to ov_tensor_t that contains host tensor. @return Status code of the operation: OK(0) for success.
  • @brief Allocates memory tensor in device memory or wraps user-supplied memory handle using the specified tensor description and low-level device-specific parameters. Returns a pointer to the object that implements the RemoteTensor interface. @ingroup ov_remote_context_c_api @param context A pointer to the ov_remote_context_t instance. @param type Defines the element type of the tensor. @param shape Defines the shape of the tensor. @param object_args_size Size of the low-level tensor object parameters. @param remote_tensor Pointer to returned ov_tensor_t that contains remote tensor instance. @param … variadic params Contains low-level tensor object parameters. @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_remote_context_t. @ingroup ov_remote_context_c_api @param context A pointer to the ov_remote_context_t to free memory. @return Status code of the operation: OK(0) for success.
  • @brief Returns name of a device on which underlying object is allocated. @ingroup ov_remote_context_c_api @param context A pointer to the ov_remote_context_t instance. @param device_name Device name will be returned. @return Status code of the operation: OK(0) for success.
  • @brief Returns a string contains device-specific parameters required for low-level operations with the underlying object. Parameters include device/context handles, access flags, etc. Content of the returned map depends on a remote execution context that is currently set on the device (working scenario). One actaul example: “CONTEXT_TYPE OCL OCL_CONTEXT 0x5583b2ec7b40 OCL_QUEUE 0x5583b2e98ff0” @ingroup ov_remote_context_c_api @param context A pointer to the ov_remote_context_t instance. @param size The size of param pairs. @param params Param name:value list. @return Status code of the operation: OK(0) for success.
  • @brief Returns name of a device on which underlying object is allocated. @ingroup ov_remote_context_c_api @param remote_tensor A pointer to the remote tensor instance. @param device_name Device name will be return. @return Status code of the operation: OK(0) for success.
  • @brief Returns a string contains device-specific parameters required for low-level operations with underlying object. Parameters include device/context/surface/buffer handles, access flags, etc. Content of the returned map depends on remote execution context that is currently set on the device (working scenario). One example: “MEM_HANDLE:0x559ff6904b00;OCL_CONTEXT:0x559ff71d62f0;SHARED_MEM_TYPE:OCL_BUFFER;” @ingroup ov_remote_context_c_api @param tensor Pointer to ov_tensor_t that contains host tensor. @param size The size of param pairs. @param params Param name:value list. @return Status code of the operation: OK(0) for success.
  • @brief Initialize a fully shape object, allocate space for its dimensions and set its content id dims is not null. @ingroup ov_shape_c_api @param rank The rank value for this object, it should be more than 0(>0) @param dims The dimensions data for this shape object, it’s size should be equal to rank. @param shape The input/output shape object pointer. @return ov_status_e The return status code.
  • @brief Free a shape object’s internal memory. @ingroup ov_shape_c_api @param shape The input shape object pointer. @return ov_status_e The return status code.
  • @brief Convert shape to partial shape. @ingroup ov_partial_shape_c_api @param shape The shape pointer. @param partial_shape The partial_shape pointer. @return Status code of the operation: OK(0) for success.
  • @brief Shut down the OpenVINO by deleting all static-duration objects allocated by the library and releasing dependent resources @ingroup ov_c_api @note This function should be used by advanced user to control unload the resources.
  • @brief Constructs Tensor using element type and shape. Allocate internal host storage using default allocator @ingroup ov_tensor_c_api @param type Tensor element type @param shape Tensor shape @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Constructs Tensor using element type, shape and external host ptr. @ingroup ov_tensor_c_api @param type Tensor element type @param shape Tensor shape @param host_ptr Pointer to pre-allocated host memory @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Provides an access to the underlaying host memory. @ingroup ov_tensor_c_api @param data A point to host memory. @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Free ov_tensor_t. @ingroup ov_tensor_c_api @param tensor A point to ov_tensor_t
  • @brief the size of the current Tensor in bytes. @ingroup ov_tensor_c_api @param byte_size the size of the current Tensor in bytes. @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Get type for tensor. @ingroup ov_tensor_c_api @param type Tensor element type @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Get shape for tensor. @ingroup ov_tensor_c_api @param shape Tensor shape @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief the total number of elements (a product of all the dims or 1 for scalar). @ingroup ov_tensor_c_api @param elements_size number of elements @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Set new shape for tensor, deallocate/allocate if new total size is bigger than previous one. @ingroup ov_tensor_c_api @param shape Tensor shape @param tensor A point to ov_tensor_t @return Status code of the operation: OK(0) for success.
  • @brief Release the memory allocated by ov_version_t. @ingroup ov_core_c_api @param version A pointer to the ov_version_t to free memory.

Type Aliases§

  • @brief encryption_func is a function pointer that encrypt or decrypt the input memory, example of this function is codec(const char* input, const size_t in_size, const char* output, size_t* out_size) This function needs to be called twice, the first call to obtain out_size (the size of output buffer), the second call to obtain output buffer. The first call output is nullptr, before the second call, the caller needs to apply for output memory based on the out_size returned by the first call. the memory of parameter output is allocated and released by the caller. @param input The pointer to the input buffer. @param in_size The size of input. @param output The pointer to the encrypted/decrypted buffer. @param out_size The size of output.
  • @struct ov_compiled_model_t @ingroup ov_compiled_model_c_api @brief type define ov_compiled_model_t from ov_compiled_model
  • @struct ov_core_t @ingroup ov_core_c_api @brief type define ov_core_t from ov_core
  • @struct ov_dimension @ingroup ov_dimension_c_api @brief This is a structure interface equal to ov::Dimension
  • @struct ov_infer_request_t @ingroup ov_infer_request_c_api @brief type define ov_infer_request_t from ov_infer_request
  • @struct ov_layout_t @ingroup ov_layout_c_api @brief type define ov_layout_t from ov_layout
  • @struct ov_model_t @ingroup ov_model_c_api @brief type define ov_model_t from ov_model
  • @struct ov_output_const_port_t @ingroup ov_node_c_api @brief type define ov_output_const_port_t from ov_output_const_port
  • @struct ov_output_port_t @ingroup ov_node_c_api @brief type define ov_output_port_t from ov_output_port
  • @struct ov_partial_shape @ingroup ov_partial_shape_c_api @brief It represents a shape that may be partially or totally dynamic. A PartialShape may have: Dynamic rank. (Informal notation: ?) Static rank, but dynamic dimensions on some or all axes. (Informal notation examples: {1,2,?,4}, {?,?,?}, {-1,-1,-1}) Static rank, and static dimensions on all axes. (Informal notation examples: {1,2,3,4}, {6}, {})
  • @struct ov_preprocess_input_info_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_input_info_t from ov_preprocess_input_info
  • @struct ov_preprocess_input_model_info_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_input_model_info_t from ov_preprocess_input_model_info
  • @struct ov_preprocess_input_tensor_info_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_input_tensor_info_t from ov_preprocess_input_tensor_info
  • @struct ov_preprocess_output_info_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_output_info_t from ov_preprocess_output_info
  • @struct ov_preprocess_output_tensor_info_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_output_tensor_info_t from ov_preprocess_output_tensor_info
  • @struct ov_preprocess_prepostprocessor_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_prepostprocessor_t from ov_preprocess_prepostprocessor
  • @struct ov_preprocess_preprocess_steps_t @ingroup ov_prepostprocess_c_api @brief type define ov_preprocess_preprocess_steps_t from ov_preprocess_preprocess_steps
  • @struct ov_rank_t @ingroup ov_rank_c_api @brief type define ov_rank_t from ov_dimension_t
  • @struct ov_tensor_t @ingroup ov_tensor_c_api @brief type define ov_tensor_t from ov_tensor
  • @struct ov_version @ingroup ov_core_c_api @brief Represents OpenVINO version information