提交 b1d484f8 编写于 作者: A Alexander Alekhin

core(parallel): propagate FP denormals mode

上级 12351916
...@@ -142,6 +142,9 @@ ...@@ -142,6 +142,9 @@
#include "opencv2/core/detail/exception_ptr.hpp" // CV__EXCEPTION_PTR = 1 if std::exception_ptr is available #include "opencv2/core/detail/exception_ptr.hpp" // CV__EXCEPTION_PTR = 1 if std::exception_ptr is available
#include <opencv2/core/utils/fp_control_utils.hpp>
#include <opencv2/core/utils/fp_control.private.hpp>
using namespace cv; using namespace cv;
namespace cv { namespace cv {
...@@ -191,6 +194,9 @@ namespace { ...@@ -191,6 +194,9 @@ namespace {
// propagate main thread state // propagate main thread state
rng = cv::theRNG(); rng = cv::theRNG();
#if OPENCV_SUPPORTS_FP_DENORMALS_HINT && OPENCV_IMPL_FP_HINTS
details::saveFPDenormalsState(fp_denormals_base_state);
#endif
#ifdef OPENCV_TRACE #ifdef OPENCV_TRACE
traceRootRegion = CV_TRACE_NS::details::getCurrentRegion(); traceRootRegion = CV_TRACE_NS::details::getCurrentRegion();
...@@ -271,6 +277,11 @@ namespace { ...@@ -271,6 +277,11 @@ namespace {
} }
} }
} }
#if OPENCV_SUPPORTS_FP_DENORMALS_HINT && OPENCV_IMPL_FP_HINTS
details::FPDenormalsModeState fp_denormals_base_state;
#endif
private: private:
ParallelLoopBodyWrapperContext(const ParallelLoopBodyWrapperContext&); // disabled ParallelLoopBodyWrapperContext(const ParallelLoopBodyWrapperContext&); // disabled
ParallelLoopBodyWrapperContext& operator=(const ParallelLoopBodyWrapperContext&); // disabled ParallelLoopBodyWrapperContext& operator=(const ParallelLoopBodyWrapperContext&); // disabled
...@@ -307,6 +318,9 @@ namespace { ...@@ -307,6 +318,9 @@ namespace {
// propagate main thread state // propagate main thread state
cv::theRNG() = ctx.rng; cv::theRNG() = ctx.rng;
#if OPENCV_SUPPORTS_FP_DENORMALS_HINT && OPENCV_IMPL_FP_HINTS
FPDenormalsIgnoreHintScope fp_denormals_scope(ctx.fp_denormals_base_state);
#endif
cv::Range r; cv::Range r;
cv::Range wholeRange = ctx.wholeRange; cv::Range wholeRange = ctx.wholeRange;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册