enable cmake compile warning as error for crosscompile (#23951)
### Details: - *enable CMAKE_COMPILER_WARNING_AS_ERROR for cross compile* ### Tickets: - *CVS-134950* --------- Co-authored-by: Pawel Raasz <pawel.raasz@intel.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
This commit is contained in:
parent
70a9738562
commit
ff826fdcda
|
|
@ -18,7 +18,7 @@ else()
|
|||
ov_option(USE_BUILD_TYPE_SUBFOLDER "Create dedicated sub-folder per build type for output binaries" ON)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{CI_BUILD_NUMBER} AND NOT CMAKE_CROSSCOMPILING)
|
||||
if(DEFINED ENV{CI_BUILD_NUMBER} AND NOT (CMAKE_CROSSCOMPILING AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.4))
|
||||
set(CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT ON)
|
||||
else()
|
||||
set(CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT OFF)
|
||||
|
|
|
|||
|
|
@ -1245,14 +1245,18 @@ void GraphOptimizer::FuseConvolutionAndDWConvolution(Graph &graph) {
|
|||
const auto &paddings = conv->getPaddingL();
|
||||
const auto &inDims = node->getInputShapeAtPort(0).getDims();
|
||||
const auto &outDims = node->getOutputShapeAtPort(0).getDims();
|
||||
bool isSupportedParams = conv->getGroupNum() == 1 &&
|
||||
inDims.size() == 4 &&
|
||||
dimsEqualStrong(inDims[inDims.size() - 1], outDims[outDims.size() - 1]) &&
|
||||
dimsEqualStrong(inDims[inDims.size() - 2], outDims[outDims.size() - 2]) &&
|
||||
is1x1Convolution(conv) && // TODO [oneDNN] : fusing is permitted only with 1x1 convolutions
|
||||
everyone_is(1u, strides[strides.size() - 1], strides[strides.size() - 2]) &&
|
||||
everyone_is(0u, paddings[paddings.size() - 1], paddings[paddings.size() - 2]) &&
|
||||
!conv->canBeExecutedInInt8();
|
||||
bool isSupportedParams =
|
||||
conv->getGroupNum() == 1 && inDims.size() == 4 &&
|
||||
dimsEqualStrong(inDims[inDims.size() - 1], outDims[outDims.size() - 1]) &&
|
||||
dimsEqualStrong(inDims[inDims.size() - 2], outDims[outDims.size() - 2]) &&
|
||||
is1x1Convolution(conv) && // TODO [oneDNN] : fusing is permitted only with 1x1 convolutions
|
||||
everyone_is(1u,
|
||||
static_cast<unsigned int>(strides[strides.size() - 1]),
|
||||
static_cast<unsigned int>(strides[strides.size() - 2])) &&
|
||||
everyone_is(0u,
|
||||
static_cast<unsigned int>(paddings[paddings.size() - 1]),
|
||||
static_cast<unsigned int>(paddings[paddings.size() - 2])) &&
|
||||
!conv->canBeExecutedInInt8();
|
||||
if (!isSupportedParams) return false;
|
||||
|
||||
return node->getChildEdges().size() == 1 && isConvolutionNode(node->getChildEdgeAt(0)->getChild());
|
||||
|
|
@ -1295,16 +1299,24 @@ void GraphOptimizer::FuseConvolutionAndDWConvolution(Graph &graph) {
|
|||
|
||||
const auto weightRank = convChild->getWeightDims().size();
|
||||
const auto stridesSize = convChild->getStride().size();
|
||||
bool isSupportedParams = dimsEqualStrong(convChild->outputShapes[0].getDims()[1], convChild->getGroupNum()) &&
|
||||
convChild->outputShapes[0].getDims()[1] != 1 &&
|
||||
everyone_is(3u, convChild->getWeightDims()[weightRank - 1], convChild->getWeightDims()[weightRank - 2]) &&
|
||||
everyone_is(1u, convChild->getPaddingL()[stridesSize - 1], convChild->getPaddingL()[stridesSize - 2]) &&
|
||||
everyone_is(1u, convChild->getPaddingR()[stridesSize - 1], convChild->getPaddingR()[stridesSize - 2]) &&
|
||||
everyone_is(1u, convChild->getDilation()[stridesSize - 1] + 1, convChild->getDilation()[stridesSize - 2] + 1) &&
|
||||
convChild->getStride()[stridesSize - 1] == convChild->getStride()[stridesSize - 2] &&
|
||||
withBias &&
|
||||
one_of(convChild->getStride()[stridesSize - 1], 1u, 2u) &&
|
||||
childNode->getOutputShapeAtPort(0).getRank() == 4;
|
||||
bool isSupportedParams =
|
||||
dimsEqualStrong(convChild->outputShapes[0].getDims()[1], convChild->getGroupNum()) &&
|
||||
convChild->outputShapes[0].getDims()[1] != 1 &&
|
||||
everyone_is(3u,
|
||||
static_cast<unsigned int>(convChild->getWeightDims()[weightRank - 1]),
|
||||
static_cast<unsigned int>(convChild->getWeightDims()[weightRank - 2])) &&
|
||||
everyone_is(1u,
|
||||
static_cast<unsigned int>(convChild->getPaddingL()[stridesSize - 1]),
|
||||
static_cast<unsigned int>(convChild->getPaddingL()[stridesSize - 2])) &&
|
||||
everyone_is(1u,
|
||||
static_cast<unsigned int>(convChild->getPaddingR()[stridesSize - 1]),
|
||||
static_cast<unsigned int>(convChild->getPaddingR()[stridesSize - 2])) &&
|
||||
everyone_is(1u,
|
||||
static_cast<unsigned int>(convChild->getDilation()[stridesSize - 1] + 1),
|
||||
static_cast<unsigned int>(convChild->getDilation()[stridesSize - 2] + 1)) &&
|
||||
convChild->getStride()[stridesSize - 1] == convChild->getStride()[stridesSize - 2] && withBias &&
|
||||
one_of(convChild->getStride()[stridesSize - 1], 1u, 2u) &&
|
||||
childNode->getOutputShapeAtPort(0).getRank() == 4;
|
||||
|
||||
return isSupportedParams;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -106,6 +106,13 @@ function(ov_add_onednn)
|
|||
ov_add_compiler_flags(/wd4334)
|
||||
endif()
|
||||
|
||||
# remove CMAKE_COMPILE_WARNING_AS_ERROR for thirdparty
|
||||
if(CMAKE_CROSSCOMPILING AND CMAKE_COMPILE_WARNING_AS_ERROR)
|
||||
string(REPLACE " -Werror " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE " -Werror " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_COMPILE_WARNING_AS_ERROR "OFF")
|
||||
endif()
|
||||
|
||||
if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
# xbyak compilation fails
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
|
|
|
|||
|
|
@ -46,7 +46,11 @@ public:
|
|||
bool is_model_large_to_store_const(const std::shared_ptr<ov::Model>& model) {
|
||||
auto model_bytesize = model->get_graph_size();
|
||||
size_t gb_8 = 1;
|
||||
#ifdef OPENVINO_ARCH_64_BIT
|
||||
gb_8 <<= 33;
|
||||
#else
|
||||
gb_8 = 0xFFFFFFFFU;
|
||||
#endif
|
||||
if (mem_size <= model_bytesize * 4 || model_bytesize >= gb_8) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue