#include <vector>
+#include "cvconfig.h"
+
#if defined WIN32 || defined _WIN32
# ifndef WIN32
# define WIN32
# include "opencv2/core/eigen.hpp"
#endif
+#ifdef _OPENMP
+# define HAVE_OPENMP
+#endif
+
+#ifdef __APPLE__
+# define HAVE_GCD
+#endif
+
+#if defined _MSC_VER && _MSC_VER >= 1600
+# define HAVE_CONCURRENCY
+#endif
+
+#if defined HAVE_TBB && TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
+# define CV_PARALLEL_FRAMEWORK "tbb"
+#elif defined HAVE_CSTRIPES
+# define CV_PARALLEL_FRAMEWORK "cstripes"
+#elif defined HAVE_OPENMP
+# define CV_PARALLEL_FRAMEWORK "openmp"
+#elif defined HAVE_GCD
+# define CV_PARALLEL_FRAMEWORK "gcd"
+#elif defined HAVE_CONCURRENCY
+# define CV_PARALLEL_FRAMEWORK "ms-concurrency"
+#endif
+
#ifdef __cplusplus
namespace cv
#endif
#endif
-#ifdef _OPENMP
- #define HAVE_OPENMP
-#endif
-
-#ifdef __APPLE__
- #define HAVE_GCD
-#endif
-
-#if defined _MSC_VER && _MSC_VER >= 1600
- #define HAVE_CONCURRENCY
-#endif
/* IMPORTANT: always use the same order of defines
1. HAVE_TBB - 3rdparty library, should be explicitly enabled
#endif
#endif
-#if defined HAVE_TBB || defined HAVE_CSTRIPES || defined HAVE_OPENMP || defined HAVE_GCD || defined HAVE_CONCURRENCY
- #define HAVE_PARALLEL_FRAMEWORK
-#endif
-
namespace cv
{
ParallelLoopBody::~ParallelLoopBody() {}
namespace
{
-#ifdef HAVE_PARALLEL_FRAMEWORK
+#ifdef CV_PARALLEL_FRAMEWORK
class ParallelLoopBodyWrapper
{
public:
static SchedPtr pplScheduler;
#endif
-#endif // HAVE_PARALLEL_FRAMEWORK
+#endif // CV_PARALLEL_FRAMEWORK
} //namespace
void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body, double nstripes)
{
-#ifdef HAVE_PARALLEL_FRAMEWORK
+#ifdef CV_PARALLEL_FRAMEWORK
if(numThreads != 0)
{
}
else
-#endif // HAVE_PARALLEL_FRAMEWORK
+#endif // CV_PARALLEL_FRAMEWORK
{
(void)nstripes;
body(range);
int cv::getNumThreads(void)
{
-#ifdef HAVE_PARALLEL_FRAMEWORK
+#ifdef CV_PARALLEL_FRAMEWORK
if(numThreads == 0)
return 1;
void cv::setNumThreads( int threads )
{
(void)threads;
-#ifdef HAVE_PARALLEL_FRAMEWORK
+#ifdef CV_PARALLEL_FRAMEWORK
numThreads = threads;
#endif
+#include "opencv2/core/core.hpp"
#include "opencv2/core/core_c.h"
+#include "opencv2/core/internal.hpp"
#include "opencv2/ts/ts.hpp"
#ifdef GTEST_LINKED_AS_SHARED_LIBRARY
::testing::Test::RecordProperty("inner_version", ver);
if(useStdOut) std::cout << ver << std::endl;
}
+
+#ifdef CV_PARALLEL_FRAMEWORK
+ ::testing::Test::RecordProperty("cv_parallel_framework", CV_PARALLEL_FRAMEWORK);
+ if (useStdOut)
+ {
+ std::cout << "Parallel framework: " << CV_PARALLEL_FRAMEWORK << std::endl;
+ }
+#endif
}
} //namespace cvtest