[C API][DOC]add doc capi reference (#13886)

* [Test] Build doc for C API reperence

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Test] Build doc for C API reperence add C path

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [Test] Build doc for C API reperence add C path

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [C API][DOC][DOXYGEN] refact the components of C API

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [DOC][API reference] remove useless code

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [C API][DOC] Modify format to generate api reference

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

* [DOC][API reference] fix doc build error

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>

Signed-off-by: xuejun <Xuejun.Zhai@intel.com>
This commit is contained in:
Xuejun Zhai authored and GitHub committed 2022-11-09 11:20:32 +04:00
1 parent 63bfeb7eba
commit 23882408c4
16 files changed
+723 -544

No files matched your search

+2 -1
View File
@@ -863,7 +863,8 @@ INPUT = "@MARKDOWN_INPUT@" \
"@OpenVINO_SOURCE_DIR@/src/core/shape_inference/include/" \
"@OpenVINO_SOURCE_DIR@/src/frontends/common/include/" \
"@OpenVINO_SOURCE_DIR@/src/inference/dev_api/" \
"@OpenVINO_SOURCE_DIR@/src/inference/include/"
"@OpenVINO_SOURCE_DIR@/src/inference/include/" \
"@OpenVINO_SOURCE_DIR@/src/bindings/c/include/openvino/c/"
# This tag can be used to specify the character encoding of the source files
+1 -1
View File
@@ -12,5 +12,5 @@ API references available:
:maxdepth: 2
../groupov_cpp_api
../groupie_c_api
../groupov_c_api
ie_python_api/api
+88 -21
View File
@@ -62,41 +62,104 @@
#endif
/**
* @enum ov_status_code_e
* @defgroup ov_c_api OpenVINO Runtime C API
* OpenVINO Runtime C API
*
* @defgroup ov_base_c_api Basics
* @ingroup ov_c_api
* @brief The basic definitions & interfaces of OpenVINO C API to work with other components
*
* @defgroup ov_compiled_model_c_api Compiled Model
* @ingroup ov_c_api
* @brief The operations about compiled model
*
* @defgroup ov_core_c_api Core
* @ingroup ov_c_api
* @brief The definitions & operations about core
*
* @defgroup ov_dimension_c_api Dimension
* @ingroup ov_c_api
* @brief The definitions & operations about dimension
*
* @defgroup ov_infer_request_c_api Infer Request
* @ingroup ov_c_api
* @brief The definitions & operations about infer request
*
* @defgroup ov_layout_c_api Layout
* @ingroup ov_c_api
* @brief The definitions & operations about layout
*
* @defgroup ov_model_c_api Model
* @ingroup ov_c_api
* @brief The definitions & operations about model
*
* @defgroup ov_node_c_api Node
* @ingroup ov_c_api
* @brief The definitions & operations about node
*
* @defgroup ov_partial_shape_c_api Partial Shape
* @ingroup ov_c_api
* @brief The definitions & operations about partial shape
*
* @defgroup ov_prepostprocess_c_api Pre Post Process
* @ingroup ov_c_api
* @brief The definitions & operations about prepostprocess
*
* @defgroup ov_property_c_api Property
* @ingroup ov_c_api
* @brief The definitions & operations about property
*
* @defgroup ov_rank_c_api Rank
* @ingroup ov_c_api
* @brief The definitions & operations about rank
*
* @defgroup ov_shape_c_api Shape
* @ingroup ov_c_api
* @brief The definitions & operations about shape
*
* @defgroup ov_tensor_c_api Tensor
* @ingroup ov_c_api
* @brief The definitions & operations about tensor
*/
/**
* @enum ov_status_e
* @ingroup ov_base_c_api
* @brief This enum contains codes for all possible return values of the interface functions
*/
typedef enum {
OK = 0,
OK = 0, //!< SUCCESS
/*
* @brief map exception to C++ interface
*/
GENERAL_ERROR = -1,
NOT_IMPLEMENTED = -2,
NETWORK_NOT_LOADED = -3,
PARAMETER_MISMATCH = -4,
NOT_FOUND = -5,
OUT_OF_BOUNDS = -6,
GENERAL_ERROR = -1, //!< GENERAL_ERROR
NOT_IMPLEMENTED = -2, //!< NOT_IMPLEMENTED
NETWORK_NOT_LOADED = -3, //!< NETWORK_NOT_LOADED
PARAMETER_MISMATCH = -4, //!< PARAMETER_MISMATCH
NOT_FOUND = -5, //!< NOT_FOUND
OUT_OF_BOUNDS = -6, //!< OUT_OF_BOUNDS
/*
* @brief exception not of std::exception derived type was thrown
*/
UNEXPECTED = -7,
REQUEST_BUSY = -8,
RESULT_NOT_READY = -9,
NOT_ALLOCATED = -10,
INFER_NOT_STARTED = -11,
NETWORK_NOT_READ = -12,
INFER_CANCELLED = -13,
UNEXPECTED = -7, //!< UNEXPECTED
REQUEST_BUSY = -8, //!< REQUEST_BUSY
RESULT_NOT_READY = -9, //!< RESULT_NOT_READY
NOT_ALLOCATED = -10, //!< NOT_ALLOCATED
INFER_NOT_STARTED = -11, //!< INFER_NOT_STARTED
NETWORK_NOT_READ = -12, //!< NETWORK_NOT_READ
INFER_CANCELLED = -13, //!< INFER_CANCELLED
/*
* @brief exception in C wrapper
*/
INVALID_C_PARAM = -14,
UNKNOWN_C_ERROR = -15,
NOT_IMPLEMENT_C_METHOD = -16,
UNKNOW_EXCEPTION = -17,
INVALID_C_PARAM = -14, //!< INVALID_C_PARAM
UNKNOWN_C_ERROR = -15, //!< UNKNOWN_C_ERROR
NOT_IMPLEMENT_C_METHOD = -16, //!< NOT_IMPLEMENT_C_METHOD
UNKNOW_EXCEPTION = -17, //!< UNKNOW_EXCEPTION
} ov_status_e;
/**
* @enum ov_element_type_e
* @ingroup ov_base_c_api
* @brief This enum contains codes for element type.
*/
typedef enum {
@@ -122,12 +185,16 @@ typedef enum {
/**
* @brief Print the error info.
* @ingroup ov_base_c_api
* @param ov_status_e a status code.
*/
OPENVINO_C_API(const char*) ov_get_error_info(ov_status_e status);
OPENVINO_C_API(const char*)
ov_get_error_info(ov_status_e status);
/**
* @brief free char
* @ingroup ov_base_c_api
* @param content The pointer to the char to free.
*/
OPENVINO_C_API(void) ov_free(const char* content);
OPENVINO_C_API(void)
ov_free(const char* content);
@@ -17,28 +17,26 @@
#include "openvino/c/ov_node.h"
#include "openvino/c/ov_property.h"
typedef struct ov_compiled_model ov_compiled_model_t;
// Compiled Model
/**
* @defgroup compiled_model compiled_model
* @ingroup openvino_c
* Set of functions representing of Compiled Model.
* @{
* @struct ov_compiled_model_t
* @ingroup ov_compiled_model_c_api
* @brief type define ov_compiled_model_t from ov_compiled_model
*/
typedef struct ov_compiled_model ov_compiled_model_t;
/**
* @brief Get the input size of ov_compiled_model_t.
* @ingroup compiled_model
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_compiled_model_inputs_size(const ov_compiled_model_t* compiled_model, size_t* size);
OPENVINO_C_API(ov_status_e)
ov_compiled_model_inputs_size(const ov_compiled_model_t* compiled_model, size_t* size);
/**
* @brief Get the single const input port of ov_compiled_model_t, which only support single input model.
* @ingroup compiled_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.
@@ -48,7 +46,7 @@ ov_compiled_model_input(const ov_compiled_model_t* compiled_model, ov_output_con
/**
* @brief Get a const input port of ov_compiled_model_t by port index.
* @ingroup compiled_model
* @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.
@@ -61,7 +59,7 @@ ov_compiled_model_input_by_index(const ov_compiled_model_t* compiled_model,
/**
* @brief Get a const input port of ov_compiled_model_t by name.
* @ingroup compiled_model
* @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.
@@ -74,27 +72,29 @@ ov_compiled_model_input_by_name(const ov_compiled_model_t* compiled_model,
/**
* @brief Get the output size of ov_compiled_model_t.
* @ingroup compiled_model
* @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.
* @param size the compiled_model's output size.
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(ov_status_e)
ov_compiled_model_outputs_size(const ov_compiled_model_t* compiled_model, size_t* size);
ov_compiled_model_outputs_size(const ov_compiled_model_t* compiled_model,
size_t* size);
/**
* @brief Get the single const output port of ov_compiled_model_t, which only support single output model.
* @ingroup compiled_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.
*/
OPENVINO_C_API(ov_status_e)
ov_compiled_model_output(const ov_compiled_model_t* compiled_model, ov_output_const_port_t** output_port);
ov_compiled_model_output(const ov_compiled_model_t* compiled_model,
ov_output_const_port_t** output_port);
/**
* @brief Get a const output port of ov_compiled_model_t by port index.
* @ingroup compiled_model
* @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.
@@ -107,7 +107,7 @@ ov_compiled_model_output_by_index(const ov_compiled_model_t* compiled_model,
/**
* @brief Get a const output port of ov_compiled_model_t by name.
* @ingroup compiled_model
* @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.
@@ -120,29 +120,30 @@ ov_compiled_model_output_by_name(const ov_compiled_model_t* compiled_model,
/**
* @brief Gets runtime model information from a device.
* @ingroup compiled_model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_compiled_model_get_runtime_model(const ov_compiled_model_t* compiled_model, ov_model_t** model);
ov_compiled_model_get_runtime_model(const ov_compiled_model_t* compiled_model,
ov_model_t** model);
/**
* @brief Creates an inference request object used to infer the compiled model.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e)
ov_compiled_model_create_infer_request(const ov_compiled_model_t* compiled_model, ov_infer_request_t** infer_request);
ov_compiled_model_create_infer_request(const ov_compiled_model_t* compiled_model,
ov_infer_request_t** infer_request);
/**
* @brief Sets properties for a device, acceptable keys can be found in ov_property_key_xxx.
* @ingroup compiled_model
* @ingroup ov_compiled_model_c_api
* @param compiled_model A pointer to the ov_compiled_model_t.
* @param property_key The property key.
* @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.
@@ -152,7 +153,7 @@ ov_compiled_model_set_property(const ov_compiled_model_t* compiled_model, ...);
/**
* @brief Gets properties for current compiled model.
* @ingroup 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.
@@ -166,19 +167,19 @@ ov_compiled_model_get_property(const ov_compiled_model_t* compiled_model,
/**
* @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 compiled_model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_compiled_model_export_model(const ov_compiled_model_t* compiled_model, const char* export_model_path);
ov_compiled_model_export_model(const ov_compiled_model_t* compiled_model,
const char* export_model_path);
/**
* @brief Release the memory allocated by ov_compiled_model_t.
* @ingroup compiled_model
* @ingroup ov_compiled_model_c_api
* @param compiled_model A pointer to the ov_compiled_model_t to free memory.
*/
OPENVINO_C_API(void) ov_compiled_model_free(ov_compiled_model_t* compiled_model);
/** @} */ // end of compiled_model
OPENVINO_C_API(void)
ov_compiled_model_free(ov_compiled_model_t* compiled_model);
+63 -49
View File
@@ -17,10 +17,16 @@
#include "openvino/c/ov_property.h"
#include "openvino/c/ov_tensor.h"
/**
* @struct ov_core_t
* @ingroup ov_core_c_api
* @brief type define ov_core_t from ov_core
*/
typedef struct ov_core ov_core_t;
/**
* @struct ov_version
* @ingroup ov_core_c_api
* @brief Represents OpenVINO version information
*/
typedef struct ov_version {
@@ -30,6 +36,7 @@ typedef struct ov_version {
/**
* @struct ov_core_version
* @ingroup ov_core_c_api
* @brief Represents version information that describes device and ov runtime library
*/
typedef struct {
@@ -39,6 +46,7 @@ typedef struct {
/**
* @struct ov_core_version_list
* @ingroup ov_core_c_api
* @brief Represents version information that describes all devices and ov runtime library
*/
typedef struct {
@@ -48,79 +56,77 @@ typedef struct {
/**
* @struct ov_available_devices_t
* @ingroup ov_core_c_api
* @brief Represent all available devices.
*/
typedef struct {
char** devices;
size_t size;
char** devices; //!< devices' name
size_t size; //!< devices' number
} ov_available_devices_t;
/**
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_get_openvino_version(ov_version_t* version);
OPENVINO_C_API(ov_status_e)
ov_get_openvino_version(ov_version_t* version);
/**
* @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.
*/
OPENVINO_C_API(void) ov_version_free(ov_version_t* version);
// OV Core
/**
* @defgroup Core Core
* @ingroup openvino_c
* Set of functions dedicated to working with registered plugins and loading
* model to the registered devices.
* @{
*/
OPENVINO_C_API(void)
ov_version_free(ov_version_t* version);
/**
* @brief Constructs OpenVINO Core instance by default.
* See RegisterPlugins for more details.
* @ingroup Core
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_core_create(ov_core_t** core);
OPENVINO_C_API(ov_status_e)
ov_core_create(ov_core_t** core);
/**
* @brief Constructs OpenVINO Core instance using XML configuration file with devices description.
* See RegisterPlugins for more details.
* @ingroup Core
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_core_create_with_config(const char* xml_config_file, ov_core_t** core);
OPENVINO_C_API(ov_status_e)
ov_core_create_with_config(const char* xml_config_file, ov_core_t** core);
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
/**
* @brief Constructs OpenVINO Core instance using XML configuration file with devices description.
* @brief Constructs OpenVINO Core instance.
* See RegisterPlugins for more details.
* @ingroup Core
* @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.
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_core_create_with_config_unicode(const wchar_t* xml_config_file_ws, ov_core_t** core);
OPENVINO_C_API(ov_status_e)
ov_core_create_with_config_unicode(const wchar_t* xml_config_file_ws, ov_core_t** core);
#endif
/**
* @brief Release the memory allocated by ov_core_t.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ov_core_t to free memory.
*/
OPENVINO_C_API(void) ov_core_free(ov_core_t* core);
OPENVINO_C_API(void)
ov_core_free(ov_core_t* core);
/**
* @brief Reads models from IR/ONNX/PDPD formats.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param model_path Path to a model.
* @param bin_path Path to a data file.
@@ -135,12 +141,15 @@ OPENVINO_C_API(void) ov_core_free(ov_core_t* core);
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(ov_status_e)
ov_core_read_model(const ov_core_t* core, const char* model_path, const char* bin_path, ov_model_t** model);
ov_core_read_model(const ov_core_t* core,
const char* model_path,
const char* bin_path,
ov_model_t** model);
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
/**
* @brief Reads models from IR/ONNX/PDPD formats, path is unicode.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param model_path Path to a model.
* @param bin_path Path to a data file.
@@ -163,7 +172,7 @@ ov_core_read_model_unicode(const ov_core_t* core,
/**
* @brief Reads models from IR/ONNX/PDPD formats.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param model_str String with a model in IR/ONNX/PDPD format.
* @param weights Shared pointer to a constant tensor with weights.
@@ -184,7 +193,7 @@ ov_core_read_model_from_memory(const ov_core_t* core,
* @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 Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param model Model object acquired from Core::read_model.
* @param device_name Name of a device to load a model to.
@@ -206,13 +215,13 @@ ov_core_compile_model(const ov_core_t* core,
* @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 Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_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 property paramater: Optional pack of pairs: <char* property_key, char* property_value> relevant only
* @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.
*/
@@ -229,13 +238,13 @@ ov_core_compile_model_from_file(const ov_core_t* core,
* @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 Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_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 property paramater: Optional pack of pairs: <char* property_key, char* property_value> relevant only
* @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.
*/
@@ -251,10 +260,9 @@ ov_core_compile_model_from_file_unicode(const ov_core_t* core,
/**
* @brief Sets properties for a device, acceptable keys can be found in ov_property_key_xxx.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param device_name Name of a device.
* @param property_key The property key.
* @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.
@@ -265,7 +273,7 @@ ov_core_set_property(const ov_core_t* core, const char* device_name, ...);
/**
* @brief Gets properties related to device behaviour.
* The method extracts information that can be set via the set_property method.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_core_t instance.
* @param device_name Name of a device to get a property value.
* @param property_key Property key.
@@ -273,29 +281,34 @@ ov_core_set_property(const ov_core_t* core, const char* device_name, ...);
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(ov_status_e)
ov_core_get_property(const ov_core_t* core, const char* device_name, const char* property_key, char** property_value);
ov_core_get_property(const ov_core_t* core,
const char* device_name,
const char* property_key,
char** property_value);
/**
* @brief Returns devices available for inference.
* @ingroup Core
* @ingroup ov_core_c_api
* @param core A pointer to the ie_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.
*/
OPENVINO_C_API(ov_status_e) ov_core_get_available_devices(const ov_core_t* core, ov_available_devices_t* devices);
OPENVINO_C_API(ov_status_e)
ov_core_get_available_devices(const ov_core_t* core, ov_available_devices_t* devices);
/**
* @brief Releases memory occpuied by ov_available_devices_t
* @ingroup Core
* @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.
*/
OPENVINO_C_API(void) ov_available_devices_free(ov_available_devices_t* devices);
OPENVINO_C_API(void)
ov_available_devices_free(ov_available_devices_t* devices);
/**
* @brief Imports a compiled model from the previously exported one.
* @ingroup Core
* @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.
@@ -314,20 +327,21 @@ ov_core_import_model(const ov_core_t* core,
* @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 Core
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_core_get_versions_by_device_name(const ov_core_t* core, const char* device_name, ov_core_version_list_t* versions);
ov_core_get_versions_by_device_name(const ov_core_t* core,
const char* device_name,
ov_core_version_list_t* versions);
/**
* @brief Releases memory occupied by ov_core_version_list_t.
* @ingroup Core
* @ingroup ov_core_c_api
* @param vers A pointer to the ie_core_versions to free memory.
*/
OPENVINO_C_API(void) ov_core_versions_free(ov_core_version_list_t* versions);
/** @} */ // end of Core
OPENVINO_C_API(void)
ov_core_versions_free(ov_core_version_list_t* versions);
@@ -14,6 +14,7 @@
/**
* @struct ov_dimension
* @ingroup ov_dimension_c_api
* @brief This is a structure interface equal to ov::Dimension
*/
typedef struct ov_dimension {
@@ -21,20 +22,11 @@ typedef struct ov_dimension {
int64_t max; //!< The upper inclusive limit for the dimension.
} ov_dimension_t;
// Dimension
/**
* @defgroup dimension dimension
* @ingroup openvino_c
* Set of functions representing of Dimension.
* @{
*/
/**
* @brief Check this dimension whether is dynamic
* @ingroup dimension
* @ingroup ov_dimension_c_api
* @param dim The dimension pointer that will be checked.
* @return Boolean, true is dynamic and false is static.
*/
OPENVINO_C_API(bool) ov_dimension_is_dynamic(const ov_dimension_t dim);
/** @} */ // end of Dimension
OPENVINO_C_API(bool)
ov_dimension_is_dynamic(const ov_dimension_t dim);
@@ -14,19 +14,26 @@
#include "openvino/c/ov_node.h"
#include "openvino/c/ov_tensor.h"
/**
* @struct ov_infer_request_t
* @ingroup ov_infer_request_c_api
* @brief type define ov_infer_request_t from ov_infer_request
*/
typedef struct ov_infer_request ov_infer_request_t;
/**
* @struct ov_callback_t
* @ingroup ov_infer_request_c_api
* @brief Completion callback definition about the function and args
*/
typedef struct {
void(OPENVINO_C_API_CALLBACK* callback_func)(void* args);
void* args;
void(OPENVINO_C_API_CALLBACK* callback_func)(void* args); //!< The callback func
void* args; //!< The args of callback func
} ov_callback_t;
/**
* @struct ov_ProfilingInfo_t
* @ingroup ov_infer_request_c_api
* @brief Store profiling info data
*/
typedef struct {
@@ -34,7 +41,7 @@ typedef struct {
NOT_RUN, //!< A node is not executed.
OPTIMIZED_OUT, //!< A node is optimized out during graph optimization phase.
EXECUTED //!< A node is executed.
} status;
} status; //!< status
int64_t real_time; //!< The absolute time, in microseconds, that the node ran (in total).
int64_t cpu_time; //!< The net host CPU time that the node ran.
const char* node_name; //!< Name of a node.
@@ -44,35 +51,30 @@ typedef struct {
/**
* @struct ov_profiling_info_list_t
* @ingroup ov_infer_request_c_api
* @brief A list of profiling info data
*/
typedef struct {
ov_profiling_info_t* profiling_infos;
size_t size;
ov_profiling_info_t* profiling_infos; //!< The list of ov_profilling_info_t
size_t size; //!< The list size
} ov_profiling_info_list_t;
// infer_request
/**
* @defgroup infer_request infer_request
* @ingroup openvino_c
* Set of functions representing of infer_request.
* @{
*/
/**
* @brief Set an input/output tensor to infer on by the name of tensor.
* @ingroup infer_request
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_infer_request_set_tensor(ov_infer_request_t* infer_request, const char* tensor_name, const ov_tensor_t* tensor);
ov_infer_request_set_tensor(ov_infer_request_t* infer_request,
const char* tensor_name,
const ov_tensor_t* tensor);
/**
* @brief Set an input/output tensor to infer request for the port.
* @ingroup infer_request
* @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.
@@ -85,7 +87,7 @@ ov_infer_request_set_tensor_by_port(ov_infer_request_t* infer_request,
/**
* @brief Set an input/output tensor to infer request for the port.
* @ingroup infer_request
* @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.
@@ -99,7 +101,7 @@ ov_infer_request_set_tensor_by_const_port(ov_infer_request_t* infer_request,
/**
* @brief Set an input tensor to infer on by the index of tensor.
* @ingroup infer_request
* @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.
@@ -113,7 +115,7 @@ ov_infer_request_set_input_tensor_by_index(ov_infer_request_t* infer_request,
/**
* @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 infer_request
* @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.
@@ -124,7 +126,7 @@ ov_infer_request_set_input_tensor(ov_infer_request_t* infer_request, const ov_te
/**
* @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 infer_request
* @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.
@@ -137,7 +139,7 @@ ov_infer_request_set_output_tensor_by_index(ov_infer_request_t* infer_request,
/**
* @brief Set an output tensor to infer models with single output.
* @ingroup infer_request
* @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.
@@ -148,18 +150,20 @@ ov_infer_request_set_output_tensor(ov_infer_request_t* infer_request, const ov_t
/**
* @brief Get an input/output tensor by the name of tensor.
* @note If model has several outputs, an error will return.
* @ingroup infer_request
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_infer_request_get_tensor(const ov_infer_request_t* infer_request, const char* tensor_name, ov_tensor_t** tensor);
ov_infer_request_get_tensor(const ov_infer_request_t* infer_request,
const char* tensor_name,
ov_tensor_t** tensor);
/**
* @brief Get an input/output tensor by const port.
* @ingroup infer_request
* @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.
@@ -172,7 +176,7 @@ ov_infer_request_get_tensor_by_const_port(const ov_infer_request_t* infer_reques
/**
* @brief Get an input/output tensor by port.
* @ingroup infer_request
* @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.
@@ -185,7 +189,7 @@ ov_infer_request_get_tensor_by_port(const ov_infer_request_t* infer_request,
/**
* @brief Get an input tensor by the index of input tensor.
* @ingroup infer_request
* @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.
@@ -199,17 +203,18 @@ ov_infer_request_get_input_tensor_by_index(const ov_infer_request_t* infer_reque
/**
* @brief Get an input tensor from the model with only one input tensor.
* @ingroup infer_request
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_infer_request_get_input_tensor(const ov_infer_request_t* infer_request, ov_tensor_t** tensor);
ov_infer_request_get_input_tensor(const ov_infer_request_t* infer_request,
ov_tensor_t** tensor);
/**
* @brief Get an output tensor by the index of output tensor.
* @ingroup infer_request
* @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.
@@ -224,59 +229,65 @@ ov_infer_request_get_output_tensor_by_index(const ov_infer_request_t* infer_requ
/**
* @brief Get an output tensor from the model with only one output tensor.
* @note If model has several outputs, an error will return.
* @ingroup infer_request
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_infer_request_get_output_tensor(const ov_infer_request_t* infer_request, ov_tensor_t** tensor);
ov_infer_request_get_output_tensor(const ov_infer_request_t* infer_request,
ov_tensor_t** tensor);
/**
* @brief Infer specified input(s) in synchronous mode.
* @ingroup infer_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.
*/
OPENVINO_C_API(ov_status_e) ov_infer_request_infer(ov_infer_request_t* infer_request);
OPENVINO_C_API(ov_status_e)
ov_infer_request_infer(ov_infer_request_t* infer_request);
/**
* @brief Cancel inference request.
* @ingroup infer_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.
*/
OPENVINO_C_API(ov_status_e) ov_infer_request_cancel(ov_infer_request_t* infer_request);
OPENVINO_C_API(ov_status_e)
ov_infer_request_cancel(ov_infer_request_t* infer_request);
/**
* @brief Start inference of specified input(s) in asynchronous mode.
* @ingroup infer_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.
*/
OPENVINO_C_API(ov_status_e) ov_infer_request_start_async(ov_infer_request_t* infer_request);
OPENVINO_C_API(ov_status_e)
ov_infer_request_start_async(ov_infer_request_t* infer_request);
/**
* @brief Wait for the result to become available.
* @ingroup infer_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.
*/
OPENVINO_C_API(ov_status_e) ov_infer_request_wait(ov_infer_request_t* infer_request);
OPENVINO_C_API(ov_status_e)
ov_infer_request_wait(ov_infer_request_t* infer_request);
/**
* @brief Waits for the result to become available. Blocks until the specified timeout has elapsed or the result
* becomes available, whichever comes first.
* @ingroup infer_request
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_infer_request_wait_for(ov_infer_request_t* infer_request, const int64_t timeout);
OPENVINO_C_API(ov_status_e)
ov_infer_request_wait_for(ov_infer_request_t* infer_request, const int64_t timeout);
/**
* @brief Set callback function, which will be called when inference is done.
* @ingroup infer_request
* @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.
@@ -286,14 +297,15 @@ ov_infer_request_set_callback(ov_infer_request_t* infer_request, const ov_callba
/**
* @brief Release the memory allocated by ov_infer_request_t.
* @ingroup infer_request
* @ingroup ov_infer_request_c_api
* @param infer_request A pointer to the ov_infer_request_t to free memory.
*/
OPENVINO_C_API(void) ov_infer_request_free(ov_infer_request_t* infer_request);
OPENVINO_C_API(void)
ov_infer_request_free(ov_infer_request_t* infer_request);
/**
* @brief Query performance measures per layer to identify the most time consuming operation.
* @ingroup infer_request
* @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.
@@ -303,9 +315,8 @@ ov_infer_request_get_profiling_info(const ov_infer_request_t* infer_request, ov_
/**
* @brief Release the memory allocated by ov_profiling_info_list_t.
* @ingroup infer_request
* @ingroup ov_infer_request_c_api
* @param profiling_infos A pointer to the ov_profiling_info_list_t to free memory.
*/
OPENVINO_C_API(void) ov_profiling_info_list_free(ov_profiling_info_list_t* profiling_infos);
/** @} */ // end of infer_request
OPENVINO_C_API(void)
ov_profiling_info_list_free(ov_profiling_info_list_t* profiling_infos);
+13 -15
View File
@@ -12,38 +12,36 @@
#include "openvino/c/ov_common.h"
typedef struct ov_layout ov_layout_t;
// Layout
/**
* @defgroup layout layout
* @ingroup openvino_c
* Set of functions representing of Layout.
* @{
* @struct ov_layout_t
* @ingroup ov_layout_c_api
* @brief type define ov_layout_t from ov_layout
*/
typedef struct ov_layout ov_layout_t;
/**
* @brief Create a layout object.
* @ingroup layout
* @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
*/
OPENVINO_C_API(ov_status_e) ov_layout_create(const char* layout_desc, ov_layout_t** layout);
OPENVINO_C_API(ov_status_e)
ov_layout_create(const char* layout_desc, ov_layout_t** layout);
/**
* @brief Free layout object.
* @ingroup layout
* @ingroup ov_layout_c_api
* @param layout will be released.
*/
OPENVINO_C_API(void) ov_layout_free(ov_layout_t* layout);
OPENVINO_C_API(void)
ov_layout_free(ov_layout_t* layout);
/**
* @brief Convert layout object to a readable string.
* @ingroup layout
* @ingroup ov_layout_c_api
* @param layout will be converted.
* @return string that describes the layout content.
*/
OPENVINO_C_API(const char*) ov_layout_to_string(const ov_layout_t* layout);
/** @} */ // end of Layout
OPENVINO_C_API(const char*)
ov_layout_to_string(const ov_layout_t* layout);
+55 -43
View File
@@ -14,77 +14,83 @@
#include "openvino/c/ov_node.h"
#include "openvino/c/ov_partial_shape.h"
typedef struct ov_model ov_model_t;
// Model
/**
* @defgroup model model
* @ingroup openvino_c
* Set of functions representing of Model and Node.
* @{
* @struct ov_model_t
* @ingroup ov_model_c_api
* @brief type define ov_model_t from ov_model
*/
typedef struct ov_model ov_model_t;
/**
* @brief Release the memory allocated by ov_model_t.
* @ingroup model
* @ingroup ov_model_c_api
* @param model A pointer to the ov_model_t to free memory.
*/
OPENVINO_C_API(void) ov_model_free(ov_model_t* model);
OPENVINO_C_API(void)
ov_model_free(ov_model_t* model);
/**
* @brief Get a const input port of ov_model_t,which only support single input model.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_model_const_input(const ov_model_t* model, ov_output_const_port_t** input_port);
OPENVINO_C_API(ov_status_e)
ov_model_const_input(const ov_model_t* model, ov_output_const_port_t** input_port);
/**
* @brief Get a const input port of ov_model_t by name.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_model_const_input_by_name(const ov_model_t* model, const char* tensor_name, ov_output_const_port_t** input_port);
ov_model_const_input_by_name(const ov_model_t* model,
const char* tensor_name,
ov_output_const_port_t** input_port);
/**
* @brief Get a const input port of ov_model_t by port index.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_model_const_input_by_index(const ov_model_t* model, const size_t index, ov_output_const_port_t** input_port);
ov_model_const_input_by_index(const ov_model_t* model,
const size_t index,
ov_output_const_port_t** input_port);
/**
* @brief Get single input port of ov_model_t, which only support single input model.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_model_input(const ov_model_t* model, ov_output_port_t** input_port);
OPENVINO_C_API(ov_status_e)
ov_model_input(const ov_model_t* model, ov_output_port_t** input_port);
/**
* @brief Get an input port of ov_model_t by name.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_model_input_by_name(const ov_model_t* model, const char* tensor_name, ov_output_port_t** input_port);
ov_model_input_by_name(const ov_model_t* model,
const char* tensor_name,
ov_output_port_t** input_port);
/**
* @brief Get an input port of ov_model_t by port index.
* @ingroup model
* @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.
@@ -95,16 +101,17 @@ ov_model_input_by_index(const ov_model_t* model, const size_t index, ov_output_p
/**
* @brief Get a single const output port of ov_model_t, which only support single output model..
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_model_const_output(const ov_model_t* model, ov_output_const_port_t** output_port);
OPENVINO_C_API(ov_status_e)
ov_model_const_output(const ov_model_t* model, ov_output_const_port_t** output_port);
/**
* @brief Get a const output port of ov_model_t by port index.
* @ingroup model
* @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.
@@ -115,27 +122,30 @@ ov_model_const_output_by_index(const ov_model_t* model, const size_t index, ov_o
/**
* @brief Get a const output port of ov_model_t by name.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_model_const_output_by_name(const ov_model_t* model, const char* tensor_name, ov_output_const_port_t** output_port);
ov_model_const_output_by_name(const ov_model_t* model,
const char* tensor_name,
ov_output_const_port_t** output_port);
/**
* @brief Get an single output port of ov_model_t, which only support single output model.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_model_output(const ov_model_t* model, ov_output_port_t** output_port);
OPENVINO_C_API(ov_status_e)
ov_model_output(const ov_model_t* model, ov_output_port_t** output_port);
/**
* @brief Get an output port of ov_model_t by port index.
* @ingroup model
* @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.
@@ -146,7 +156,7 @@ ov_model_output_by_index(const ov_model_t* model, const size_t index, ov_output_
/**
* @brief Get an output port of ov_model_t by name.
* @ingroup model
* @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.
@@ -157,32 +167,35 @@ ov_model_output_by_name(const ov_model_t* model, const char* tensor_name, ov_out
/**
* @brief Get the input size of ov_model_t.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_model_inputs_size(const ov_model_t* model, size_t* input_size);
OPENVINO_C_API(ov_status_e)
ov_model_inputs_size(const ov_model_t* model, size_t* input_size);
/**
* @brief Get the output size of ov_model_t.
* @ingroup model
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_model_outputs_size(const ov_model_t* model, size_t* output_size);
OPENVINO_C_API(ov_status_e)
ov_model_outputs_size(const ov_model_t* model, size_t* output_size);
/**
* @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
*/
OPENVINO_C_API(bool) ov_model_is_dynamic(const ov_model_t* model);
OPENVINO_C_API(bool)
ov_model_is_dynamic(const ov_model_t* model);
/**
* @brief Do reshape in model with a list of <name, partial shape>.
* @ingroup model
* @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.
@@ -197,7 +210,7 @@ ov_model_reshape(const ov_model_t* model,
/**
* @brief Do reshape in model with partial shape for a specified name.
* @ingroup model
* @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.
@@ -210,7 +223,7 @@ ov_model_reshape_input_by_name(const ov_model_t* model,
/**
* @brief Do reshape in model for one node(port 0).
* @ingroup model
* @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.
@@ -220,7 +233,7 @@ ov_model_reshape_single_input(const ov_model_t* model, const ov_partial_shape_t
/**
* @brief Do reshape in model with a list of <port id, partial shape>.
* @ingroup model
* @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.
@@ -235,7 +248,7 @@ ov_model_reshape_by_port_indexes(const ov_model_t* model,
/**
* @brief Do reshape in model with a list of <ov_output_port_t, partial shape>.
* @ingroup model
* @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.
@@ -250,11 +263,10 @@ ov_model_reshape_by_ports(const ov_model_t* model,
/**
* @brief Gets the friendly name for a model.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_model_get_friendly_name(const ov_model_t* model, char** friendly_name);
/** @} */ // end of Model
OPENVINO_C_API(ov_status_e)
ov_model_get_friendly_name(const ov_model_t* model, char** friendly_name);
+26 -21
View File
@@ -14,38 +14,43 @@
#include "openvino/c/ov_partial_shape.h"
#include "openvino/c/ov_shape.h"
typedef struct ov_output_const_port ov_output_const_port_t;
typedef struct ov_output_port ov_output_port_t;
// Node
/**
* @defgroup node node
* @ingroup openvino_c
* Set of functions representing of Model and Node.
* @{
* @struct ov_output_const_port_t
* @ingroup ov_node_c_api
* @brief type define ov_output_const_port_t from ov_output_const_port
*/
typedef struct ov_output_const_port ov_output_const_port_t;
/**
* @struct ov_output_port_t
* @ingroup ov_node_c_api
* @brief type define ov_output_port_t from ov_output_port
*/
typedef struct ov_output_port ov_output_port_t;
/**
* @brief Get the shape of port object.
* @ingroup node
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_const_port_get_shape(const ov_output_const_port_t* port, ov_shape_t* tensor_shape);
OPENVINO_C_API(ov_status_e)
ov_const_port_get_shape(const ov_output_const_port_t* port, ov_shape_t* tensor_shape);
/**
* @brief Get the shape of port object.
* @ingroup node
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_port_get_shape(const ov_output_port_t* port, ov_shape_t* tensor_shape);
OPENVINO_C_API(ov_status_e)
ov_port_get_shape(const ov_output_port_t* port, ov_shape_t* tensor_shape);
/**
* @brief Get the tensor name of port.
* @ingroup node
* @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.
@@ -55,7 +60,7 @@ ov_port_get_any_name(const ov_output_const_port_t* port, char** tensor_name);
/**
* @brief Get the partial shape of port.
* @ingroup node
* @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.
@@ -65,7 +70,7 @@ ov_port_get_partial_shape(const ov_output_const_port_t* port, ov_partial_shape_t
/**
* @brief Get the tensor type of port.
* @ingroup node
* @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.
@@ -75,16 +80,16 @@ ov_port_get_element_type(const ov_output_const_port_t* port, ov_element_type_e*
/**
* @brief free port object
* @ingroup node
* @ingroup ov_node_c_api
* @param port The pointer to the instance of the ov_output_port_t to free.
*/
OPENVINO_C_API(void) ov_output_port_free(ov_output_port_t* port);
OPENVINO_C_API(void)
ov_output_port_free(ov_output_port_t* port);
/**
* @brief free const port
* @ingroup node
* @ingroup ov_node_c_api
* @param port The pointer to the instance of the ov_output_const_port_t to free.
*/
OPENVINO_C_API(void) ov_output_const_port_free(ov_output_const_port_t* port);
/** @} */ // end of Node
OPENVINO_C_API(void)
ov_output_const_port_free(ov_output_const_port_t* port);
@@ -18,6 +18,7 @@
/**
* @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: `?`)
@@ -29,21 +30,13 @@
* An interface to make user can initialize ov_partial_shape_t
*/
typedef struct ov_partial_shape {
ov_rank_t rank;
ov_dimension_t* dims;
ov_rank_t rank; //!< The rank
ov_dimension_t* dims; //!< The dimension
} ov_partial_shape_t;
// PartialShape
/**
* @defgroup partial_shape partial_shape
* @ingroup openvino_c
* Set of functions representing PartialShape.
* @{
*/
/**
* @brief Initialze a partial shape with static rank and dynamic dimension.
* @ingroup partial_shape
* @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.
@@ -54,11 +47,13 @@ typedef struct ov_partial_shape {
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(ov_status_e)
ov_partial_shape_create(const int64_t rank, const ov_dimension_t* dims, ov_partial_shape_t* partial_shape_obj);
ov_partial_shape_create(const int64_t rank,
const ov_dimension_t* dims,
ov_partial_shape_t* partial_shape_obj);
/**
* @brief Initialze a partial shape with dynamic rank and dynamic dimension.
* @ingroup partial_shape
* @ingroup ov_partial_shape_c_api
* @param rank support dynamic and static rank.
* @param dims support dynamic and static dimension.
* Dynamic rank:
@@ -77,7 +72,7 @@ ov_partial_shape_create_dynamic(const ov_rank_t rank,
/**
* @brief Initialize a partial shape with static rank and static dimension.
* @ingroup partial_shape
* @ingroup ov_partial_shape_c_api
* @param rank support static rank.
* @param dims support static dimension.
* Static rank, and static dimensions on all axes.
@@ -86,48 +81,53 @@ ov_partial_shape_create_dynamic(const ov_rank_t rank,
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(ov_status_e)
ov_partial_shape_create_static(const int64_t rank, const int64_t* dims, ov_partial_shape_t* partial_shape_obj);
ov_partial_shape_create_static(const int64_t rank,
const int64_t* dims,
ov_partial_shape_t* partial_shape_obj);
/**
* @brief Release internal memory allocated in partial shape.
* @ingroup 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.
*/
OPENVINO_C_API(void) ov_partial_shape_free(ov_partial_shape_t* partial_shape);
OPENVINO_C_API(void)
ov_partial_shape_free(ov_partial_shape_t* partial_shape);
/**
* @brief Convert partial shape without dynamic data to a static shape.
* @ingroup partial_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.
*/
OPENVINO_C_API(ov_status_e) ov_partial_shape_to_shape(const ov_partial_shape_t partial_shape, ov_shape_t* shape);
OPENVINO_C_API(ov_status_e)
ov_partial_shape_to_shape(const ov_partial_shape_t partial_shape, ov_shape_t* shape);
/**
* @brief Convert shape to partial shape.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_shape_to_partial_shape(const ov_shape_t shape, ov_partial_shape_t* partial_shape);
OPENVINO_C_API(ov_status_e)
ov_shape_to_partial_shape(const ov_shape_t shape, ov_partial_shape_t* partial_shape);
/**
* @brief Check this partial_shape whether is dynamic
* @ingroup partial_shape
* @ingroup ov_partial_shape_c_api
* @param partial_shape The partial_shape pointer.
* @return Status code of the operation: OK(0) for success.
*/
OPENVINO_C_API(bool) ov_partial_shape_is_dynamic(const ov_partial_shape_t partial_shape);
OPENVINO_C_API(bool)
ov_partial_shape_is_dynamic(const ov_partial_shape_t partial_shape);
/**
* @brief Helper function, convert a partial shape to readable string.
* @ingroup partial_shape
* @ingroup ov_partial_shape_c_api
* @param partial_shape The partial_shape pointer.
* @return A string reprensts partial_shape's content.
*/
OPENVINO_C_API(const char*) ov_partial_shape_to_string(const ov_partial_shape_t partial_shape);
/** @} */ // end of partial_shape
OPENVINO_C_API(const char*)
ov_partial_shape_to_string(const ov_partial_shape_t partial_shape);
@@ -15,16 +15,58 @@
#include "openvino/c/ov_model.h"
#include "openvino/c/ov_tensor.h"
/**
* @struct ov_preprocess_prepostprocessor_t
* @ingroup ov_prepostprocess_c_api
* @brief type define ov_preprocess_prepostprocessor_t from ov_preprocess_prepostprocessor
*/
typedef struct ov_preprocess_prepostprocessor ov_preprocess_prepostprocessor_t;
/**
* @struct ov_preprocess_input_info_t
* @ingroup ov_prepostprocess_c_api
* @brief type define ov_preprocess_input_info_t from ov_preprocess_input_info
*/
typedef struct ov_preprocess_input_info ov_preprocess_input_info_t;
/**
* @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
*/
typedef struct ov_preprocess_input_tensor_info ov_preprocess_input_tensor_info_t;
/**
* @struct ov_preprocess_output_info_t
* @ingroup ov_prepostprocess_c_api
* @brief type define ov_preprocess_output_info_t from ov_preprocess_output_info
*/
typedef struct ov_preprocess_output_info ov_preprocess_output_info_t;
/**
* @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
*/
typedef struct ov_preprocess_output_tensor_info ov_preprocess_output_tensor_info_t;
/**
* @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
*/
typedef struct ov_preprocess_input_model_info ov_preprocess_input_model_info_t;
/**
* @struct ov_preprocess_preprocess_steps_t
* @ingroup ov_prepostprocess_c_api
* @brief type define ov_preprocess_preprocess_steps_t from ov_preprocess_preprocess_steps
*/
typedef struct ov_preprocess_preprocess_steps ov_preprocess_preprocess_steps_t;
/**
* @enum ov_color_format_e
* @ingroup ov_prepostprocess_c_api
* @brief This enum contains enumerations for color format.
*/
typedef enum {
@@ -41,6 +83,7 @@ typedef enum {
/**
* @enum ov_preprocess_resize_algorithm_e
* @ingroup ov_prepostprocess_c_api
* @brief This enum contains codes for all preprocess resize algorithm.
*/
typedef enum {
@@ -49,90 +92,88 @@ typedef enum {
RESIZE_NEAREST //!< nearest algorithm
} ov_preprocess_resize_algorithm_e;
// prepostprocess
/**
* @defgroup prepostprocess prepostprocess
* @ingroup openvino_c
* Set of functions representing of PrePostProcess.
* @{
*/
/**
* @brief Create a ov_preprocess_prepostprocessor_t instance.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_create(const ov_model_t* model, ov_preprocess_prepostprocessor_t** preprocess);
ov_preprocess_prepostprocessor_create(const ov_model_t* model,
ov_preprocess_prepostprocessor_t** preprocess);
/**
* @brief Release the memory allocated by ov_preprocess_prepostprocessor_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess A pointer to the ov_preprocess_prepostprocessor_t to free memory.
*/
OPENVINO_C_API(void) ov_preprocess_prepostprocessor_free(ov_preprocess_prepostprocessor_t* preprocess);
OPENVINO_C_API(void)
ov_preprocess_prepostprocessor_free(ov_preprocess_prepostprocessor_t* preprocess);
/**
* @brief Get the input info of ov_preprocess_prepostprocessor_t instance.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info(const ov_preprocess_prepostprocessor_t* preprocess,
ov_preprocess_input_info_t** preprocess_input_info);
ov_preprocess_prepostprocessor_get_input_info(
const ov_preprocess_prepostprocessor_t* preprocess,
ov_preprocess_input_info_t** preprocess_input_info);
/**
* @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor name.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info_by_name(const ov_preprocess_prepostprocessor_t* preprocess,
const char* tensor_name,
ov_preprocess_input_info_t** preprocess_input_info);
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info_by_name(
const ov_preprocess_prepostprocessor_t* preprocess,
const char* tensor_name,
ov_preprocess_input_info_t** preprocess_input_info);
/**
* @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor order.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info_by_index(const ov_preprocess_prepostprocessor_t* preprocess,
const size_t tensor_index,
ov_preprocess_input_info_t** preprocess_input_info);
ov_preprocess_prepostprocessor_get_input_info_by_index(
const ov_preprocess_prepostprocessor_t* preprocess,
const size_t tensor_index,
ov_preprocess_input_info_t** preprocess_input_info);
/**
* @brief Release the memory allocated by ov_preprocess_input_info_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_input_info A pointer to the ov_preprocess_input_info_t to free memory.
*/
OPENVINO_C_API(void) ov_preprocess_input_info_free(ov_preprocess_input_info_t* preprocess_input_info);
OPENVINO_C_API(void)
ov_preprocess_input_info_free(ov_preprocess_input_info_t* preprocess_input_info);
/**
* @brief Get a ov_preprocess_input_tensor_info_t.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_tensor_info(const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_input_tensor_info_t** preprocess_input_tensor_info);
ov_preprocess_input_info_get_tensor_info(
const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_input_tensor_info_t** preprocess_input_tensor_info);
/**
* @brief Release the memory allocated by ov_preprocess_input_tensor_info_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_input_tensor_info A pointer to the ov_preprocess_input_tensor_info_t to free memory.
*/
OPENVINO_C_API(void)
@@ -140,216 +181,234 @@ ov_preprocess_input_tensor_info_free(ov_preprocess_input_tensor_info_t* preproce
/**
* @brief Get a ov_preprocess_preprocess_steps_t.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_preprocess_steps(const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_preprocess_steps_t** preprocess_input_steps);
ov_preprocess_input_info_get_preprocess_steps(
const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_preprocess_steps_t** preprocess_input_steps);
/**
* @brief Release the memory allocated by ov_preprocess_preprocess_steps_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t to free memory.
*/
OPENVINO_C_API(void)
ov_preprocess_preprocess_steps_free(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps);
ov_preprocess_preprocess_steps_free(
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps);
/**
* @brief Add resize operation to model's dimensions.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_resize(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_preprocess_resize_algorithm_e resize_algorithm);
ov_preprocess_preprocess_steps_resize(
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_preprocess_resize_algorithm_e resize_algorithm);
/**
* @brief Set ov_preprocess_input_tensor_info_t precesion.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_element_type(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_element_type_e element_type);
ov_preprocess_input_tensor_info_set_element_type(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_element_type_e element_type);
/**
* @brief Set ov_preprocess_input_tensor_info_t color format.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_color_format(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_color_format_e colorFormat);
ov_preprocess_input_tensor_info_set_color_format(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_color_format_e colorFormat);
/**
* @brief Set ov_preprocess_input_tensor_info_t spatial_static_shape.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_spatial_static_shape(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const size_t input_height,
const size_t input_width);
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const size_t input_height,
const size_t input_width);
/**
* @brief Convert ov_preprocess_preprocess_steps_t element type.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_convert_element_type(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_element_type_e element_type);
ov_preprocess_preprocess_steps_convert_element_type(
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_element_type_e element_type);
/**
* @brief Convert ov_preprocess_preprocess_steps_t color.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t.
* @param colorFormat The enumerate of colorFormat.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_convert_color(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_color_format_e colorFormat);
ov_preprocess_preprocess_steps_convert_color(
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
const ov_color_format_e colorFormat);
/**
* @brief Helper function to reuse element type and shape from user's created tensor.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_from(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_tensor_t* tensor);
ov_preprocess_input_tensor_info_set_from(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const ov_tensor_t* tensor);
/**
* @brief Set ov_preprocess_input_tensor_info_t layout.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_layout(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
ov_layout_t* layout);
ov_preprocess_input_tensor_info_set_layout(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
ov_layout_t* layout);
/**
* @brief Get the output info of ov_preprocess_output_info_t instance.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info(const ov_preprocess_prepostprocessor_t* preprocess,
ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_prepostprocessor_get_output_info(
const ov_preprocess_prepostprocessor_t* preprocess,
ov_preprocess_output_info_t** preprocess_output_info);
/**
* @brief Get the output info of ov_preprocess_output_info_t instance.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info_by_index(const ov_preprocess_prepostprocessor_t* preprocess,
const size_t tensor_index,
ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_prepostprocessor_get_output_info_by_index(
const ov_preprocess_prepostprocessor_t* preprocess,
const size_t tensor_index,
ov_preprocess_output_info_t** preprocess_output_info);
/**
* @brief Get the output info of ov_preprocess_output_info_t instance.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info_by_name(const ov_preprocess_prepostprocessor_t* preprocess,
const char* tensor_name,
ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_prepostprocessor_get_output_info_by_name(
const ov_preprocess_prepostprocessor_t* preprocess,
const char* tensor_name,
ov_preprocess_output_info_t** preprocess_output_info);
/**
* @brief Release the memory allocated by ov_preprocess_output_info_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_output_info A pointer to the ov_preprocess_output_info_t to free memory.
*/
OPENVINO_C_API(void) ov_preprocess_output_info_free(ov_preprocess_output_info_t* preprocess_output_info);
OPENVINO_C_API(void)
ov_preprocess_output_info_free(ov_preprocess_output_info_t* preprocess_output_info);
/**
* @brief Get a ov_preprocess_input_tensor_info_t.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_output_info_get_tensor_info(const ov_preprocess_output_info_t* preprocess_output_info,
ov_preprocess_output_tensor_info_t** preprocess_output_tensor_info);
ov_preprocess_output_info_get_tensor_info(
const ov_preprocess_output_info_t* preprocess_output_info,
ov_preprocess_output_tensor_info_t** preprocess_output_tensor_info);
/**
* @brief Release the memory allocated by ov_preprocess_output_tensor_info_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_output_tensor_info A pointer to the ov_preprocess_output_tensor_info_t to free memory.
*/
OPENVINO_C_API(void)
ov_preprocess_output_tensor_info_free(ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info);
ov_preprocess_output_tensor_info_free(
ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info);
/**
* @brief Set ov_preprocess_input_tensor_info_t precesion.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_output_set_element_type(ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info,
const ov_element_type_e element_type);
ov_preprocess_output_set_element_type(
ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info,
const ov_element_type_e element_type);
/**
* @brief Get current input model information.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_model_info(const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_input_model_info_t** preprocess_input_model_info);
ov_preprocess_input_info_get_model_info(
const ov_preprocess_input_info_t* preprocess_input_info,
ov_preprocess_input_model_info_t** preprocess_input_model_info);
/**
* @brief Release the memory allocated by ov_preprocess_input_model_info_t.
* @ingroup prepostprocess
* @ingroup ov_prepostprocess_c_api
* @param preprocess_input_model_info A pointer to the ov_preprocess_input_model_info_t to free memory.
*/
OPENVINO_C_API(void) ov_preprocess_input_model_info_free(ov_preprocess_input_model_info_t* preprocess_input_model_info);
OPENVINO_C_API(void)
ov_preprocess_input_model_info_free(ov_preprocess_input_model_info_t* preprocess_input_model_info);
/**
* @brief Set layout for model's input tensor.
* @ingroup prepostprocess
* @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
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_input_model_info_set_layout(ov_preprocess_input_model_info_t* preprocess_input_model_info,
ov_layout_t* layout);
ov_preprocess_input_model_info_set_layout(
ov_preprocess_input_model_info_t* preprocess_input_model_info,
ov_layout_t* layout);
/**
* @brief Adds pre/post-processing operations to function passed in constructor.
* @ingroup prepostprocess
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_build(const ov_preprocess_prepostprocessor_t* preprocess, ov_model_t** model);
/** @} */ // end of prepostprocess
ov_preprocess_prepostprocessor_build(
const ov_preprocess_prepostprocessor_t* preprocess, ov_model_t** model);
+152 -136
View File
@@ -14,144 +14,160 @@
#include "openvino/c/ov_common.h"
/**
* @brief property key
* @brief Read-only property<string> to get a string list of supported read-only properties.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_supported_properties;
//!< Read-only property<string> to get a string list of supported read-only properties.
OPENVINO_C_VAR(const char*) ov_property_key_supported_properties;
//!< Read-only property<string> to get a list of available device IDs
OPENVINO_C_VAR(const char*) ov_property_key_available_devices;
//!< Read-only property<uint32_t string> to get an unsigned integer value of optimaln
//!< number of compiled model infer requests.
OPENVINO_C_VAR(const char*) ov_property_key_optimal_number_of_infer_requests;
//!< Read-only property<string(unsigned int, unsigned int, unsigned int)> to provide a
//!< hint for a range for number of async infer requests. If device supports
//!< streams, the metric provides range for number of IRs per stream.
OPENVINO_C_VAR(const char*) ov_property_key_range_for_async_infer_requests;
//!< Read-only property<string(unsigned int, unsigned int)> to provide information about a range for
//!< streams on platforms where streams are supported
OPENVINO_C_VAR(const char*) ov_property_key_range_for_streams;
//!< Read-only property<string> to get a string value representing a full device name.
OPENVINO_C_VAR(const char*) ov_property_key_device_full_name;
//!< Read-only property<string> to get a string list of capabilities options per device.
OPENVINO_C_VAR(const char*) ov_property_key_device_capabilities;
//!< Read-only property<string> to get a name of name of a model
OPENVINO_C_VAR(const char*) ov_property_key_model_name;
//!< Read-only property<uint32_t string> to query information optimal batch size for the given device
//!< and the network
OPENVINO_C_VAR(const char*) ov_property_key_optimal_batch_size;
//!< Read-only property to get maximum batch size which does not cause performance degradation due
//!< to memory swap impact.
OPENVINO_C_VAR(const char*) ov_property_key_max_batch_size;
//!< Read-write property<string> to set/get the directory which will be used to store any data cached
//!< by plugins.
OPENVINO_C_VAR(const char*) ov_property_key_cache_dir;
//!< Read-write property<uint32_t string> to set/get the number of executor logical partitions.
OPENVINO_C_VAR(const char*) ov_property_key_num_streams;
//!< Read-write property to set/get the name for setting CPU affinity per thread option.
//!< All property values are string format, below are optional value:
//!< "NONE" - Disable threads affinity pinning
//!< "CORE" - Pin threads to cores, best for static benchmarks
//!< "NUMA" - Pin threads to NUMA nodes, best for real-life, contented cases. On the Windows and MacOS* this
//!< option behaves as CORE
//!< "HYBRID_AWARE" - Let the runtime to do pinning to the cores types, e.g. prefer the "big" cores for latency
//!< tasks. On the hybrid CPUs this option is default.
OPENVINO_C_VAR(const char*) ov_property_key_affinity;
//!< Read-write property<int32_t string> to set/get the maximum number of threads that can be used
//!< for inference tasks.
OPENVINO_C_VAR(const char*) ov_property_key_inference_num_threads;
//!< Read-write property, it is high-level OpenVINO Performance Hints
//!< unlike low-level properties that are individual (per-device), the hints are something that
//!< every device accepts and turns into device-specific settings detail.
//!< All property values are string, below are optional value:
//!< "UNDEFINED_MODE" - Undefined value, performance setting may vary from device to device
//!< "LATENCY" - Optimize for latency
//!< "THROUGHPUT" - Optimize for throughput
//!< "CUMULATIVE_THROUGHPUT" - Optimize for cumulative throughput
OPENVINO_C_VAR(const char*) ov_property_key_hint_performance_mode;
//!< Read-write property<ov_element_type_e> to set the hint for device to use specified
//!< precision for inference
//!< All property values are string, below are optional value:
//!< "UNDEFINED" - Undefined element type
//!< "DYNAMIC" - Dynamic element type
//!< "BOOLEAN" - boolean element type
//!< "BF16" - bf16 element type
//!< "F16" - f16 element type
//!< "F32" - f32 element type
//!< "F64" - f64 element type
//!< "I4" - i4 element type
//!< "I8" - i8 element type
//!< "I16" - i16 element type
//!< "I32" - i32 element type
//!< "I64" - i64 element type
//!< "U1" - binary element type
//!< "U4" - u4 element type
//!< "U8" - u8 element type
//!< "U16" - u16 element type
//!< "U32" - u32 element type
//!< "U64" - u64 element type
OPENVINO_C_VAR(const char*) ov_property_key_hint_inference_precision;
//!< (Optional) Read-write property<uint32_t string> that backs the Performance Hints by giving
//!< additional information on how many inference requests the application will be
//!< keeping in flight usually this value comes from the actual use-case (e.g.
//!< number of video-cameras, or other sources of inputs)
OPENVINO_C_VAR(const char*) ov_property_key_hint_num_requests;
//!< Read-write property<string> for setting desirable log level.
//!< All property values are string, below are optional value:
//!< "NO" - disable any logging
//!< "ERR" - error events that might still allow the application to continue running
//!< "WARNING" - potentially harmful situations which may further lead to ERROR
//!< "INFO" - informational messages that display the progress of the application at coarse-grained level
//!< "DEBUG" - fine-grained events that are most useful to debug an application.
//!< "TRACE" - finer-grained informational events than the DEBUG
OPENVINO_C_VAR(const char*) ov_property_key_log_level;
//!< Read-write property, high-level OpenVINO model priority hint.
//!< Defines what model should be provided with more performant bounded resource first.
//!< All property value are string format, below is optional value:
//!< "LOW" - Low priority
//!< "MEDIUM" - Medium priority
//!< "HIGH" - High priority
//!< "DEFAULT" - Default priority is MEDIUM
OPENVINO_C_VAR(const char*) ov_property_key_hint_model_priority;
//!< Read-write property<string> for setting performance counters option.
//!< All property values are string, below are optional value:
//!< "YES" - true
//!< "NO" - false
OPENVINO_C_VAR(const char*) ov_property_key_enable_profiling;
//!< Read-write property<std::pair<std::string, Any>>, device Priorities config option, with comma-separated devices
//!< listed in the desired priority
//!< Some optional values for MULTI device:
//! "CPU,GPU"
//! "GPU,CPU"
//! Note: CPU plugin is not implement.
OPENVINO_C_VAR(const char*) ov_property_key_device_priorities;
// Property
/**
* @defgroup Property Property
* @ingroup openvino_c
* Set of functions representing of Property.
* @{
* @brief Read-only property<string> to get a list of available device IDs.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_available_devices;
/** @} */ // end of Property
/**
* @brief Read-only property<uint32_t string> to get an unsigned integer value of optimaln
* number of compiled model infer requests.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_optimal_number_of_infer_requests;
/**
* @brief Read-only property<string(unsigned int, unsigned int, unsigned int)> to provide a
* hint for a range for number of async infer requests. If device supports
* streams, the metric provides range for number of IRs per stream.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_range_for_async_infer_requests;
/**
* @brief Read-only property<string(unsigned int, unsigned int)> to provide information about a range for
* streams on platforms where streams are supported
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_range_for_streams;
/**
* @brief Read-only property<string> to get a string value representing a full device name.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_device_full_name;
/**
* @brief Read-only property<string> to get a string list of capabilities options per device.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_device_capabilities;
/**
* @brief Read-only property<string> to get a name of name of a model
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_model_name;
/**
* @brief Read-only property<uint32_t string> to query information optimal batch size for the given device
* and the network
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_optimal_batch_size;
/**
* @brief Read-only property to get maximum batch size which does not cause performance degradation due
* to memory swap impact.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_max_batch_size;
/**
* @brief Read-write property<string> to set/get the directory which will be used to store any data cached
* by plugins.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_cache_dir;
/**
* @brief Read-write property<uint32_t string> to set/get the number of executor logical partitions.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_num_streams;
/**
* @brief Read-write property to set/get the name for setting CPU affinity per thread option.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_affinity;
/**
* @brief Read-write property<int32_t string> to set/get the maximum number of threads that can be used
* for inference tasks.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_inference_num_threads;
/**
* @brief Read-write property, it is high-level OpenVINO Performance Hints
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_hint_performance_mode;
/**
* @brief Read-write property<ov_element_type_e> to set the hint for device to use specified precision for inference.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_hint_inference_precision;
/**
* @brief (Optional) Read-write property<uint32_t string> that backs the Performance Hints by giving
* additional information on how many inference requests the application will be
* keeping in flight usually this value comes from the actual use-case (e.g.
* number of video-cameras, or other sources of inputs)
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_hint_num_requests;
/**
* @brief Read-write property<string> for setting desirable log level.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_log_level;
/**
* @brief Read-write property, high-level OpenVINO model priority hint.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_hint_model_priority;
/**
* @brief Read-write property<string> for setting performance counters option.
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_enable_profiling;
/**
* @brief Read-write property<std::pair<std::string, Any>>, device Priorities config option,
* with comma-separated devices listed in the desired priority
* @ingroup ov_property_c_api
*/
OPENVINO_C_VAR(const char*)
ov_property_key_device_priorities;
+7 -11
View File
@@ -12,22 +12,18 @@
#include "openvino/c/ov_dimension.h"
typedef ov_dimension_t ov_rank_t;
// Rank
/**
* @defgroup rank rank
* @ingroup openvino_c
* Set of functions representing of rank.
* @{
* @struct ov_rank_t
* @ingroup ov_rank_c_api
* @brief type define ov_rank_t from ov_dimension_t
*/
typedef ov_dimension_t ov_rank_t;
/**
* @brief Check this rank whether is dynamic
* @ingroup rank
* @ingroup ov_rank_c_api
* @param rank The rank pointer that will be checked.
* @return bool The return value.
*/
OPENVINO_C_API(bool) ov_rank_is_dynamic(const ov_rank_t rank);
/** @} */ // end of Rank
OPENVINO_C_API(bool)
ov_rank_is_dynamic(const ov_rank_t rank);
+9 -6
View File
@@ -14,27 +14,30 @@
/**
* @struct ov_shape_t
* @ingroup ov_shape_c_api
* @brief Reprents a static shape.
*/
typedef struct {
int64_t rank;
int64_t* dims;
int64_t rank; //!< the rank of shape
int64_t* dims; //!< the dims of shape
} ov_shape_t;
/**
* @brief Initialize a fully shape object, allocate space for its dimensions and set its content id dims is not null.
* @ingroup shape
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_shape_create(const int64_t rank, const int64_t* dims, ov_shape_t* shape);
OPENVINO_C_API(ov_status_e)
ov_shape_create(const int64_t rank, const int64_t* dims, ov_shape_t* shape);
/**
* @brief Free a shape object's internal memory.
* @ingroup shape
* @ingroup ov_shape_c_api
* @param shape The input shape object pointer.
* @return ov_status_e The return status code.
*/
OPENVINO_C_API(ov_status_e) ov_shape_free(ov_shape_t* shape);
OPENVINO_C_API(ov_status_e)
ov_shape_free(ov_shape_t* shape);
+30 -26
View File
@@ -14,19 +14,16 @@
#include "openvino/c/ov_partial_shape.h"
#include "openvino/c/ov_shape.h"
typedef struct ov_tensor ov_tensor_t;
// Tensor
/**
* @defgroup tensor tensor
* @ingroup openvino_c
* Set of functions representing of tensor.
* @{
* @struct ov_tensor_t
* @ingroup ov_tensor_c_api
* @brief type define ov_tensor_t from ov_tensor
*/
typedef struct ov_tensor ov_tensor_t;
/**
* @brief Constructs Tensor using element type and shape. Allocate internal host storage using default allocator
* @ingroup tensor
* @ingroup ov_tensor_c_api
* @param type Tensor element type
* @param shape Tensor shape
* @param host_ptr Pointer to pre-allocated host memory
@@ -41,74 +38,81 @@ ov_tensor_create_from_host_ptr(const ov_element_type_e type,
/**
* @brief Constructs Tensor using element type and shape. Allocate internal host storage using default allocator
* @ingroup tensor
* @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.
*/
OPENVINO_C_API(ov_status_e)
ov_tensor_create(const ov_element_type_e type, const ov_shape_t shape, ov_tensor_t** tensor);
ov_tensor_create(const ov_element_type_e type,
const ov_shape_t shape,
ov_tensor_t** tensor);
/**
* @brief Set new shape for tensor, deallocate/allocate if new total size is bigger than previous one.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_set_shape(ov_tensor_t* tensor, const ov_shape_t shape);
OPENVINO_C_API(ov_status_e)
ov_tensor_set_shape(ov_tensor_t* tensor, const ov_shape_t shape);
/**
* @brief Get shape for tensor.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_get_shape(const ov_tensor_t* tensor, ov_shape_t* shape);
OPENVINO_C_API(ov_status_e)
ov_tensor_get_shape(const ov_tensor_t* tensor, ov_shape_t* shape);
/**
* @brief Get type for tensor.
* @ingroup 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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_get_element_type(const ov_tensor_t* tensor, ov_element_type_e* type);
OPENVINO_C_API(ov_status_e)
ov_tensor_get_element_type(const ov_tensor_t* tensor, ov_element_type_e* type);
/**
* @brief the total number of elements (a product of all the dims or 1 for scalar).
* @ingroup tensor
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_get_size(const ov_tensor_t* tensor, size_t* elements_size);
OPENVINO_C_API(ov_status_e)
ov_tensor_get_size(const ov_tensor_t* tensor, size_t* elements_size);
/**
* @brief the size of the current Tensor in bytes.
* @ingroup tensor
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_get_byte_size(const ov_tensor_t* tensor, size_t* byte_size);
OPENVINO_C_API(ov_status_e)
ov_tensor_get_byte_size(const ov_tensor_t* tensor, size_t* byte_size);
/**
* @brief Provides an access to the underlaying host memory.
* @ingroup tensor
* @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.
*/
OPENVINO_C_API(ov_status_e) ov_tensor_data(const ov_tensor_t* tensor, void** data);
OPENVINO_C_API(ov_status_e)
ov_tensor_data(const ov_tensor_t* tensor, void** data);
/**
* @brief Free ov_tensor_t.
* @ingroup tensor
* @ingroup ov_tensor_c_api
* @param tensor A point to ov_tensor_t
*/
OPENVINO_C_API(void) ov_tensor_free(ov_tensor_t* tensor);
/** @} */ // end of tensor
OPENVINO_C_API(void)
ov_tensor_free(ov_tensor_t* tensor);