Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d8b42792
Commit
d8b42792
authored
May 30, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: update ENABLE_FAST_MATH option
parent
8ea2f59d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
CMakeLists.txt
CMakeLists.txt
+1
-1
OpenCVCompilerOptimizations.cmake
cmake/OpenCVCompilerOptimizations.cmake
+0
-4
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+19
-8
No files found.
CMakeLists.txt
View file @
d8b42792
...
...
@@ -473,7 +473,7 @@ OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov"
OCV_OPTION
(
OPENCV_ENABLE_MEMORY_SANITIZER
"Better support for memory/address sanitizers"
OFF
)
OCV_OPTION
(
ENABLE_OMIT_FRAME_POINTER
"Enable -fomit-frame-pointer for GCC"
ON IF CV_GCC
)
OCV_OPTION
(
ENABLE_POWERPC
"Enable PowerPC for GCC"
ON
IF
(
CV_GCC AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*
)
)
OCV_OPTION
(
ENABLE_FAST_MATH
"Enable
-ffast-math (not recommended for GCC 4.6.x)"
OFF
IF
(
CV_GCC
AND
(
X86 OR X86_64
))
)
OCV_OPTION
(
ENABLE_FAST_MATH
"Enable
compiler options for fast math optimizations on FP computations (not recommended)"
OFF
)
if
(
NOT IOS
)
# Use CPU_BASELINE instead
OCV_OPTION
(
ENABLE_NEON
"Enable NEON instructions"
(
NEON OR ANDROID_ARM_NEON OR AARCH64
)
IF
(
CV_GCC OR CV_CLANG
)
AND
(
ARM OR AARCH64 OR IOS
)
)
OCV_OPTION
(
ENABLE_VFPV3
"Enable VFPv3-D32 instructions"
OFF
IF
(
CV_GCC OR CV_CLANG
)
AND
(
ARM OR AARCH64 OR IOS
)
)
...
...
cmake/OpenCVCompilerOptimizations.cmake
View file @
d8b42792
...
...
@@ -635,10 +635,6 @@ macro(ocv_compiler_optimization_options_finalize)
if
(
MSVC
)
# Generate Intrinsic Functions
set
(
OPENCV_EXTRA_FLAGS
"
${
OPENCV_EXTRA_FLAGS
}
/Oi"
)
if
((
X86 OR X86_64
)
AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND
";
${
CPU_BASELINE_FINAL
}
;"
MATCHES
";SSE;"
)
set
(
OPENCV_EXTRA_FLAGS
"
${
OPENCV_EXTRA_FLAGS
}
/fp:fast"
)
# !! important - be on the same wave with x64 compilers
endif
()
endif
(
MSVC
)
endmacro
()
...
...
cmake/OpenCVCompilerOptions.cmake
View file @
d8b42792
...
...
@@ -75,11 +75,25 @@ if(NOT MSVC)
add_extra_compiler_option
(
-fsigned-char
)
endif
()
if
(
CV_ICC AND NOT ENABLE_FAST_MATH
)
if
(
MSVC
)
add_extra_compiler_option
(
"/fp:precise"
)
else
()
add_extra_compiler_option
(
"-fp-model precise"
)
if
(
MSVC
)
if
(
NOT
"
${
CMAKE_CXX_FLAGS
}
${
OPENCV_EXTRA_FLAGS
}
${
OPENCV_EXTRA_CXX_FLAGS
}
"
MATCHES
" /fp:"
)
if
(
ENABLE_FAST_MATH
)
add_extra_compiler_option
(
"/fp:fast"
)
else
()
add_extra_compiler_option
(
"/fp:precise"
)
endif
()
endif
()
elseif
(
CV_ICC
)
if
(
NOT
"
${
CMAKE_CXX_FLAGS
}
${
OPENCV_EXTRA_FLAGS
}
${
OPENCV_EXTRA_CXX_FLAGS
}
"
MATCHES
" /fp:"
AND NOT
"
${
CMAKE_CXX_FLAGS
}
${
OPENCV_EXTRA_FLAGS
}
${
OPENCV_EXTRA_CXX_FLAGS
}
"
MATCHES
" -fp-model"
)
if
(
NOT ENABLE_FAST_MATH
)
add_extra_compiler_option
(
"-fp-model precise"
)
endif
()
endif
()
elseif
(
CV_GCC OR CV_CLANG
)
if
(
ENABLE_FAST_MATH
)
add_extra_compiler_option
(
-ffast-math
)
endif
()
endif
()
...
...
@@ -165,9 +179,6 @@ if(CV_GCC OR CV_CLANG)
elseif
(
DEFINED ENABLE_OMIT_FRAME_POINTER
)
add_extra_compiler_option
(
-fno-omit-frame-pointer
)
endif
()
if
(
ENABLE_FAST_MATH
)
add_extra_compiler_option
(
-ffast-math
)
endif
()
# Profiling?
if
(
ENABLE_PROFILING
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment