Fixed LTO build (#16629)

* Partially fixed LTO

* Fixed issues with cnpy LTO

* CPU

* Disabled failing GPU test
This commit is contained in:
Ilya Lavrenov authored and GitHub committed 2023-03-31 11:34:42 +04:00
1 parent 43fca3d231
commit ee0bb79ed6
9 files changed
+10 -12

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ include(target_flags)
# FIXME: there are compiler failures with LTO and Cross-Compile toolchains. Disabling for now, but
# this must be addressed in a proper way
ie_dependent_option (ENABLE_LTO "Enable Link Time Optimization" OFF
"LINUX OR (APPLE AND AARCH64);EMSCRIPTEN OR NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
"LINUX;EMSCRIPTEN OR NOT CMAKE_CROSSCOMPILING;CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9" OFF)
ie_option (OS_FOLDER "create OS dedicated folder in output" OFF)
-1
View File
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
#
add_subdirectory(src)
if(ENABLE_TESTS)
-2
View File
@@ -4,8 +4,6 @@
#include "op_fuzzy.hpp"
#include <cnpy.h>
#include <fstream>
#include "engines_util/test_engines.hpp"
-2
View File
@@ -2,6 +2,4 @@
# SPDX-License-Identifier: Apache-2.0
#
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
add_subdirectory(frontend/shared)
@@ -38,8 +38,8 @@ void FrontEndFuzzyOpTest::doLoadFromFile() {
}
template <typename T>
inline void addInputOutput(cnpy::NpyArray& npy_array, test::TestCase& test_case, bool is_input = true) {
T* npy_begin = npy_array.data<T>();
inline void addInputOutput(const cnpy::NpyArray& npy_array, test::TestCase& test_case, bool is_input = true) {
const T* npy_begin = npy_array.data<T>();
std::vector<T> data(npy_begin, npy_begin + npy_array.num_vals);
if (is_input)
test_case.add_input(npy_array.shape, data);
@@ -44,6 +44,9 @@ addIeTargetTest(
CPU
)
# LTO
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE
$<TARGET_PROPERTY:dnnl,INCLUDE_DIRECTORIES>)
@@ -2360,7 +2360,7 @@ TEST(DISABLED_lstm_gpu, generic_lstm_clip_f16_cached) {
generic_lstm_gpu_test<FLOAT16>(1, 7, 1, 3, 3, 2, true, true, true, 0.3f, 0, true);
}
TEST(lstm_gpu, generic_lstm_input_forget_f16_cached) {
TEST(DISABLED_lstm_gpu, generic_lstm_input_forget_f16_cached) {
generic_lstm_gpu_test<FLOAT16>(1, 7, 1, 3, 3, 2, true, true, true, 0.f, 1, true);
}
+2 -2
View File
@@ -139,11 +139,11 @@ void cnpy::parse_npy_header(FILE* fp, size_t& word_size, std::vector<size_t>& sh
throw std::runtime_error("parse_npy_header: failed to find header keyword: '(' or ')'");
std::regex num_regex("[0-9][0-9]*");
std::smatch sm;
std::cmatch sm;
shape.clear();
std::string str_shape = header.substr(loc1+1,loc2-loc1-1);
while(std::regex_search(str_shape, sm, num_regex)) {
while(std::regex_search(str_shape.c_str(), sm, num_regex)) {
shape.push_back(std::stoi(sm[0].str()));
str_shape = sm.suffix().str();
}