Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Oct 30, 2021
2 parents b65ae3b + bce76a7 commit 7b57df0
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 37 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ ocv_cmake_hook(CMAKE_INIT)

# must go before the project()/enable_language() commands
ocv_update(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(NOT DEFINED CMAKE_BUILD_TYPE
AND NOT OPENCV_SKIP_DEFAULT_BUILD_TYPE
)
message(STATUS "'Release' build type is used by default. Use CMAKE_BUILD_TYPE to specify build type (Release or Debug)")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build")
endif()
if(DEFINED CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${CMAKE_CONFIGURATION_TYPES}")
endif()
Expand Down Expand Up @@ -610,10 +616,6 @@ endif()
# ----------------------------------------------------------------------------
# OpenCV compiler and linker options
# ----------------------------------------------------------------------------
# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release)
endif()

ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS)

Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVCompilerOptimizations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ if(X86 OR X86_64)
ocv_intel_compiler_optimization_option(FP16 "-mavx" "/arch:AVX")
ocv_intel_compiler_optimization_option(AVX "-mavx" "/arch:AVX")
ocv_intel_compiler_optimization_option(FMA3 "" "")
ocv_intel_compiler_optimization_option(POPCNT "" "")
ocv_intel_compiler_optimization_option(POPCNT "-mpopcnt" "") # -mpopcnt is available since ICC 19.0.0
ocv_intel_compiler_optimization_option(SSE4_2 "-msse4.2" "/arch:SSE4.2")
ocv_intel_compiler_optimization_option(SSE4_1 "-msse4.1" "/arch:SSE4.1")
ocv_intel_compiler_optimization_option(SSE3 "-msse3" "/arch:SSE3")
Expand Down
2 changes: 2 additions & 0 deletions modules/core/include/opencv2/core/cvdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
# elif __cplusplus >= 201703L
// available when compiler is C++17 compliant
# define CV_NODISCARD_STD [[nodiscard]]
# elif defined(__INTEL_COMPILER)
// see above, available when C++17 is enabled
# elif defined(_MSC_VER) && _MSC_VER >= 1911 && _MSVC_LANG >= 201703L
// available with VS2017 v15.3+ with /std:c++17 or higher; works on functions and classes
# define CV_NODISCARD_STD [[nodiscard]]
Expand Down
4 changes: 2 additions & 2 deletions modules/core/include/opencv2/core/hal/intrin_sse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ struct v_uint64x2
explicit v_uint64x2(__m128i v) : val(v) {}
v_uint64x2(uint64 v0, uint64 v1)
{
#if defined(_MSC_VER) && _MSC_VER >= 1920/*MSVS 2019*/ && defined(_M_X64)
#if defined(_MSC_VER) && _MSC_VER >= 1920/*MSVS 2019*/ && defined(_M_X64) && !defined(__clang__)
val = _mm_setr_epi64x((int64_t)v0, (int64_t)v1);
#elif defined(__GNUC__)
val = _mm_setr_epi64((__m64)v0, (__m64)v1);
Expand Down Expand Up @@ -278,7 +278,7 @@ struct v_int64x2
explicit v_int64x2(__m128i v) : val(v) {}
v_int64x2(int64 v0, int64 v1)
{
#if defined(_MSC_VER) && _MSC_VER >= 1920/*MSVS 2019*/ && defined(_M_X64)
#if defined(_MSC_VER) && _MSC_VER >= 1920/*MSVS 2019*/ && defined(_M_X64) && !defined(__clang__)
val = _mm_setr_epi64x((int64_t)v0, (int64_t)v1);
#elif defined(__GNUC__)
val = _mm_setr_epi64((__m64)v0, (__m64)v1);
Expand Down
25 changes: 15 additions & 10 deletions modules/core/src/hal_replacement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@

#include "opencv2/core/hal/interface.h"

#if defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
#elif defined _MSC_VER
# pragma warning( push )
# pragma warning( disable: 4100 )
#if defined(__clang__) // clang or MSVC clang
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4100)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif

//! @addtogroup core_hal_interface
Expand Down Expand Up @@ -731,10 +734,12 @@ inline int hal_ni_minMaxIdx(const uchar* src_data, size_t src_step, int width, i
//! @}


#if defined __GNUC__
# pragma GCC diagnostic pop
#elif defined _MSC_VER
# pragma warning( pop )
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include "hal_internal.hpp"
Expand Down
25 changes: 15 additions & 10 deletions modules/features2d/src/hal_replacement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@

#include "opencv2/core/hal/interface.h"

#if defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
#elif defined _MSC_VER
# pragma warning( push )
# pragma warning( disable: 4100 )
#if defined(__clang__) // clang or MSVC clang
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4100)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif

//! @addtogroup features2d_hal_interface
Expand Down Expand Up @@ -103,10 +106,12 @@ inline int hal_ni_FAST(const uchar* src_data, size_t src_step, int width, int he
//! @}


#if defined __GNUC__
# pragma GCC diagnostic pop
#elif defined _MSC_VER
# pragma warning( pop )
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include "custom_hal.hpp"
Expand Down
25 changes: 15 additions & 10 deletions modules/imgproc/src/hal_replacement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@
#include "opencv2/core/hal/interface.h"
#include "opencv2/imgproc/hal/interface.h"

#if defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
#elif defined _MSC_VER
# pragma warning( push )
# pragma warning( disable: 4100 )
#if defined(__clang__) // clang or MSVC clang
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4100)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif

//! @addtogroup imgproc_hal_interface
Expand Down Expand Up @@ -809,10 +812,12 @@ inline int hal_ni_canny(const uchar* src_data, size_t src_step, uchar* dst_data,

//! @}

#if defined __GNUC__
# pragma GCC diagnostic pop
#elif defined _MSC_VER
# pragma warning( pop )
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

#include "custom_hal.hpp"
Expand Down

0 comments on commit 7b57df0

Please sign in to comment.