Files
openvino/src/bindings/c/tests/ov_compiled_model_test.cpp

373 lines
13 KiB
C++
Raw Normal View History

// Copyright (C) 2018-2023 Intel Corporation
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
// SPDX-License-Identifier: Apache-2.0
//
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
#include "ov_test.hpp"
namespace {
class ov_compiled_model_test : public ov_capi_test_base {
void SetUp() override {
ov_capi_test_base::SetUp();
}
void TearDown() override {
ov_capi_test_base::TearDown();
}
};
INSTANTIATE_TEST_SUITE_P(device_name, ov_compiled_model_test, ::testing::Values("CPU"));
TEST_P(ov_compiled_model_test, ov_compiled_model_inputs_size) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
size_t input_size;
OV_EXPECT_OK(ov_compiled_model_inputs_size(compiled_model, &input_size));
EXPECT_NE(0, input_size);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_input) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* input_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_input(compiled_model, &input_port));
EXPECT_NE(nullptr, input_port);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_output_const_port_free(input_port);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_input_by_index) {
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* input_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_input_by_index(compiled_model, 0, &input_port));
EXPECT_NE(nullptr, input_port);
ov_shape_t shape;
OV_ASSERT_OK(ov_const_port_get_shape(input_port, &shape));
ov_shape_free(&shape);
ov_output_const_port_free(input_port);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_input_by_name) {
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* input_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_input_by_name(compiled_model, "data", &input_port));
EXPECT_NE(nullptr, input_port);
ov_shape_t shape;
OV_ASSERT_OK(ov_const_port_get_shape(input_port, &shape));
ov_shape_free(&shape);
ov_output_const_port_free(input_port);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, get_property) {
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
EXPECT_NE(nullptr, compiled_model);
const char* key = ov_property_key_supported_properties;
char* result = nullptr;
OV_EXPECT_OK(ov_compiled_model_get_property(compiled_model, key, &result));
ov_free(result);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, create_compiled_model_with_property) {
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
EXPECT_NE(nullptr, model);
const char* key = ov_property_key_hint_performance_mode;
const char* num = "LATENCY";
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
ov_compiled_model_t* compiled_model = nullptr;
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 2, &compiled_model, key, num));
EXPECT_NE(nullptr, compiled_model);
char* result = nullptr;
OV_EXPECT_OK(ov_compiled_model_get_property(compiled_model, key, &result));
EXPECT_STREQ(result, "LATENCY");
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
ov_free(result);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_outputs_size) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
size_t output_size;
OV_EXPECT_OK(ov_compiled_model_outputs_size(compiled_model, &output_size));
EXPECT_NE(0, output_size);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_output) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* output_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_output(compiled_model, &output_port));
EXPECT_NE(nullptr, output_port);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_output_const_port_free(output_port);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_output_by_index) {
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* output_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_output_by_index(compiled_model, 0, &output_port));
EXPECT_NE(nullptr, output_port);
ov_shape_t shape;
OV_ASSERT_OK(ov_const_port_get_shape(output_port, &shape));
ov_shape_free(&shape);
ov_output_const_port_free(output_port);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, ov_compiled_model_output_by_name) {
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
EXPECT_NE(nullptr, compiled_model);
ov_output_const_port_t* output_port = nullptr;
OV_EXPECT_OK(ov_compiled_model_output_by_name(compiled_model, "relu", &output_port));
EXPECT_NE(nullptr, output_port);
ov_shape_t shape;
OV_ASSERT_OK(ov_const_port_get_shape(output_port, &shape));
ov_shape_free(&shape);
ov_output_const_port_free(output_port);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, get_runtime_model) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_model_t* runtime_model = nullptr;
OV_EXPECT_OK(ov_compiled_model_get_runtime_model(compiled_model, &runtime_model));
EXPECT_NE(nullptr, runtime_model);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_free(runtime_model);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, get_runtime_model_error_handling) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_model_t* runtime_model = nullptr;
OV_EXPECT_NOT_OK(ov_compiled_model_get_runtime_model(nullptr, &runtime_model));
OV_EXPECT_NOT_OK(ov_compiled_model_get_runtime_model(compiled_model, nullptr));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_free(runtime_model);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, create_infer_request) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_infer_request_t* infer_request = nullptr;
OV_EXPECT_OK(ov_compiled_model_create_infer_request(compiled_model, &infer_request));
EXPECT_NE(nullptr, infer_request);
ov_infer_request_free(infer_request);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
TEST_P(ov_compiled_model_test, create_infer_request_error_handling) {
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
auto device_name = GetParam();
ov_core_t* core = nullptr;
OV_EXPECT_OK(ov_core_create(&core));
EXPECT_NE(nullptr, core);
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
ov_model_t* model = nullptr;
OV_EXPECT_OK(ov_core_read_model(core, xml_file_name.c_str(), bin_file_name.c_str(), &model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, model);
ov_compiled_model_t* compiled_model = nullptr;
[CAPI] improve property implement to achieve better compatibility (#12887) * Solve some code style issues Change-Id: I06c31ad9513463c758db96dbe33031983a8fd7a5 * Refine ov_dimension with C style structure Use C style definition to replace opaque C++ handle: 1). Improve partial shape 2). Improve dimension/rank 3). Improve shape Change-Id: I680fd3e76c63d0c06d9d8b07c67af0440fb15bb7 * Some minor update Change-Id: I237490a765e6ecd6f3896b1bd75d5f962304f43b * add partial_shape_is_dynamic and update doc Change-Id: Ief358f27de8386e35485d08847c8243d1490157f * Rename property and add basic test cases Change-Id: Ifbed0bbf7a5e836d2cab186763d7e5f8f2cb7d44 * address reviewer's comments Change-Id: I9a5d1ede6d086906f3777c3d29237986a505db52 * Fix compile error Change-Id: I72267a8dda32dd8f43c1ea1522d07b392052358f * Use ov_any_t to replace ov_property_value_t Change-Id: Ia4062d0da0941c901990bf5f16497ae3c8f2eb0f * update doc for ov_model Change-Id: I80183394f16dd1e07ff998993e26f8b903f2402e * Property key apply string variables replace enum variable Change-Id: I0e1699862de3913ccdc06ded5b8f8ac5a2bf8773 * Fix compiling error in windows Change-Id: I4f9c7c746e218db94491c5f4bc5aeda1b3fde62b * Change init/deinit method to create/free, remove unnecessary methods Change-Id: Ibc5de039da94e92db494583ab1ff1a63e0586c73 * Pass by value for single C structure data Change-Id: I289eb56e2ba1ab90942c8c801c585ab0f792952f * fix dllexport issue in windows Change-Id: I1632375e5e651fdfa076cdab2d8d1c3e83986549 * Fix static build error Change-Id: I6633fe4887edad0b3a8b7e10730fb9d36a6ac0cd * Use pass by value for all transparent structure Change-Id: I652f6e70b420ef7c5af5cff3f5d482911cf0d75a * Unify parameter order in C APIs, input first and then output parameters Change-Id: Ib89c77d81c314e3a81bfcec9917630abbc896f5e * Rename preprocess api to be more readable Change-Id: I0a8ecd005e73e4ba8e90a8f25bedf0739fe31836 * Simplfy property implement for set and get property Change-Id: Icad41606368cef9520b1623f6207784c295f1b9f * check string type property issue Change-Id: Ie8ee6995dda401f1db0cc098e061ffcfd24de92a * Fix memory leak Change-Id: Ife8980736be320314eca6fb3f3605e019663e1da * Check string property data Change-Id: I542a136ff874cb345c67f7d3c1dbc74981a909df * Fix issues caused by rebase Change-Id: I3d675a16cf76980a6414e369a83464a46dec1e49 * Remove some redundant code Change-Id: Iab6bf7f355ec7a7424d884e620319ed9db80ecf5 * Remove property type from interface ov_core_set_property will have 2 cases: 1) enum type: <const char* property_key, ov_property_xxx_e property_value> 2) other: <const char* property_key, const char* property_value> Change-Id: Id7dec1ac40948d45c4f8baee687652aee92ea75d * Remove redundant code Change-Id: I66865d3313e305b0109cb63bd049772a01c0688f * Remove exception log and update propery size argument Change-Id: Ia1a60c07c9adf08d175d94a7d5e4298adb27bf80 * Apply string for enum property Change-Id: I591b1db453a52b5ea9000e0cc3e11edf0ef5f790 * Add test case for MULTI_DEVICE_PRIORITIES Change-Id: I59e4307564a2560724b4dacdb83c3ed45ea1ce8d * Fix test issues and add more negative test case Change-Id: Ib849fb8c098e487a537c1b1ab881f5e905871f73
2022-09-20 05:59:27 -07:00
OV_EXPECT_OK(ov_core_compile_model(core, model, device_name.c_str(), 0, &compiled_model));
[C API] Refine OV 2.0 C APIs for better expansibility and compatibility (#12187) * [C API 2.0]Redifine partial shape and property wrapper 1. Use dimension object to initialize partial_shape rather than string 2. Use void* to unify property value rather than union 3. rename some C api name to strict align with C++ method. Change-Id: I64b5c521461264dba2d23543808584632fbd6d4b * [C API 2.0]Memory check and implement all reshape interface 1. Memory safe create and free 2. Implement all reshape interface align with C++ interface 3. rename some api to align with C++ interface Change-Id: Ib5e4192bdbd8a11cdd7e30b1dc84881ba3f2d505 * Rename prepostprocess to strict align with C++ name Change-Id: I7a4d0a6e835b2d6ed01cd218ac81b1b621f600bf * [C API 2.0]redefine ov_node and ov_model interface 1. redefine ov_node and ov_model interface 2. rename some api to aligne with C++ interface 3. remove some redundant code 4. align CMakeLists.txt with OpenVINO 2.0 convention Change-Id: I4d5e92157e7891319c9754da8e70b9c6150ae2e3 * Redefine ov_layout to support more than one char Change-Id: I39e5389246cf3edcc2f4734d13157457773d89b8 * Add interface to get partial_shape from node Change-Id: I8cef77db581b43d2f0a9ac48cfdc09a86e39b694 * Use unique_ptr prevent memory leaks in case of exception Change-Id: I150b375108a3eded400bdde087ab5c858958c25f * Put legacy C API and 2.0 C API into a library Change-Id: I067a55a00e78b80cdede5ae7adad316ee98cabd1 * Only keep OV 2.0 C sample and move legacy C sample to legacy directory 1. Move legacy C samples to tools/legacy/c directory 2. Keep OV 2.0 C samples in samples/c directory Change-Id: I05880d17ee7cb7eafc6853ebb5394f3969258592 * Fix format and log issues Change-Id: I05d909b3d7046d41b807e35808a993bb09672e68 * Restore documents update Change-Id: I82dd92081c0aa1a2d7dca7f114cf6a35131d6f92 * Change config map data be const Change-Id: I9043859e8308c01d80794dc8280ae236947f3bbb * Update api document Change-Id: I35bc149bad0de17424d95f48c3027030b708e147 * Add clang enable Change-Id: I335639c05fb5fb38e682dbb72bfaf78380c0adaf * Fix clang issue after enable clang for ie_c_api.c Change-Id: Idcb4dda9d66e47a169eb79a9c4fe7a7d4df838db * split header file and c file into multiple files Change-Id: I7c3398966809ef70d7fcb799f2d612a33b471e31 * Fix clang format issue Change-Id: Ibd18b45537c8f3bcbb5b995c90ae28999161d54d * Add single ov_dimension_create method Change-Id: Icd06b50e4f4df8f7897c7c4327edb67178162544 * Remove all legacy c samples completely Change-Id: I098360a0d9002340e8769074181f7997b43bce8f * Update ov_property_value to replace only ptr Change-Id: I9f5a11b4cf07e759c1998e78e2624f0a1266d9b0 * Split more header files, add static dimension api Change-Id: I14e4fb8585fc629480c06b86bd8219e75a9682f7 * Change ov_dimensions_create to be ov_dimensions_create_dynamic Change-Id: I50c02749cea96f12bcea702b53a89c65b289550e * rename status and get_out_tensor Change-Id: I762c1d0c5a069454506fe3c04283c63ddbfacf31 * Split ov_c_api_test.cpp * Split OV2.0 CAPI tests * move var into Setup * Merge legacy and 2.0 C API test * Merge InferenceEngineCAPITests into openvino_capi_test 1. put InferenceEngineCAPITests into openvino_capi_test 2. resolve some format issues Change-Id: I47bbba6bd70a871ee063becbd80eb57919fa9fb0 * legacy api test skips clang format Change-Id: Id54ecdba827cf98c99b92295c0a0772123098b63 * Fix clang format issue Change-Id: I7ed510d8178971fe04a895e812c261db99d8b9f2 * Restore InferenceEngineCAPITests Change-Id: I4d641ffb1de9ce4d20ebecf35fc036fa7bd73e55 * rename openvino_capi_test to ov_capi_test Change-Id: I6b6fe0cdb89aab7210abb17f32dbfdcdce72ba25 * unify list size name and refine ov_core_version_t Change-Id: I137fc6d990c7b07f597ee94fa3b98d07ae843cb6 * align header file path to be openvino/c/openvino.h Change-Id: I1a4552e1d558098af704942fe45488b0d6d53a90 * Fix path issue Change-Id: I84d425d25e3b08c1516cbcc842fb9cb75574bf17 * move ov_color_format and remove opencv depenency Change-Id: I486145f9e92e8bbf2e937d3572334aa9f0e68841 * Resolve some memory allocation error handling issues and read model with empty weight issue Change-Id: Icd8e3b6de9741147993fa215a0c7cfd7debd5500 * Add GPU test cases Change-Id: I13324ef019b5b1af79259ca932a36a0cec792c27 * Fix clang issue Change-Id: I9bb4c47de301d142b5e2a77a39f667689ad9fe38 * Resolve CI test failure Change-Id: Ia327d5edab19d8dd44ac369670f190d5c57aca79 * Redefine ov_shape and add default ov_core_create Change-Id: I3e47d607f8aad65cb99cdddacaecf7bf34b1361b * Remove some unnecessary api of node Remove the unnecessary node api: ov_node_get_any_name(ov_output_const_node_t* node, char** tensor_name) ov_node_get_element_type(ov_output_const_node_t* node, ov_element_type_e* tensor_type) Change-Id: I80a3243676800263a9e56afa3cfffce7b4bd2ae7 * Rename reshape api ov_model_reshape should be common case which allow to reshape any models with different number of input. Change-Id: I26bafeeb8a3dda7cd5164cda15fdb338db8668cb * Rename ov_node api Change-Id: I03114ecb6de5c46b6d02c909b6f6fb6c8bfd5cba * Remove subfolder out of source code Change-Id: Ib033ae7712cc0460d6fc21a0f89818381ae503c0 * apply absolute path for all header files Change-Id: I8024c897d424b407025e21460ed4b62829b853d2 * Fix CI issue ov_capi_test failed to find libgna Change-Id: I166e79a818498c6721fe956f43873f36d9ae1e07 * Resolve build issue to align with PR12214 Change-Id: I9e6094db213b431ee1b46e0d64199131db33bb36 Co-authored-by: ruiqi <ruiqi.yang@intel.com>
2022-08-14 23:51:34 +08:00
EXPECT_NE(nullptr, compiled_model);
ov_infer_request_t* infer_request = nullptr;
OV_EXPECT_NOT_OK(ov_compiled_model_create_infer_request(nullptr, &infer_request));
OV_EXPECT_NOT_OK(ov_compiled_model_create_infer_request(compiled_model, nullptr));
ov_infer_request_free(infer_request);
ov_compiled_model_free(compiled_model);
ov_model_free(model);
ov_core_free(core);
}
} // namespace