Fixed clang-format for C API (#16024)

This commit is contained in:
Ilya Lavrenov 2023-03-01 16:36:20 +04:00 committed by GitHub
parent c5c7e4ff65
commit ba19d945ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 129 additions and 176 deletions

View File

@ -70,6 +70,10 @@ function(add_clang_format_target TARGET_NAME)
continue() continue()
endif() 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}") 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") set(output_file "${CMAKE_CURRENT_BINARY_DIR}/clang_format/${source_file_relative}.clang")
string(REPLACE ".." "__" output_file "${output_file}") string(REPLACE ".." "__" output_file "${output_file}")

View File

@ -253,7 +253,7 @@ macro(ov_add_frontend)
endif() endif()
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME} 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}) add_dependencies(ov_frontends ${TARGET_NAME})

View File

@ -27,6 +27,6 @@
#include "openvino/c/ov_prepostprocess.h" #include "openvino/c/ov_prepostprocess.h"
#include "openvino/c/ov_property.h" #include "openvino/c/ov_property.h"
#include "openvino/c/ov_rank.h" #include "openvino/c/ov_rank.h"
#include "openvino/c/ov_remote_context.h"
#include "openvino/c/ov_shape.h" #include "openvino/c/ov_shape.h"
#include "openvino/c/ov_tensor.h" #include "openvino/c/ov_tensor.h"
#include "openvino/c/ov_remote_context.h"

View File

@ -132,33 +132,33 @@
* @brief This enum contains codes for all possible return values of the interface functions * @brief This enum contains codes for all possible return values of the interface functions
*/ */
typedef enum { typedef enum {
OK = 0, //!< SUCCESS OK = 0, //!< SUCCESS
/* /*
* @brief map exception to C++ interface * @brief map exception to C++ interface
*/ */
GENERAL_ERROR = -1, //!< GENERAL_ERROR GENERAL_ERROR = -1, //!< GENERAL_ERROR
NOT_IMPLEMENTED = -2, //!< NOT_IMPLEMENTED NOT_IMPLEMENTED = -2, //!< NOT_IMPLEMENTED
NETWORK_NOT_LOADED = -3, //!< NETWORK_NOT_LOADED NETWORK_NOT_LOADED = -3, //!< NETWORK_NOT_LOADED
PARAMETER_MISMATCH = -4, //!< PARAMETER_MISMATCH PARAMETER_MISMATCH = -4, //!< PARAMETER_MISMATCH
NOT_FOUND = -5, //!< NOT_FOUND NOT_FOUND = -5, //!< NOT_FOUND
OUT_OF_BOUNDS = -6, //!< OUT_OF_BOUNDS OUT_OF_BOUNDS = -6, //!< OUT_OF_BOUNDS
/* /*
* @brief exception not of std::exception derived type was thrown * @brief exception not of std::exception derived type was thrown
*/ */
UNEXPECTED = -7, //!< UNEXPECTED UNEXPECTED = -7, //!< UNEXPECTED
REQUEST_BUSY = -8, //!< REQUEST_BUSY REQUEST_BUSY = -8, //!< REQUEST_BUSY
RESULT_NOT_READY = -9, //!< RESULT_NOT_READY RESULT_NOT_READY = -9, //!< RESULT_NOT_READY
NOT_ALLOCATED = -10, //!< NOT_ALLOCATED NOT_ALLOCATED = -10, //!< NOT_ALLOCATED
INFER_NOT_STARTED = -11, //!< INFER_NOT_STARTED INFER_NOT_STARTED = -11, //!< INFER_NOT_STARTED
NETWORK_NOT_READ = -12, //!< NETWORK_NOT_READ NETWORK_NOT_READ = -12, //!< NETWORK_NOT_READ
INFER_CANCELLED = -13, //!< INFER_CANCELLED INFER_CANCELLED = -13, //!< INFER_CANCELLED
/* /*
* @brief exception in C wrapper * @brief exception in C wrapper
*/ */
INVALID_C_PARAM = -14, //!< INVALID_C_PARAM INVALID_C_PARAM = -14, //!< INVALID_C_PARAM
UNKNOWN_C_ERROR = -15, //!< UNKNOWN_C_ERROR UNKNOWN_C_ERROR = -15, //!< UNKNOWN_C_ERROR
NOT_IMPLEMENT_C_METHOD = -16, //!< NOT_IMPLEMENT_C_METHOD NOT_IMPLEMENT_C_METHOD = -16, //!< NOT_IMPLEMENT_C_METHOD
UNKNOW_EXCEPTION = -17, //!< UNKNOW_EXCEPTION UNKNOW_EXCEPTION = -17, //!< UNKNOW_EXCEPTION
} ov_status_e; } ov_status_e;
/** /**

View File

@ -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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_compiled_model_outputs_size(const ov_compiled_model_t* compiled_model, ov_compiled_model_outputs_size(const ov_compiled_model_t* compiled_model, size_t* size);
size_t* size);
/** /**
* @brief Get the single const output port of ov_compiled_model_t, which only support single output model. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_compiled_model_output(const ov_compiled_model_t* compiled_model, ov_compiled_model_output(const ov_compiled_model_t* compiled_model, ov_output_const_port_t** output_port);
ov_output_const_port_t** output_port);
/** /**
* @brief Get a const output port of ov_compiled_model_t by port index. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_compiled_model_get_runtime_model(const ov_compiled_model_t* compiled_model, ov_compiled_model_get_runtime_model(const ov_compiled_model_t* compiled_model, ov_model_t** model);
ov_model_t** model);
/** /**
* @brief Creates an inference request object used to infer the compiled 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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_compiled_model_create_infer_request(const ov_compiled_model_t* compiled_model, ov_compiled_model_create_infer_request(const ov_compiled_model_t* compiled_model, ov_infer_request_t** infer_request);
ov_infer_request_t** infer_request);
/** /**
* @brief Sets properties for a device, acceptable keys can be found in ov_property_key_xxx. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_compiled_model_export_model(const ov_compiled_model_t* compiled_model, ov_compiled_model_export_model(const ov_compiled_model_t* compiled_model, const char* export_model_path);
const char* export_model_path);
/** /**
* @brief Release the memory allocated by ov_compiled_model_t. * @brief Release the memory allocated by ov_compiled_model_t.

View File

@ -61,8 +61,8 @@ typedef struct {
* @brief Represent all available devices. * @brief Represent all available devices.
*/ */
typedef struct { typedef struct {
char** devices; //!< devices' name char** devices; //!< devices' name
size_t size; //!< devices' number size_t size; //!< devices' number
} ov_available_devices_t; } 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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_core_read_model(const ov_core_t* core, ov_core_read_model(const ov_core_t* core, const char* model_path, const char* bin_path, ov_model_t** model);
const char* model_path,
const char* bin_path,
ov_model_t** model);
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_core_get_property(const ov_core_t* core, ov_core_get_property(const ov_core_t* core, const char* device_name, const char* property_key, char** property_value);
const char* device_name,
const char* property_key,
char** property_value);
/** /**
* @brief Returns devices available for inference. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_core_get_versions_by_device_name(const ov_core_t* core, ov_core_get_versions_by_device_name(const ov_core_t* core, const char* device_name, ov_core_version_list_t* versions);
const char* device_name,
ov_core_version_list_t* versions);
/** /**
* @brief Releases memory occupied by ov_core_version_list_t. * @brief Releases memory occupied by ov_core_version_list_t.

View File

@ -27,8 +27,8 @@ typedef struct ov_infer_request ov_infer_request_t;
* @brief Completion callback definition about the function and args * @brief Completion callback definition about the function and args
*/ */
typedef struct { typedef struct {
void(OPENVINO_C_API_CALLBACK* callback_func)(void* args); //!< The callback func void(OPENVINO_C_API_CALLBACK* callback_func)(void* args); //!< The callback func
void* args; //!< The args of callback func void* args; //!< The args of callback func
} ov_callback_t; } ov_callback_t;
/** /**
@ -37,11 +37,11 @@ typedef struct {
* @brief Store profiling info data * @brief Store profiling info data
*/ */
typedef struct { typedef struct {
enum Status { //!< Defines the general status of a node. enum Status { //!< Defines the general status of a node.
NOT_RUN, //!< A node is not executed. NOT_RUN, //!< A node is not executed.
OPTIMIZED_OUT, //!< A node is optimized out during graph optimization phase. OPTIMIZED_OUT, //!< A node is optimized out during graph optimization phase.
EXECUTED //!< A node is executed. EXECUTED //!< A node is executed.
} status; //!< status } status; //!< status
int64_t real_time; //!< The absolute time, in microseconds, that the node ran (in total). 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. int64_t cpu_time; //!< The net host CPU time that the node ran.
const char* node_name; //!< Name of a node. const char* node_name; //!< Name of a node.
@ -55,8 +55,8 @@ typedef struct {
* @brief A list of profiling info data * @brief A list of profiling info data
*/ */
typedef struct { typedef struct {
ov_profiling_info_t* profiling_infos; //!< The list of ov_profilling_info_t ov_profiling_info_t* profiling_infos; //!< The list of ov_profilling_info_t
size_t size; //!< The list size size_t size; //!< The list size
} ov_profiling_info_list_t; } ov_profiling_info_list_t;
/** /**
@ -68,9 +68,7 @@ typedef struct {
* @return Status code of the operation: OK(0) for success. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_infer_request_set_tensor(ov_infer_request_t* infer_request, ov_infer_request_set_tensor(ov_infer_request_t* infer_request, const char* tensor_name, const ov_tensor_t* tensor);
const char* tensor_name,
const ov_tensor_t* tensor);
/** /**
* @brief Set an input/output tensor to infer request for the port. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_infer_request_get_tensor(const ov_infer_request_t* infer_request, ov_infer_request_get_tensor(const ov_infer_request_t* infer_request, const char* tensor_name, ov_tensor_t** tensor);
const char* tensor_name,
ov_tensor_t** tensor);
/** /**
* @brief Get an input/output tensor by const port. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_infer_request_get_input_tensor(const ov_infer_request_t* infer_request, ov_infer_request_get_input_tensor(const ov_infer_request_t* infer_request, ov_tensor_t** tensor);
ov_tensor_t** tensor);
/** /**
* @brief Get an output tensor by the index of output 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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_infer_request_get_output_tensor(const ov_infer_request_t* infer_request, ov_infer_request_get_output_tensor(const ov_infer_request_t* infer_request, ov_tensor_t** tensor);
ov_tensor_t** tensor);
/** /**
* @brief Infer specified input(s) in synchronous mode. * @brief Infer specified input(s) in synchronous mode.

View File

@ -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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_model_const_input_by_name(const ov_model_t* model, ov_model_const_input_by_name(const ov_model_t* model, const char* tensor_name, ov_output_const_port_t** input_port);
const char* tensor_name,
ov_output_const_port_t** input_port);
/** /**
* @brief Get a const input port of ov_model_t by port index. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_model_const_input_by_index(const ov_model_t* model, ov_model_const_input_by_index(const ov_model_t* model, const size_t index, ov_output_const_port_t** input_port);
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. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_model_input_by_name(const ov_model_t* model, ov_model_input_by_name(const ov_model_t* model, const char* tensor_name, ov_output_port_t** input_port);
const char* tensor_name,
ov_output_port_t** input_port);
/** /**
* @brief Get an input port of ov_model_t by port index. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_model_const_output_by_name(const ov_model_t* model, ov_model_const_output_by_name(const ov_model_t* model, const char* tensor_name, ov_output_const_port_t** output_port);
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. * @brief Get an single output port of ov_model_t, which only support single output model.

View File

@ -30,8 +30,8 @@
* An interface to make user can initialize ov_partial_shape_t * An interface to make user can initialize ov_partial_shape_t
*/ */
typedef struct ov_partial_shape { typedef struct ov_partial_shape {
ov_rank_t rank; //!< The rank ov_rank_t rank; //!< The rank
ov_dimension_t* dims; //!< The dimension ov_dimension_t* dims; //!< The dimension
} ov_partial_shape_t; } ov_partial_shape_t;
/** /**
@ -47,9 +47,7 @@ typedef struct ov_partial_shape {
* @return Status code of the operation: OK(0) for success. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_partial_shape_create(const int64_t rank, ov_partial_shape_create(const int64_t rank, const ov_dimension_t* dims, ov_partial_shape_t* partial_shape_obj);
const ov_dimension_t* dims,
ov_partial_shape_t* partial_shape_obj);
/** /**
* @brief Initialze a partial shape with dynamic rank and dynamic dimension. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_partial_shape_create_static(const int64_t rank, ov_partial_shape_create_static(const int64_t rank, const int64_t* dims, ov_partial_shape_t* partial_shape_obj);
const int64_t* dims,
ov_partial_shape_t* partial_shape_obj);
/** /**
* @brief Release internal memory allocated in partial shape. * @brief Release internal memory allocated in partial shape.

View File

@ -101,8 +101,7 @@ typedef enum {
* @return Status code of the operation: OK(0) for success. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_create(const ov_model_t* model, ov_preprocess_prepostprocessor_create(const ov_model_t* model, ov_preprocess_prepostprocessor_t** preprocess);
ov_preprocess_prepostprocessor_t** preprocess);
/** /**
* @brief Release the memory allocated by ov_preprocess_prepostprocessor_t. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info( ov_preprocess_prepostprocessor_get_input_info(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, ov_preprocess_input_info_t** preprocess_input_info);
ov_preprocess_input_info_t** preprocess_input_info);
/** /**
* @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor name. * @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor name.
@ -133,10 +131,9 @@ ov_preprocess_prepostprocessor_get_input_info(
* @return Status code of the operation: OK(0) for success. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info_by_name( ov_preprocess_prepostprocessor_get_input_info_by_name(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, const char* tensor_name,
const char* tensor_name, ov_preprocess_input_info_t** preprocess_input_info);
ov_preprocess_input_info_t** preprocess_input_info);
/** /**
* @brief Get the input info of ov_preprocess_prepostprocessor_t instance by tensor order. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_input_info_by_index( ov_preprocess_prepostprocessor_get_input_info_by_index(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, const size_t tensor_index,
const size_t tensor_index, ov_preprocess_input_info_t** preprocess_input_info);
ov_preprocess_input_info_t** preprocess_input_info);
/** /**
* @brief Release the memory allocated by ov_preprocess_input_info_t. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_tensor_info( ov_preprocess_input_info_get_tensor_info(const ov_preprocess_input_info_t* preprocess_input_info,
const ov_preprocess_input_info_t* preprocess_input_info, ov_preprocess_input_tensor_info_t** preprocess_input_tensor_info);
ov_preprocess_input_tensor_info_t** preprocess_input_tensor_info);
/** /**
* @brief Release the memory allocated by ov_preprocess_input_tensor_info_t. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_preprocess_steps( ov_preprocess_input_info_get_preprocess_steps(const ov_preprocess_input_info_t* preprocess_input_info,
const ov_preprocess_input_info_t* preprocess_input_info, ov_preprocess_preprocess_steps_t** preprocess_input_steps);
ov_preprocess_preprocess_steps_t** preprocess_input_steps);
/** /**
* @brief Release the memory allocated by ov_preprocess_preprocess_steps_t. * @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. * @param preprocess_input_steps A pointer to the ov_preprocess_preprocess_steps_t to free memory.
*/ */
OPENVINO_C_API(void) OPENVINO_C_API(void)
ov_preprocess_preprocess_steps_free( ov_preprocess_preprocess_steps_free(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps);
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps);
/** /**
* @brief Add resize operation to model's dimensions. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_resize( ov_preprocess_preprocess_steps_resize(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, const ov_preprocess_resize_algorithm_e resize_algorithm);
const ov_preprocess_resize_algorithm_e resize_algorithm);
/** /**
* @brief Add scale preprocess operation. Divide each element of input by specified value. * @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) OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_crop(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, 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. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) 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. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_element_type( ov_preprocess_input_tensor_info_set_element_type(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info, const ov_element_type_e element_type);
const ov_element_type_e element_type);
/** /**
* @brief Set ov_preprocess_input_tensor_info_t color format. * @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) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_spatial_static_shape( ov_preprocess_input_tensor_info_set_spatial_static_shape(
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info, ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
const size_t input_height, const size_t input_height,
const size_t input_width); const size_t input_width);
/** /**
* @brief Set ov_preprocess_input_tensor_info_t memory type. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_convert_element_type( ov_preprocess_preprocess_steps_convert_element_type(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, const ov_element_type_e element_type);
const ov_element_type_e element_type);
/** /**
* @brief Convert ov_preprocess_preprocess_steps_t color. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_preprocess_steps_convert_color( ov_preprocess_preprocess_steps_convert_color(ov_preprocess_preprocess_steps_t* preprocess_input_process_steps,
ov_preprocess_preprocess_steps_t* preprocess_input_process_steps, const ov_color_format_e colorFormat);
const ov_color_format_e colorFormat);
/** /**
* @brief Helper function to reuse element type and shape from user's created tensor. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_from( ov_preprocess_input_tensor_info_set_from(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info, const ov_tensor_t* tensor);
const ov_tensor_t* tensor);
/** /**
* @brief Set ov_preprocess_input_tensor_info_t layout. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_tensor_info_set_layout( ov_preprocess_input_tensor_info_set_layout(ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info,
ov_preprocess_input_tensor_info_t* preprocess_input_tensor_info, ov_layout_t* layout);
ov_layout_t* layout);
/** /**
* @brief Get the output info of ov_preprocess_output_info_t instance. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info( ov_preprocess_prepostprocessor_get_output_info(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_output_info_t** preprocess_output_info);
/** /**
* @brief Get the output info of ov_preprocess_output_info_t instance. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info_by_index( ov_preprocess_prepostprocessor_get_output_info_by_index(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, const size_t tensor_index,
const size_t tensor_index, ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_output_info_t** preprocess_output_info);
/** /**
* @brief Get the output info of ov_preprocess_output_info_t instance. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_get_output_info_by_name( ov_preprocess_prepostprocessor_get_output_info_by_name(const ov_preprocess_prepostprocessor_t* preprocess,
const ov_preprocess_prepostprocessor_t* preprocess, const char* tensor_name,
const char* tensor_name, ov_preprocess_output_info_t** preprocess_output_info);
ov_preprocess_output_info_t** preprocess_output_info);
/** /**
* @brief Release the memory allocated by ov_preprocess_output_info_t. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_output_info_get_tensor_info( ov_preprocess_output_info_get_tensor_info(const ov_preprocess_output_info_t* preprocess_output_info,
const ov_preprocess_output_info_t* preprocess_output_info, ov_preprocess_output_tensor_info_t** preprocess_output_tensor_info);
ov_preprocess_output_tensor_info_t** preprocess_output_tensor_info);
/** /**
* @brief Release the memory allocated by ov_preprocess_output_tensor_info_t. * @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. * @param preprocess_output_tensor_info A pointer to the ov_preprocess_output_tensor_info_t to free memory.
*/ */
OPENVINO_C_API(void) OPENVINO_C_API(void)
ov_preprocess_output_tensor_info_free( ov_preprocess_output_tensor_info_free(ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info);
ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info);
/** /**
* @brief Set ov_preprocess_input_tensor_info_t precesion. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_output_set_element_type( ov_preprocess_output_set_element_type(ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info,
ov_preprocess_output_tensor_info_t* preprocess_output_tensor_info, const ov_element_type_e element_type);
const ov_element_type_e element_type);
/** /**
* @brief Get current input model information. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_info_get_model_info( ov_preprocess_input_info_get_model_info(const ov_preprocess_input_info_t* preprocess_input_info,
const ov_preprocess_input_info_t* preprocess_input_info, ov_preprocess_input_model_info_t** preprocess_input_model_info);
ov_preprocess_input_model_info_t** preprocess_input_model_info);
/** /**
* @brief Release the memory allocated by ov_preprocess_input_model_info_t. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_input_model_info_set_layout( ov_preprocess_input_model_info_set_layout(ov_preprocess_input_model_info_t* preprocess_input_model_info,
ov_preprocess_input_model_info_t* preprocess_input_model_info, ov_layout_t* layout);
ov_layout_t* layout);
/** /**
* @brief Adds pre/post-processing operations to function passed in constructor. * @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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_preprocess_prepostprocessor_build( ov_preprocess_prepostprocessor_build(const ov_preprocess_prepostprocessor_t* preprocess, ov_model_t** model);
const ov_preprocess_prepostprocessor_t* preprocess, ov_model_t** model);

View File

@ -8,10 +8,10 @@
* @file ov_remote_context.h * @file ov_remote_context.h
*/ */
#pragma once #pragma once
#include "openvino/c/gpu/gpu_plugin_properties.h"
#include "openvino/c/ov_common.h" #include "openvino/c/ov_common.h"
#include "openvino/c/ov_shape.h" #include "openvino/c/ov_shape.h"
#include "openvino/c/ov_tensor.h" #include "openvino/c/ov_tensor.h"
#include "openvino/c/gpu/gpu_plugin_properties.h"
typedef struct ov_remote_context ov_remote_context_t; typedef struct ov_remote_context ov_remote_context_t;

View File

@ -18,8 +18,8 @@
* @brief Reprents a static shape. * @brief Reprents a static shape.
*/ */
typedef struct { typedef struct {
int64_t rank; //!< the rank of shape int64_t rank; //!< the rank of shape
int64_t* dims; //!< the dims of shape int64_t* dims; //!< the dims of shape
} ov_shape_t; } ov_shape_t;
/** /**

View File

@ -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. * @return Status code of the operation: OK(0) for success.
*/ */
OPENVINO_C_API(ov_status_e) OPENVINO_C_API(ov_status_e)
ov_tensor_create(const ov_element_type_e type, ov_tensor_create(const ov_element_type_e type, const ov_shape_t shape, ov_tensor_t** tensor);
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. * @brief Set new shape for tensor, deallocate/allocate if new total size is bigger than previous one.

View File

@ -5,7 +5,7 @@
set(TARGET_NAME openvino_c) set(TARGET_NAME openvino_c)
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) 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 # create library
add_library(${TARGET_NAME} ${HEADERS} ${SOURCES}) add_library(${TARGET_NAME} ${HEADERS} ${SOURCES})