endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- # 161 unrecognized pragma
- # 177 variable was declared but never referenced
- # 556 not matched type of assigned function pointer
+ # 161: unrecognized pragma
+ # 177: variable was declared but never referenced
+ # 556: not matched type of assigned function pointer
# 1744: field of class type without a DLL interface used in a class with a DLL interface
- # 2586 decorated name length exceeded, name was truncated
+ # 1879: unimplemented pragma ignored
+ # 2586: decorated name length exceeded, name was truncated
# 2651: attribute does not apply to any entity
- # 3180 unrecognized OpenMP pragma
+ # 3180: unrecognized OpenMP pragma
# 11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
- # 15335 was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
- ie_add_compiler_flags(/Qdiag-disable:161,177,556,1744,2586,2651,3180,11075,15335)
+ # 15335: was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
+ ie_add_compiler_flags(/Qdiag-disable:161,177,556,1744,1879,2586,2651,3180,11075,15335)
endif()
# Debug information flags
set(omp_lib_name iomp5)
endif ()
- if (NOT(IE_MAIN_SOURCE_DIR))
+ if (NOT IE_MAIN_SOURCE_DIR)
if (WIN32)
set(lib_rel_path ${IE_LIB_REL_DIR})
set(lib_dbg_path ${IE_LIB_DBG_DIR})
*/
#pragma once
-#ifndef _WIN32
-# include "os/lin_shared_object_loader.h"
-#else
-# include "os/win_shared_object_loader.h"
+#include <memory>
+
+#include "ie_api.h"
+
+namespace InferenceEngine {
+namespace details {
+
+/**
+ * @brief This class provides an OS shared module abstraction
+ */
+class INFERENCE_ENGINE_API_CLASS(SharedObjectLoader) {
+ class Impl;
+ std::shared_ptr<Impl> _impl;
+
+public:
+ /**
+ * @brief A shared pointer to SharedObjectLoader
+ */
+ using Ptr = std::shared_ptr<SharedObjectLoader>;
+
+#ifdef ENABLE_UNICODE_PATH_SUPPORT
+ /**
+ * @brief Loads a library with the wide char name specified.
+ * @param pluginName Full or relative path to the plugin library
+ */
+ explicit SharedObjectLoader(const wchar_t* pluginName);
#endif
+
+ /**
+ * @brief Loads a library with the name specified.
+ * @param pluginName Full or relative path to the plugin library
+ */
+ explicit SharedObjectLoader(const char * pluginName);
+
+ /**
+ * @brief A destructor
+ */
+ ~SharedObjectLoader() noexcept(false);
+
+ /**
+ * @brief Searches for a function symbol in the loaded module
+ * @param symbolName Name of function to find
+ * @return A pointer to the function if found
+ * @throws InferenceEngineException if the function is not found
+ */
+ void* get_symbol(const char* symbolName) const;
+};
+
+} // namespace details
+} // namespace InferenceEngine
#include "ie_compound_blob.h"
#include "ie_remote_context.hpp"
+#include "ie_core.hpp"
#include "gpu/gpu_params.hpp"
#include "gpu/gpu_ocl_wrapper.hpp"
return std::dynamic_pointer_cast<Blob>(casted->CreateBlob(desc, params));
}
-}; // namespace gpu
+} // namespace gpu
-}; // namespace InferenceEngine
+} // namespace InferenceEngine
#define IE_THREAD_TBB_AUTO 3
#if (IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO)
-#define TBB_PREVIEW_LOCAL_OBSERVER 1
+#ifndef NOMINMAX
+# define NOMINMAX
+#endif
+#ifndef TBB_PREVIEW_LOCAL_OBSERVER
+# define TBB_PREVIEW_LOCAL_OBSERVER 1
+#endif
#ifndef TBB_PREVIEW_NUMA_SUPPORT
-#define TBB_PREVIEW_NUMA_SUPPORT 1
+# define TBB_PREVIEW_NUMA_SUPPORT 1
#endif
#include "tbb/blocked_range.h"
#include "tbb/blocked_range2d.h"
inline int parallel_get_thread_num() {
return tbb::this_task_arena::current_thread_index();
}
-inline void parallel_set_num_threads(int n) {
+inline void parallel_set_num_threads(int) {
return;
}
inline int parallel_get_env_threads() {
inline int parallel_get_thread_num() {
return 0;
}
-inline void parallel_set_num_threads(int n) {
+inline void parallel_set_num_threads(int) {
return;
}
#endif
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") #treating warnings as errors
endif ()
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qdiag-disable:177")
+ endif()
+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4267 /wd4819") #disable some warnings
endif()
#include <ie_util_internal.hpp>
#include <graph_transformer.h>
-#undef min
-#undef max
-
#include "cldnn_engine.h"
#include "cldnn_executable_network.h"
#include "cldnn_custom_layer.h"
#include <utility>
#include <sys/types.h>
-#include <exec_graph_info.hpp>
#include "cldnn_executable_network.h"
#include "threading/ie_cpu_streams_executor.hpp"
#pragma once
+#ifndef NOMINMAX
+# define NOMINMAX
+#endif
+
#include <vector>
#include <map>
#include <set>
#include <map>
#include <functional>
#include <utility>
-#include <api/detection_output.hpp> // todo: find a way to remove this
#include <description_buffer.hpp>
#include "cldnn_infer_request.h"
#include "cldnn_remote_context.h"
#include <api/memory.hpp>
#include <api/engine.hpp>
#include "cldnn_common_utils.h"
+
+#ifndef NOMINMAX
+# define NOMINMAX
+#endif
+
#ifdef WIN32
#include <gpu/gpu_context_api_dx.hpp>
#else
${CMAKE_CURRENT_SOURCE_DIR}/network_serializer.hpp
${CMAKE_CURRENT_SOURCE_DIR}/system_allocator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/system_allocator.hpp)
-list(REMOVE_ITEM LIBRARY_SRC ${IE_BASE_SOURCE_FILES})
if (LINUX)
file (GLOB LIBRARY_SRC
${CMAKE_CURRENT_SOURCE_DIR}/os/lin/*.hpp)
endif()
+if(UNIX)
+ list(APPEND IE_BASE_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/os/lin/lin_shared_object_loader.cpp)
+endif()
+
if (WIN32)
file (GLOB LIBRARY_SRC
${LIBRARY_SRC}
file (GLOB LIBRARY_HEADERS
${LIBRARY_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/os/win/*.hpp)
+ list(APPEND IE_BASE_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/os/win/win_shared_object_loader.cpp)
endif()
+list(REMOVE_ITEM LIBRARY_SRC ${IE_BASE_SOURCE_FILES})
+
file (GLOB LIBRARY_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/*.h
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
set_ie_threading_interface_for(${TARGET_NAME}_obj)
-if(WIN32)
- # To disable min/max macro in windows.h
- target_compile_definitions(${TARGET_NAME}_obj PRIVATE -DNOMINMAX)
-endif()
-
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}_obj)
# Create shared library file from object library
#ifndef _WIN32
# include <limits.h>
# include <unistd.h>
+# include <dlfcn.h>
+#else
+# include <Windows.h>
#endif
#include "details/ie_so_pointer.hpp"
// SPDX-License-Identifier: Apache-2.0
//
-/**
- * @brief POSIX compatible loader for a shared object
- *
- * @file lin_shared_object_loader.h
- */
-#pragma once
-
#include <dlfcn.h>
-#include "ie_api.h"
#include "details/ie_exception.hpp"
#include "details/os/os_filesystem.hpp"
+#include "details/ie_so_loader.h"
namespace InferenceEngine {
namespace details {
-/**
- * @brief This class provides an OS shared module abstraction
- */
-class SharedObjectLoader {
+class SharedObjectLoader::Impl {
private:
void* shared_object = nullptr;
public:
- /**
- * @brief A shared pointer to SharedObjectLoader
- */
- using Ptr = std::shared_ptr<InferenceEngine::details::SharedObjectLoader>;
-
- /**
- * @brief Loads a library with the name specified. The library is loaded according to
- * the POSIX rules for dlopen
- * @param pluginName Full or relative path to the library
- */
- explicit SharedObjectLoader(const char* pluginName) {
+ explicit Impl(const char* pluginName) {
shared_object = dlopen(pluginName, RTLD_LAZY);
if (shared_object == nullptr)
}
#ifdef ENABLE_UNICODE_PATH_SUPPORT
- /**
- * @brief Loads a library with the name specified. The library is loaded according to
- * the POSIX rules for dlopen
- * @param pluginName Full or relative path to the library
- */
- explicit SharedObjectLoader(const wchar_t* pluginName) : SharedObjectLoader(wStringtoMBCSstringChar(pluginName).c_str()) {
+ explicit Impl(const wchar_t* pluginName) : Impl(wStringtoMBCSstringChar(pluginName).c_str()) {
}
-
#endif // ENABLE_UNICODE_PATH_SUPPORT
- ~SharedObjectLoader() noexcept(false) {
+ ~Impl() noexcept(false) {
if (0 != dlclose(shared_object)) {
THROW_IE_EXCEPTION << "dlclose failed: " << dlerror();
}
}
};
+#ifdef ENABLE_UNICODE_PATH_SUPPORT
+SharedObjectLoader::SharedObjectLoader(const wchar_t* pluginName) {
+ _impl.reset(new Impl(pluginName));
+}
+#endif
+
+SharedObjectLoader::SharedObjectLoader(const char * pluginName) {
+ _impl.reset(new Impl(pluginName));
+}
+
+SharedObjectLoader::~SharedObjectLoader() noexcept(false) {
+}
+
+void* SharedObjectLoader::get_symbol(const char* symbolName) const {
+ return _impl->get_symbol(symbolName);
+}
+
} // namespace details
} // namespace InferenceEngine
// SPDX-License-Identifier: Apache-2.0
//
-/**
- * @brief WINAPI compatible loader for a shared object
- *
- * @file win_shared_object_loader.h
- */
-#pragma once
-
-#include "ie_api.h"
#include "details/ie_exception.hpp"
#include "details/os/os_filesystem.hpp"
-
-// Avoidance of Windows.h to include winsock library.
-#ifndef _WINSOCKAPI_
-# define _WINSOCKAPI_
-#endif
-
-// Avoidance of Windows.h to define min/max.
-#ifndef NOMINMAX
-# define NOMINMAX
-#endif
+#include "details/ie_so_loader.h"
#include <direct.h>
#include <windows.h>
namespace InferenceEngine {
namespace details {
-/**
- * @brief This class provides an OS shared module abstraction
- */
-class SharedObjectLoader {
+class SharedObjectLoader::Impl {
private:
HMODULE shared_object;
}
public:
- /**
- * @brief A shared pointer to SharedObjectLoader
- */
- using Ptr = std::shared_ptr<SharedObjectLoader>;
-
#ifdef ENABLE_UNICODE_PATH_SUPPORT
- /**
- * @brief Loads a library with the name specified. The library is loaded according to the
- * WinAPI LoadLibrary rules
- * @param pluginName Full or relative path to the plugin library
- */
- explicit SharedObjectLoader(LPCWSTR pluginName) {
+ explicit Impl(const wchar_t* pluginName) {
ExcludeCurrentDirectory();
shared_object = LoadLibraryW(pluginName);
}
#endif
- explicit SharedObjectLoader(LPCSTR pluginName) {
+ explicit Impl(const char* pluginName) {
ExcludeCurrentDirectory();
shared_object = LoadLibraryA(pluginName);
}
}
- ~SharedObjectLoader() {
+ ~Impl() {
FreeLibrary(shared_object);
}
- /**
- * @brief Searches for a function symbol in the loaded module
- * @param symbolName Name of function to find
- * @return A pointer to the function if found
- * @throws InferenceEngineException if the function is not found
- */
void* get_symbol(const char* symbolName) const {
if (!shared_object) {
THROW_IE_EXCEPTION << "Cannot get '" << symbolName << "' content from unknown library!";
}
};
+#ifdef ENABLE_UNICODE_PATH_SUPPORT
+SharedObjectLoader::SharedObjectLoader(const wchar_t* pluginName) {
+ _impl = std::make_shared<Impl>(pluginName);
+}
+#endif
+
+SharedObjectLoader::~SharedObjectLoader() noexcept(false) {
+}
+
+SharedObjectLoader::SharedObjectLoader(const char * pluginName) {
+ _impl = std::make_shared<Impl>(pluginName);
+}
+
+void* SharedObjectLoader::get_symbol(const char* symbolName) const {
+ return _impl->get_symbol(symbolName);
+}
+
} // namespace details
} // namespace InferenceEngine
} else if (auto a = ::ngraph::as_type<::ngraph::AttributeAdapter<::ngraph::PartialShape>>(&adapter)) {
std::string dims;
auto shape = static_cast<::ngraph::PartialShape&>(*a);
- for (size_t i = 0; i < shape.rank().get_length(); i++) {
+ for (int64_t i = 0; i < shape.rank().get_length(); i++) {
if (!dims.empty()) dims += ",";
dims += std::to_string(shape[i].get_length());
}
bool is_deconv = (layer.type == "Deconvolution");
for (size_t i = 0; i < layer._kernel.size(); i++) {
- float PA = 0;
+ int PA = 0;
int kernel = getKernel(layer, i);
int stride = layer._stride.size() > i ? layer._stride[i] : 1;
// SPDX-License-Identifier: Apache-2.0
//
-// avoiding clash of the "max" macro with std::max
-#define NOMINMAX
-
#include "config.h"
#include <string>
#include <ie_parallel.hpp>
#if (IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO)
-#include <tbb/concurrent_queue.h>
+# include <tbb/concurrent_queue.h>
#endif
namespace MultiDevicePlugin {
*/
#include "ie_parallel.hpp"
+
#if IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO
-#include <tbb/enumerable_thread_specific.h>
+# include <tbb/enumerable_thread_specific.h>
#else
-#include <unordered_map>
-#include <memory>
-#include <thread>
-#include <mutex>
-#include <utility>
-#include <functional>
+# include <unordered_map>
+# include <memory>
+# include <thread>
+# include <mutex>
+# include <utility>
+# include <functional>
#endif
namespace InferenceEngine {
target_include_directories(${TARGET_NAME}_obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
$<TARGET_PROPERTY:openvino::itt,INTERFACE_INCLUDE_DIRECTORIES>)
-if(WIN32)
- # To disable min/max macro in windows.h
- target_compile_definitions(${TARGET_NAME}_obj PRIVATE NOMINMAX)
-endif()
-
set_ie_threading_interface_for(${TARGET_NAME}_obj)
# Create shared library file from object library
set(IE_TEST_CXX_STANDARD ${CMAKE_CXX_STANDARD})
endif()
+ if(NOT CLDNN__IOCL_ICD_INCDIRS)
+ list(APPEND IE_TEST_HEADERS_TO_SKIP "gpu/gpu_ocl_wrapper.hpp"
+ "gpu/gpu_context_api_ocl.hpp"
+ "gpu/gpu_context_api_va.hpp"
+ "gpu/gpu_context_api_dx.hpp")
+ endif()
+ if(NOT WIN32)
+ list(APPEND IE_TEST_HEADERS_TO_SKIP "gpu/gpu_context_api_dx.hpp")
+ endif()
+ if(NOT LIBVA_FOUND)
+ list(APPEND IE_TEST_HEADERS_TO_SKIP "gpu/gpu_context_api_va.hpp")
+ endif()
+
set(content "\n")
foreach(header_file IN LISTS header_files)
- # OpenCL is not available
- if(header_file STREQUAL "ie_parallel.hpp" OR
- header_file STREQUAL "gpu/gpu_ocl_wrapper.hpp" OR
- header_file STREQUAL "gpu/gpu_context_api_ocl.hpp" OR
- header_file STREQUAL "gpu/gpu_context_api_dx.hpp" OR
- header_file STREQUAL "gpu/gpu_context_api_va.hpp")
- continue()
- endif()
-
- # Skip Windows header on Unix
- if(UNIX AND header_file STREQUAL "details/os/win_shared_object_loader.h")
- continue()
- endif()
-
- # Skip Unix heaeder on Windows
- if(WIN32 AND header_file STREQUAL "details/os/lin_shared_object_loader.h")
- continue()
- endif()
-
# skip user-passed headers
set(skip_current_file OFF)
foreach(skip_file IN LISTS IE_TEST_HEADERS_TO_SKIP)
add_library(${target_name} OBJECT ${source_file})
target_include_directories(${target_name} PRIVATE $<TARGET_PROPERTY:inference_engine,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(${target_name} PRIVATE $<TARGET_PROPERTY:inference_engine,INTERFACE_COMPILE_DEFINITIONS>)
-
+
+ # To include TBB headers as system
+ set_ie_threading_interface_for(${target_name})
+
+ # OpenCL headers if any
+ if(CLDNN__IOCL_ICD_INCDIRS)
+ target_include_directories(${target_name} SYSTEM PRIVATE ${CLDNN__IOCL_ICD_INCDIRS})
+ endif()
+
set_target_properties(${target_name} PROPERTIES
CXX_STANDARD ${IE_TEST_CXX_STANDARD}
CXX_STANDARD_REQUIRED OFF)
endif()
else()
ie_headers_compilation_with_custom_flags(TEST_SUFFIX WindowsAreErrors
- FLAGS "/we4996 /W4 /WX")
+ HEADERS_TO_SKIP "gpu/gpu_ocl_wrapper.hpp"
+ "gpu/gpu_context_api_ocl.hpp"
+ "gpu/gpu_context_api_dx.hpp"
+ FLAGS "/we4996 /W4 /WX")
ie_headers_compilation_with_custom_flags(TEST_SUFFIX Unicode
DEFINITIONS UNICODE _UNICODE)
endif()
LABELS
GPU
)
+
+if(LIBVA_FOUND)
+ target_compile_definitions(${TARGET_NAME} PRIVATE ENABLE_LIBVA)
+ target_include_directories(${TARGET_NAME} PRIVATE ${LIBVA_INCLUDE_DIRS})
+ target_link_libraries(${TARGET_NAME} PRIVATE ${LIBVA_LINK_LIBRARIES})
+endif()
#include <vector>
#include <memory>
-#include <inference_engine.hpp>
#include <ie_compound_blob.h>
#include <cldnn/cldnn_config.hpp>
#include <vector>
#include <memory>
+#ifndef NOMINMAX
+# define NOMINMAX
+#endif
#ifdef _WIN32
# include <gpu/gpu_context_api_dx.hpp>
# TODO: pkg_search_module finds libva not in sysroot
if(ANDROID)
- set(LIBVA_FOUND OFF)
+ set(LIBVA_FOUND OFF CACHE BOOL "" FORCE)
endif()
if(LIBVA_FOUND)