Skip to content

Commit

Permalink
Ability to compile samples without API 1.0 headers (openvinotoolkit#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Oct 8, 2023
1 parent ffbffed commit 142c6a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 3 additions & 1 deletion samples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ macro(ie_add_sample)
find_package(Threads REQUIRED)

find_package(OpenVINO REQUIRED COMPONENTS Runtime)
if(c_sample)

# Conan does not generate openvino::runtime::c target
if(c_sample AND TARGET openvino::runtime::c)
set(ov_link_libraries openvino::runtime::c)
else()
set(ov_link_libraries openvino::runtime)
Expand Down
16 changes: 6 additions & 10 deletions samples/cpp/benchmark_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
# define WAS_OV_LIBRARY_DEFINED
#endif

#include "gna/gna_config.hpp"
#include "gpu/gpu_config.hpp"

#ifdef WAS_OV_LIBRARY_DEFINED
# undef IN_OV_COMPONENT
# undef WAS_OV_LIBRARY_DEFINED
Expand Down Expand Up @@ -314,11 +311,11 @@ int main(int argc, char* argv[]) {
// Override config if command line parameter is specified
if (!config.count("GPU"))
config["GPU"] = {};
config["GPU"][CONFIG_KEY(CONFIG_FILE)] = FLAGS_c;
config["GPU"]["CONFIG_FILE"] = FLAGS_c;
}
if (config.count("GPU") && config.at("GPU").count(CONFIG_KEY(CONFIG_FILE))) {
auto ext = config.at("GPU").at(CONFIG_KEY(CONFIG_FILE)).as<std::string>();
core.set_property("GPU", {{CONFIG_KEY(CONFIG_FILE), ext}});
if (config.count("GPU") && config.at("GPU").count("CONFIG_FILE")) {
auto ext = config.at("GPU").at("CONFIG_FILE").as<std::string>();
core.set_property("GPU", {{"CONFIG_FILE", ext}});
slog::info << "GPU extensions are loaded: " << ext << slog::endl;
}
OPENVINO_SUPPRESS_DEPRECATED_END
Expand Down Expand Up @@ -846,9 +843,8 @@ int main(int argc, char* argv[]) {
slog::info << " " << item.first << ": " << slog::endl;
for (auto& item2 : item.second.as<ov::AnyMap>()) {
OPENVINO_SUPPRESS_DEPRECATED_START
if (item2.first == ov::supported_properties ||
item2.first == METRIC_KEY(SUPPORTED_CONFIG_KEYS) ||
item2.first == METRIC_KEY(SUPPORTED_METRICS))
if (item2.first == ov::supported_properties || item2.first == "SUPPORTED_CONFIG_KEYS)" ||
item2.first == "SUPPORTED_METRICS")
continue;
OPENVINO_SUPPRESS_DEPRECATED_END
slog::info << " " << item2.first << ": " << item2.second.as<std::string>() << slog::endl;
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp/benchmark_app/remote_tensors_filling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#if defined(HAVE_GPU_DEVICE_MEM_SUPPORT)
# define HAVE_DEVICE_MEM_SUPPORT
# include <gpu/gpu_context_api_ocl.hpp>
# include "openvino/runtime/intel_gpu/ocl/ocl_wrapper.hpp"
#endif
#include "utils.hpp"

Expand Down

0 comments on commit 142c6a4

Please sign in to comment.