From ba19d945ac4fcac89e3c686f348ff2cb8f49a238 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 1 Mar 2023 16:36:20 +0400 Subject: [PATCH] Fixed clang-format for C API (#16024) --- .../clang_format/clang_format.cmake | 4 + .../frontends/frontends.cmake | 2 +- src/bindings/c/include/openvino/c/openvino.h | 2 +- src/bindings/c/include/openvino/c/ov_common.h | 64 ++++----- .../c/include/openvino/c/ov_compiled_model.h | 15 +-- src/bindings/c/include/openvino/c/ov_core.h | 18 +-- .../c/include/openvino/c/ov_infer_request.h | 32 ++--- src/bindings/c/include/openvino/c/ov_model.h | 16 +-- src/bindings/c/include/openvino/c/ov_node.h | 2 +- .../c/include/openvino/c/ov_partial_shape.h | 12 +- .../c/include/openvino/c/ov_prepostprocess.h | 126 ++++++++---------- .../c/include/openvino/c/ov_remote_context.h | 2 +- src/bindings/c/include/openvino/c/ov_shape.h | 4 +- src/bindings/c/include/openvino/c/ov_tensor.h | 4 +- src/bindings/c/src/CMakeLists.txt | 2 +- 15 files changed, 129 insertions(+), 176 deletions(-) diff --git a/cmake/developer_package/clang_format/clang_format.cmake b/cmake/developer_package/clang_format/clang_format.cmake index 0dbaad79e74..24679f742b8 100644 --- a/cmake/developer_package/clang_format/clang_format.cmake +++ b/cmake/developer_package/clang_format/clang_format.cmake @@ -70,6 +70,10 @@ function(add_clang_format_target TARGET_NAME) continue() endif() + if(IS_DIRECTORY "${source_file}") + message(FATAL_ERROR "Directory ${source_file} cannot be passed to clang-format") + endif() + file(RELATIVE_PATH source_file_relative "${CMAKE_CURRENT_SOURCE_DIR}" "${source_file}") set(output_file "${CMAKE_CURRENT_BINARY_DIR}/clang_format/${source_file_relative}.clang") string(REPLACE ".." "__" output_file "${output_file}") diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index 84a9eea0735..a5393c59d00 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -253,7 +253,7 @@ macro(ov_add_frontend) endif() add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME} - EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${flatbuffers_schema_files}) + EXCLUDE_PATTERNS ${PROTO_SRCS} ${PROTO_HDRS} ${proto_files} ${flatbuffers_schema_files}) add_dependencies(ov_frontends ${TARGET_NAME}) diff --git a/src/bindings/c/include/openvino/c/openvino.h b/src/bindings/c/include/openvino/c/openvino.h index 4cbf085eaad..7ffcb79da63 100644 --- a/src/bindings/c/include/openvino/c/openvino.h +++ b/src/bindings/c/include/openvino/c/openvino.h @@ -27,6 +27,6 @@ #include "openvino/c/ov_prepostprocess.h" #include "openvino/c/ov_property.h" #include "openvino/c/ov_rank.h" +#include "openvino/c/ov_remote_context.h" #include "openvino/c/ov_shape.h" #include "openvino/c/ov_tensor.h" -#include "openvino/c/ov_remote_context.h" diff --git a/src/bindings/c/include/openvino/c/ov_common.h b/src/bindings/c/include/openvino/c/ov_common.h index 08fc589fc3c..99f9322bfa9 100644 --- a/src/bindings/c/include/openvino/c/ov_common.h +++ b/src/bindings/c/include/openvino/c/ov_common.h @@ -64,7 +64,7 @@ /** * @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 @@ -72,55 +72,55 @@ * @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 - * + * * @defgroup ov_remote_context_c_api ov_remote_context * @ingroup ov_c_api * @brief Set of functions representing of RemoteContext @@ -132,33 +132,33 @@ * @brief This enum contains codes for all possible return values of the interface functions */ typedef enum { - OK = 0, //!< SUCCESS + OK = 0, //!< SUCCESS /* * @brief map exception to C++ interface */ - 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 + 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, //!< 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 + 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, //!< INVALID_C_PARAM - UNKNOWN_C_ERROR = -15, //!< UNKNOWN_C_ERROR - NOT_IMPLEMENT_C_METHOD = -16, //!< NOT_IMPLEMENT_C_METHOD - UNKNOW_EXCEPTION = -17, //!< UNKNOW_EXCEPTION + 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; /** diff --git a/src/bindings/c/include/openvino/c/ov_compiled_model.h b/src/bindings/c/include/openvino/c/ov_compiled_model.h index 6d98c761ca1..4bba5c8c152 100644 --- a/src/bindings/c/include/openvino/c/ov_compiled_model.h +++ b/src/bindings/c/include/openvino/c/ov_compiled_model.h @@ -79,8 +79,7 @@ ov_compiled_model_input_by_name(const ov_compiled_model_t* compiled_model, * @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. @@ -90,8 +89,7 @@ ov_compiled_model_outputs_size(const ov_compiled_model_t* compiled_model, * @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. @@ -127,8 +125,7 @@ ov_compiled_model_output_by_name(const ov_compiled_model_t* compiled_model, * @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. @@ -138,8 +135,7 @@ ov_compiled_model_get_runtime_model(const ov_compiled_model_t* compiled_model, * @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. @@ -174,8 +170,7 @@ ov_compiled_model_get_property(const ov_compiled_model_t* compiled_model, * @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. diff --git a/src/bindings/c/include/openvino/c/ov_core.h b/src/bindings/c/include/openvino/c/ov_core.h index 5618ea55fcf..2e564a6e38b 100644 --- a/src/bindings/c/include/openvino/c/ov_core.h +++ b/src/bindings/c/include/openvino/c/ov_core.h @@ -61,8 +61,8 @@ typedef struct { * @brief Represent all available devices. */ typedef struct { - char** devices; //!< devices' name - size_t size; //!< devices' number + char** devices; //!< devices' name + size_t size; //!< devices' number } ov_available_devices_t; /** @@ -142,10 +142,7 @@ 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 /** @@ -282,10 +279,7 @@ 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. @@ -335,9 +329,7 @@ ov_core_import_model(const ov_core_t* core, * @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. diff --git a/src/bindings/c/include/openvino/c/ov_infer_request.h b/src/bindings/c/include/openvino/c/ov_infer_request.h index 4fec06512db..6b9087356b2 100644 --- a/src/bindings/c/include/openvino/c/ov_infer_request.h +++ b/src/bindings/c/include/openvino/c/ov_infer_request.h @@ -27,8 +27,8 @@ typedef struct ov_infer_request ov_infer_request_t; * @brief Completion callback definition about the function and args */ typedef struct { - void(OPENVINO_C_API_CALLBACK* callback_func)(void* args); //!< The callback func - void* args; //!< The args of callback func + void(OPENVINO_C_API_CALLBACK* callback_func)(void* args); //!< The callback func + void* args; //!< The args of callback func } ov_callback_t; /** @@ -37,11 +37,11 @@ typedef struct { * @brief Store profiling info data */ typedef struct { - enum Status { //!< Defines the general status of a node. - 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 + enum Status { //!< Defines the general status of a node. + 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 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. @@ -55,8 +55,8 @@ typedef struct { * @brief A list of profiling info data */ typedef struct { - ov_profiling_info_t* profiling_infos; //!< The list of ov_profilling_info_t - size_t size; //!< The list 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; /** @@ -68,9 +68,7 @@ typedef struct { * @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. @@ -157,9 +155,7 @@ ov_infer_request_set_output_tensor(ov_infer_request_t* infer_request, const ov_t * @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. @@ -209,8 +205,7 @@ ov_infer_request_get_input_tensor_by_index(const ov_infer_request_t* infer_reque * @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. @@ -235,8 +230,7 @@ ov_infer_request_get_output_tensor_by_index(const ov_infer_request_t* infer_requ * @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. diff --git a/src/bindings/c/include/openvino/c/ov_model.h b/src/bindings/c/include/openvino/c/ov_model.h index 3fba1c6443f..842ece84dd8 100644 --- a/src/bindings/c/include/openvino/c/ov_model.h +++ b/src/bindings/c/include/openvino/c/ov_model.h @@ -48,9 +48,7 @@ ov_model_const_input(const ov_model_t* model, ov_output_const_port_t** input_por * @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. @@ -61,9 +59,7 @@ ov_model_const_input_by_name(const ov_model_t* model, * @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. @@ -84,9 +80,7 @@ ov_model_input(const ov_model_t* model, ov_output_port_t** input_port); * @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. @@ -129,9 +123,7 @@ ov_model_const_output_by_index(const ov_model_t* model, const size_t index, ov_o * @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. diff --git a/src/bindings/c/include/openvino/c/ov_node.h b/src/bindings/c/include/openvino/c/ov_node.h index 42a586800bc..e1201db39cd 100644 --- a/src/bindings/c/include/openvino/c/ov_node.h +++ b/src/bindings/c/include/openvino/c/ov_node.h @@ -83,7 +83,7 @@ ov_port_get_element_type(const ov_output_const_port_t* port, ov_element_type_e* * @ingroup ov_node_c_api * @param port The pointer to the instance of the ov_output_port_t to free. */ -OPENVINO_C_API(void) +OPENVINO_C_API(void) ov_output_port_free(ov_output_port_t* port); /** diff --git a/src/bindings/c/include/openvino/c/ov_partial_shape.h b/src/bindings/c/include/openvino/c/ov_partial_shape.h index 744697feb6a..93011c5bd8e 100644 --- a/src/bindings/c/include/openvino/c/ov_partial_shape.h +++ b/src/bindings/c/include/openvino/c/ov_partial_shape.h @@ -30,8 +30,8 @@ * An interface to make user can initialize ov_partial_shape_t */ typedef struct ov_partial_shape { - ov_rank_t rank; //!< The rank - ov_dimension_t* dims; //!< The dimension + ov_rank_t rank; //!< The rank + ov_dimension_t* dims; //!< The dimension } ov_partial_shape_t; /** @@ -47,9 +47,7 @@ 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. @@ -81,9 +79,7 @@ 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. diff --git a/src/bindings/c/include/openvino/c/ov_prepostprocess.h b/src/bindings/c/include/openvino/c/ov_prepostprocess.h index 5c14c686b91..c4fb46736a2 100644 --- a/src/bindings/c/include/openvino/c/ov_prepostprocess.h +++ b/src/bindings/c/include/openvino/c/ov_prepostprocess.h @@ -101,8 +101,7 @@ typedef enum { * @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. @@ -120,9 +119,8 @@ ov_preprocess_prepostprocessor_free(ov_preprocess_prepostprocessor_t* preprocess * @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. @@ -132,11 +130,10 @@ ov_preprocess_prepostprocessor_get_input_info( * @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. @@ -147,10 +144,9 @@ ov_preprocess_prepostprocessor_get_input_info_by_name( * @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. @@ -168,9 +164,8 @@ ov_preprocess_input_info_free(ov_preprocess_input_info_t* preprocess_input_info) * @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. @@ -188,9 +183,8 @@ ov_preprocess_input_tensor_info_free(ov_preprocess_input_tensor_info_t* preproce * @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. @@ -198,8 +192,7 @@ ov_preprocess_input_info_get_preprocess_steps( * @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. @@ -209,9 +202,8 @@ ov_preprocess_preprocess_steps_free( * @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 Add scale preprocess operation. Divide each element of input by specified value. @@ -248,7 +240,10 @@ ov_preprocess_preprocess_steps_mean(ov_preprocess_preprocess_steps_t* preprocess */ OPENVINO_C_API(ov_status_e) ov_preprocess_preprocess_steps_crop(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, - int32_t* begin, int32_t begin_size, int32_t* end, int32_t end_size); + int32_t* begin, + int32_t begin_size, + int32_t* end, + int32_t end_size); /** * @brief Add 'convert layout' operation to specified layout. @@ -258,7 +253,8 @@ ov_preprocess_preprocess_steps_crop(ov_preprocess_preprocess_steps_t* preprocess * @return Status code of the operation: OK(0) for success. */ OPENVINO_C_API(ov_status_e) -ov_preprocess_preprocess_steps_convert_layout(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, ov_layout_t* layout); +ov_preprocess_preprocess_steps_convert_layout(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, + ov_layout_t* layout); /** * @brief Reverse channels operation. @@ -277,9 +273,8 @@ ov_preprocess_preprocess_steps_reverse_channels(ov_preprocess_preprocess_steps_t * @return Status code of the operation: OK(0) for success. */ 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. @@ -318,9 +313,9 @@ ov_preprocess_input_tensor_info_set_color_format_with_subname( */ 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 Set ov_preprocess_input_tensor_info_t memory type. @@ -341,9 +336,8 @@ ov_preprocess_input_tensor_info_set_memory_type(ov_preprocess_input_tensor_info_ * @return Status code of the operation: OK(0) for success. */ 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. @@ -353,9 +347,8 @@ ov_preprocess_preprocess_steps_convert_element_type( * @return Status code of the operation: OK(0) for success. */ 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. @@ -365,9 +358,8 @@ ov_preprocess_preprocess_steps_convert_color( * @return Status code of the operation: OK(0) for success. */ 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. @@ -377,9 +369,8 @@ ov_preprocess_input_tensor_info_set_from( * @return Status code of the operation: OK(0) for success. */ 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. @@ -389,9 +380,8 @@ ov_preprocess_input_tensor_info_set_layout( * @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. @@ -402,10 +392,9 @@ ov_preprocess_prepostprocessor_get_output_info( * @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. @@ -416,10 +405,9 @@ ov_preprocess_prepostprocessor_get_output_info_by_index( * @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. @@ -437,9 +425,8 @@ ov_preprocess_output_info_free(ov_preprocess_output_info_t* preprocess_output_in * @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. @@ -447,8 +434,7 @@ ov_preprocess_output_info_get_tensor_info( * @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. @@ -458,9 +444,8 @@ ov_preprocess_output_tensor_info_free( * @return Status code of the operation: OK(0) for success. */ 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. @@ -470,9 +455,8 @@ ov_preprocess_output_set_element_type( * @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. @@ -490,9 +474,8 @@ ov_preprocess_input_model_info_free(ov_preprocess_input_model_info_t* preprocess * @return Status code of the operation: OK(0) for success. */ 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. @@ -502,5 +485,4 @@ ov_preprocess_input_model_info_set_layout( * @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); +ov_preprocess_prepostprocessor_build(const ov_preprocess_prepostprocessor_t* preprocess, ov_model_t** model); diff --git a/src/bindings/c/include/openvino/c/ov_remote_context.h b/src/bindings/c/include/openvino/c/ov_remote_context.h index 87a6479e29a..b8880b735ba 100644 --- a/src/bindings/c/include/openvino/c/ov_remote_context.h +++ b/src/bindings/c/include/openvino/c/ov_remote_context.h @@ -8,10 +8,10 @@ * @file ov_remote_context.h */ #pragma once +#include "openvino/c/gpu/gpu_plugin_properties.h" #include "openvino/c/ov_common.h" #include "openvino/c/ov_shape.h" #include "openvino/c/ov_tensor.h" -#include "openvino/c/gpu/gpu_plugin_properties.h" typedef struct ov_remote_context ov_remote_context_t; diff --git a/src/bindings/c/include/openvino/c/ov_shape.h b/src/bindings/c/include/openvino/c/ov_shape.h index 809a35ab75a..6ff4f4d7bf4 100644 --- a/src/bindings/c/include/openvino/c/ov_shape.h +++ b/src/bindings/c/include/openvino/c/ov_shape.h @@ -18,8 +18,8 @@ * @brief Reprents a static shape. */ typedef struct { - int64_t rank; //!< the rank of shape - int64_t* dims; //!< the dims of shape + int64_t rank; //!< the rank of shape + int64_t* dims; //!< the dims of shape } ov_shape_t; /** diff --git a/src/bindings/c/include/openvino/c/ov_tensor.h b/src/bindings/c/include/openvino/c/ov_tensor.h index 464c500d379..13e4769fb9c 100644 --- a/src/bindings/c/include/openvino/c/ov_tensor.h +++ b/src/bindings/c/include/openvino/c/ov_tensor.h @@ -45,9 +45,7 @@ ov_tensor_create_from_host_ptr(const ov_element_type_e type, * @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. diff --git a/src/bindings/c/src/CMakeLists.txt b/src/bindings/c/src/CMakeLists.txt index e9f8230da58..5b07af3d19e 100644 --- a/src/bindings/c/src/CMakeLists.txt +++ b/src/bindings/c/src/CMakeLists.txt @@ -5,7 +5,7 @@ set(TARGET_NAME openvino_c) file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -file(GLOB HEADERS ${OpenVINO_C_API_SOURCE_DIR}/include/*) +file(GLOB_RECURSE HEADERS ${OpenVINO_C_API_SOURCE_DIR}/include/*.h) # create library add_library(${TARGET_NAME} ${HEADERS} ${SOURCES})