Remove nolint comments (#7020)
* Remove nolint comments * Fixed comment
This commit is contained in:
parent
b1f009d470
commit
22f29f092c
@ -142,8 +142,6 @@ if (TBBBIND_2_4_FOUND)
|
|||||||
target_link_libraries(${TARGET_NAME}_obj PRIVATE ${TBBBIND_2_4_IMPORTED_TARGETS})
|
target_link_libraries(${TARGET_NAME}_obj PRIVATE ${TBBBIND_2_4_IMPORTED_TARGETS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)
|
|
||||||
|
|
||||||
# Create shared library file from object library
|
# Create shared library file from object library
|
||||||
|
|
||||||
add_library(${TARGET_NAME} SHARED
|
add_library(${TARGET_NAME} SHARED
|
||||||
@ -152,6 +150,8 @@ add_library(${TARGET_NAME} SHARED
|
|||||||
${vs_version_file}
|
${vs_version_file}
|
||||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
|
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
|
||||||
|
|
||||||
|
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${IE_STATIC_DEPENDENT_FILES} ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${PUBLIC_HEADERS})
|
||||||
|
|
||||||
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
|
ov_ncc_naming_style(FOR_TARGET ${TARGET_NAME}
|
||||||
INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/openvino"
|
INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/openvino"
|
||||||
ADDITIONAL_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)
|
ADDITIONAL_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:ngraph,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief The PreAllocator class does not utilize this function
|
* @brief The PreAllocator class does not utilize this function
|
||||||
*/
|
*/
|
||||||
void unlock(void*) noexcept override {} // NOLINT
|
void unlock(void*) noexcept override {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns a pointer to preallocated memory
|
* @brief Returns a pointer to preallocated memory
|
||||||
@ -55,7 +55,7 @@ public:
|
|||||||
* @brief The PreAllocator class cannot release the handle
|
* @brief The PreAllocator class cannot release the handle
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
bool free(void*) noexcept override { // NOLINT
|
bool free(void*) noexcept override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -119,7 +119,7 @@ IE_DO_PRAGMA(warning(disable : 1786))
|
|||||||
# else
|
# else
|
||||||
# define INFERENCE_PLUGIN_API(type) extern "C" type
|
# define INFERENCE_PLUGIN_API(type) extern "C" type
|
||||||
# endif
|
# endif
|
||||||
#elif (__GNUC__ >= 4) // NOLINT
|
#elif (__GNUC__ >= 4)
|
||||||
# ifdef IMPLEMENT_INFERENCE_ENGINE_PLUGIN
|
# ifdef IMPLEMENT_INFERENCE_ENGINE_PLUGIN
|
||||||
# define INFERENCE_PLUGIN_API(type) extern "C" __attribute__((visibility("default"))) type
|
# define INFERENCE_PLUGIN_API(type) extern "C" __attribute__((visibility("default"))) type
|
||||||
# else
|
# else
|
||||||
|
@ -439,7 +439,7 @@ struct ThrowNow final {
|
|||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
# define IE_ASSERT(EXPRESSION) \
|
# define IE_ASSERT(EXPRESSION) \
|
||||||
if (!(EXPRESSION)) \
|
if (!(EXPRESSION)) \
|
||||||
IE_THROW(GeneralError) << " AssertionFailed: " << #EXPRESSION // NOLINT
|
IE_THROW(GeneralError) << " AssertionFailed: " << #EXPRESSION
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
@ -110,7 +110,7 @@ inline int parallel_get_env_threads() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif IE_THREAD == IE_THREAD_SEQ
|
#elif IE_THREAD == IE_THREAD_SEQ
|
||||||
# include <algorithm> // NOLINT
|
# include <algorithm>
|
||||||
inline int parallel_get_env_threads() {
|
inline int parallel_get_env_threads() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
template <class T,
|
template <class T,
|
||||||
typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, Parameter>::value &&
|
typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, Parameter>::value &&
|
||||||
!std::is_abstract<typename std::decay<T>::type>::value>::type>
|
!std::is_abstract<typename std::decay<T>::type>::value>::type>
|
||||||
Parameter(T&& parameter) { // NOLINT
|
Parameter(T&& parameter) {
|
||||||
static_assert(!std::is_same<typename std::decay<T>::type, Parameter>::value, "To prevent recursion");
|
static_assert(!std::is_same<typename std::decay<T>::type, Parameter>::value, "To prevent recursion");
|
||||||
ptr = new RealData<typename std::decay<T>::type>(std::forward<T>(parameter));
|
ptr = new RealData<typename std::decay<T>::type>(std::forward<T>(parameter));
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @param str char array
|
* @param str char array
|
||||||
*/
|
*/
|
||||||
Parameter(const char* str) : Parameter(std::string(str)) {} // NOLINT
|
Parameter(const char* str) : Parameter(std::string(str)) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
* @brief Constructor with specified precision
|
* @brief Constructor with specified precision
|
||||||
* @param value A value of ePrecision to create an object from
|
* @param value A value of ePrecision to create an object from
|
||||||
*/
|
*/
|
||||||
Precision(const Precision::ePrecision value) { // NOLINT
|
Precision(const Precision::ePrecision value) {
|
||||||
precisionInfo = getPrecisionInfo(value);
|
precisionInfo = getPrecisionInfo(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,90 +7,91 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef __MACH__
|
#ifdef __MACH__
|
||||||
#include <mach/clock.h>
|
# include <mach/clock.h>
|
||||||
#include <mach/mach.h>
|
# include <mach/mach.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <file_utils.h>
|
#include <file_utils.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "ie_common.h"
|
#include "ie_common.h"
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
# include <limits.h>
|
# include <dlfcn.h>
|
||||||
# include <unistd.h>
|
# include <limits.h>
|
||||||
# include <dlfcn.h>
|
# include <unistd.h>
|
||||||
# ifdef ENABLE_UNICODE_PATH_SUPPORT
|
# ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||||
# include <locale>
|
# include <codecvt>
|
||||||
# include <codecvt>
|
# include <locale>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# if defined(WINAPI_FAMILY) && !WINAPI_PARTITION_DESKTOP
|
# if defined(WINAPI_FAMILY) && !WINAPI_PARTITION_DESKTOP
|
||||||
# error "Only WINAPI_PARTITION_DESKTOP is supported, because of GetModuleHandleEx[A|W]"
|
# error "Only WINAPI_PARTITION_DESKTOP is supported, because of GetModuleHandleEx[A|W]"
|
||||||
# endif
|
# endif
|
||||||
# ifndef NOMINMAX
|
# ifndef NOMINMAX
|
||||||
# define NOMINMAX
|
# define NOMINMAX
|
||||||
# endif
|
# endif
|
||||||
# include <Windows.h>
|
# include <Windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#include <direct.h>
|
# include <direct.h>
|
||||||
|
|
||||||
// Copied from linux libc sys/stat.h:
|
// Copied from linux libc sys/stat.h:
|
||||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
# define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
||||||
|
|
||||||
/// @brief Windows-specific 'mkdir' wrapper
|
/// @brief Windows-specific 'mkdir' wrapper
|
||||||
#define makedir(dir) _mkdir(dir)
|
# define makedir(dir) _mkdir(dir)
|
||||||
|
|
||||||
/// @brief Max length of absolute file path
|
/// @brief Max length of absolute file path
|
||||||
#define MAX_ABS_PATH _MAX_PATH
|
# define MAX_ABS_PATH _MAX_PATH
|
||||||
/// @brief Get absolute file path, returns NULL in case of error
|
/// @brief Get absolute file path, returns NULL in case of error
|
||||||
#define get_absolute_path(result, path) _fullpath(result, path.c_str(), MAX_ABS_PATH)
|
# define get_absolute_path(result, path) _fullpath(result, path.c_str(), MAX_ABS_PATH)
|
||||||
|
|
||||||
/// @brief Windows-specific 'stat' wrapper
|
/// @brief Windows-specific 'stat' wrapper
|
||||||
#define stat _stat
|
# define stat _stat
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <unistd.h>
|
# include <unistd.h>
|
||||||
|
|
||||||
/// @brief mkdir wrapper
|
/// @brief mkdir wrapper
|
||||||
#define makedir(dir) mkdir(dir, 0755)
|
# define makedir(dir) mkdir(dir, 0755)
|
||||||
|
|
||||||
/// @brief Max length of absolute file path
|
/// @brief Max length of absolute file path
|
||||||
#define MAX_ABS_PATH PATH_MAX
|
# define MAX_ABS_PATH PATH_MAX
|
||||||
/// @brief Get absolute file path, returns NULL in case of error
|
/// @brief Get absolute file path, returns NULL in case of error
|
||||||
#define get_absolute_path(result, path) realpath(path.c_str(), result)
|
# define get_absolute_path(result, path) realpath(path.c_str(), result)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||||
|
|
||||||
std::string FileUtils::wStringtoMBCSstringChar(const std::wstring& wstr) {
|
std::string FileUtils::wStringtoMBCSstringChar(const std::wstring& wstr) {
|
||||||
#ifdef _WIN32
|
# ifdef _WIN32
|
||||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); // NOLINT
|
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
|
||||||
std::string strTo(size_needed, 0);
|
std::string strTo(size_needed, 0);
|
||||||
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); // NOLINT
|
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
|
||||||
return strTo;
|
return strTo;
|
||||||
#else
|
# else
|
||||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
|
||||||
return wstring_decoder.to_bytes(wstr);
|
return wstring_decoder.to_bytes(wstr);
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring FileUtils::multiByteCharToWString(const char* str) {
|
std::wstring FileUtils::multiByteCharToWString(const char* str) {
|
||||||
#ifdef _WIN32
|
# ifdef _WIN32
|
||||||
int strSize = static_cast<int>(std::strlen(str));
|
int strSize = static_cast<int>(std::strlen(str));
|
||||||
int size_needed = MultiByteToWideChar(CP_UTF8, 0, str, strSize, NULL, 0);
|
int size_needed = MultiByteToWideChar(CP_UTF8, 0, str, strSize, NULL, 0);
|
||||||
std::wstring wstrTo(size_needed, 0);
|
std::wstring wstrTo(size_needed, 0);
|
||||||
MultiByteToWideChar(CP_UTF8, 0, str, strSize, &wstrTo[0], size_needed);
|
MultiByteToWideChar(CP_UTF8, 0, str, strSize, &wstrTo[0], size_needed);
|
||||||
return wstrTo;
|
return wstrTo;
|
||||||
#else
|
# else
|
||||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_encoder;
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_encoder;
|
||||||
std::wstring result = wstring_encoder.from_bytes(str);
|
std::wstring result = wstring_encoder.from_bytes(str);
|
||||||
return result;
|
return result;
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
||||||
@ -123,7 +124,7 @@ std::string FileUtils::absoluteFilePath(const std::string& filePath) {
|
|||||||
return absolutePath;
|
return absolutePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileUtils::directoryExists(const std::string &path) {
|
bool FileUtils::directoryExists(const std::string& path) {
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
if (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
|
if (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
|
||||||
@ -145,8 +146,7 @@ void FileUtils::createDirectoryRecursive(const std::string& dirPath) {
|
|||||||
int err = makedir(dirPath.c_str());
|
int err = makedir(dirPath.c_str());
|
||||||
if (err != 0 && errno != EEXIST) {
|
if (err != 0 && errno != EEXIST) {
|
||||||
// TODO: in case of exception it may be needed to remove all created sub-directories
|
// TODO: in case of exception it may be needed to remove all created sub-directories
|
||||||
IE_THROW() << "Couldn't create directory ["
|
IE_THROW() << "Couldn't create directory [" << dirPath << "], err=" << strerror(errno) << ")";
|
||||||
<< dirPath << "], err=" << strerror(errno) << ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ namespace InferenceEngine {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template <typename C, typename = InferenceEngine::details::enableIfSupportedChar<C> >
|
template <typename C, typename = InferenceEngine::details::enableIfSupportedChar<C>>
|
||||||
std::basic_string<C> getPathName(const std::basic_string<C>& s) {
|
std::basic_string<C> getPathName(const std::basic_string<C>& s) {
|
||||||
size_t i = s.rfind(FileUtils::FileTraits<C>::FileSeparator, s.length());
|
size_t i = s.rfind(FileUtils::FileTraits<C>::FileSeparator, s.length());
|
||||||
if (i != std::string::npos) {
|
if (i != std::string::npos) {
|
||||||
@ -171,50 +171,52 @@ static std::string getIELibraryPathA() {
|
|||||||
CHAR ie_library_path[MAX_PATH];
|
CHAR ie_library_path[MAX_PATH];
|
||||||
HMODULE hm = NULL;
|
HMODULE hm = NULL;
|
||||||
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||||
reinterpret_cast<LPSTR>(getIELibraryPath), &hm)) {
|
reinterpret_cast<LPSTR>(getIELibraryPath),
|
||||||
|
&hm)) {
|
||||||
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
||||||
}
|
}
|
||||||
GetModuleFileNameA(hm, (LPSTR)ie_library_path, sizeof(ie_library_path));
|
GetModuleFileNameA(hm, (LPSTR)ie_library_path, sizeof(ie_library_path));
|
||||||
return getPathName(std::string(ie_library_path));
|
return getPathName(std::string(ie_library_path));
|
||||||
#elif defined(__APPLE__) || defined(__linux__)
|
#elif defined(__APPLE__) || defined(__linux__)
|
||||||
# ifdef USE_STATIC_IE
|
# ifdef USE_STATIC_IE
|
||||||
# ifdef __APPLE__
|
# ifdef __APPLE__
|
||||||
Dl_info info;
|
Dl_info info;
|
||||||
dladdr(reinterpret_cast<void*>(getIELibraryPath), &info);
|
dladdr(reinterpret_cast<void*>(getIELibraryPath), &info);
|
||||||
std::string path = getPathName(std::string(info.dli_fname)).c_str();
|
std::string path = getPathName(std::string(info.dli_fname)).c_str();
|
||||||
# else
|
# else
|
||||||
char result[PATH_MAX];
|
char result[PATH_MAX];
|
||||||
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
|
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
|
||||||
std::string path = getPathName(std::string(result, (count > 0) ? count : 0));
|
std::string path = getPathName(std::string(result, (count > 0) ? count : 0));
|
||||||
# endif // __APPLE__
|
# endif // __APPLE__
|
||||||
return FileUtils::makePath(path, std::string( "lib"));
|
return FileUtils::makePath(path, std::string("lib"));
|
||||||
# else
|
# else
|
||||||
Dl_info info;
|
Dl_info info;
|
||||||
dladdr(reinterpret_cast<void*>(getIELibraryPath), &info);
|
dladdr(reinterpret_cast<void*>(getIELibraryPath), &info);
|
||||||
return getPathName(std::string(info.dli_fname)).c_str();
|
return getPathName(std::string(info.dli_fname)).c_str();
|
||||||
# endif // USE_STATIC_IE
|
# endif // USE_STATIC_IE
|
||||||
#else
|
#else
|
||||||
# error "Unsupported OS"
|
# error "Unsupported OS"
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||||
|
|
||||||
std::wstring getIELibraryPathW() {
|
std::wstring getIELibraryPathW() {
|
||||||
#ifdef _WIN32
|
# ifdef _WIN32
|
||||||
WCHAR ie_library_path[MAX_PATH];
|
WCHAR ie_library_path[MAX_PATH];
|
||||||
HMODULE hm = NULL;
|
HMODULE hm = NULL;
|
||||||
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||||
reinterpret_cast<LPCWSTR>(getIELibraryPath), &hm)) {
|
reinterpret_cast<LPCWSTR>(getIELibraryPath),
|
||||||
|
&hm)) {
|
||||||
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
IE_THROW() << "GetModuleHandle returned " << GetLastError();
|
||||||
}
|
}
|
||||||
GetModuleFileNameW(hm, (LPWSTR)ie_library_path, sizeof(ie_library_path) / sizeof(ie_library_path[0]));
|
GetModuleFileNameW(hm, (LPWSTR)ie_library_path, sizeof(ie_library_path) / sizeof(ie_library_path[0]));
|
||||||
return getPathName(std::wstring(ie_library_path));
|
return getPathName(std::wstring(ie_library_path));
|
||||||
#elif defined(__linux__) || defined(__APPLE__)
|
# elif defined(__linux__) || defined(__APPLE__)
|
||||||
return ::FileUtils::multiByteCharToWString(getIELibraryPathA().c_str());
|
return ::FileUtils::multiByteCharToWString(getIELibraryPathA().c_str());
|
||||||
#else
|
# else
|
||||||
# error "Unsupported OS"
|
# error "Unsupported OS"
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
#endif // ENABLE_UNICODE_PATH_SUPPORT
|
||||||
|
Loading…
Reference in New Issue
Block a user