From 9f1218b00b027e9fb8cef42112fd6966987a2139 Mon Sep 17 00:00:00 2001 From: Jakub Golinowski Date: Fri, 31 Aug 2018 15:23:26 +0200 Subject: [PATCH] Merge pull request #11897 from Jakub-Golinowski:hpx_backend * Add HPX backend for OpenCV implementation Adds hpx backend for cv::parallel_for_() calls respecting the nstripes chunking parameter. C++ code for the backend is added to modules/core/parallel.cpp. Also, the necessary changes to cmake files are introduced. Backend can operate in 2 versions (selectable by cmake build option WITH_HPX_STARTSTOP): hpx (runtime always on) and hpx_startstop (start and stop the backend for each cv::parallel_for_() call) * WIP: Conditionally include hpx_main.hpp to tests in core module Header hpx_main.hpp is included to both core/perf/perf_main.cpp and core/test/test_main.cpp. The changes to cmake files for linking hpx library to above mentioned test executalbles are proposed but have issues. * Add coditional iclusion of hpx_main.hpp to cpp cpu modules * Remove start/stop version of hpx backend --- CMakeLists.txt | 2 ++ cmake/OpenCVFindLibsPerf.cmake | 7 ++++ cmake/OpenCVModule.cmake | 10 ++++++ cmake/templates/cvconfig.h.in | 3 ++ modules/calib3d/perf/perf_main.cpp | 4 +++ modules/calib3d/test/test_main.cpp | 4 +++ modules/core/CMakeLists.txt | 4 +++ modules/core/perf/perf_main.cpp | 4 +++ modules/core/src/parallel.cpp | 46 +++++++++++++++++++++++++++ modules/core/test/test_main.cpp | 4 +++ modules/dnn/perf/perf_main.cpp | 4 +++ modules/dnn/test/test_main.cpp | 4 +++ modules/features2d/perf/perf_main.cpp | 4 +++ modules/features2d/test/test_main.cpp | 4 +++ modules/flann/test/test_main.cpp | 4 +++ modules/highgui/test/test_main.cpp | 4 +++ modules/imgcodecs/perf/perf_main.cpp | 4 +++ modules/imgcodecs/test/test_main.cpp | 4 +++ modules/imgproc/perf/perf_main.cpp | 4 +++ modules/imgproc/test/test_main.cpp | 4 +++ modules/ml/test/test_main.cpp | 4 +++ modules/objdetect/perf/perf_main.cpp | 4 +++ modules/objdetect/test/test_main.cpp | 4 +++ modules/photo/perf/perf_main.cpp | 4 +++ modules/photo/test/test_main.cpp | 4 +++ modules/shape/test/test_main.cpp | 4 +++ modules/stitching/perf/perf_main.cpp | 4 +++ modules/stitching/test/test_main.cpp | 4 +++ modules/superres/perf/perf_main.cpp | 4 +++ modules/superres/test/test_main.cpp | 4 +++ modules/video/perf/perf_main.cpp | 4 +++ modules/video/test/test_main.cpp | 4 +++ modules/videoio/perf/perf_main.cpp | 4 +++ modules/videoio/test/test_main.cpp | 4 +++ modules/videostab/test/test_main.cpp | 4 +++ 35 files changed, 188 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d01c06d720..190fbc091f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,7 @@ OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O" OFF IF APPLE ) OCV_OPTION(WITH_QTKIT "Use QTKit Video I/O backend" OFF IF APPLE ) OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS AND NOT WINRT) ) +OCV_OPTION(WITH_HPX "Include Ste||ar Group HPX support" OFF) OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF) OCV_OPTION(WITH_PTHREADS_PF "Use pthreads-based parallel_for" ON IF (NOT WIN32 OR MINGW) ) OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) ) @@ -1353,6 +1354,7 @@ endif() # Order is similar to CV_PARALLEL_FRAMEWORK in core/src/parallel.cpp ocv_build_features_string(parallel_status EXCLUSIVE IF HAVE_TBB THEN "TBB (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" + IF HAVE_HPX THEN "HPX" IF HAVE_OPENMP THEN "OpenMP" IF HAVE_GCD THEN "GCD" IF WINRT OR HAVE_CONCURRENCY THEN "Concurrency" diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake index e3bd8384ab..651200dfec 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake @@ -7,6 +7,13 @@ if(WITH_TBB) include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectTBB.cmake") endif(WITH_TBB) +# --- HPX --- +if(WITH_HPX) + find_package(HPX REQUIRED) + ocv_include_directories(${HPX_INCLUDE_DIRS}) + set(HAVE_HPX TRUE) +endif(WITH_HPX) + # --- IPP --- if(WITH_IPP) include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake") diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 54f100d3cf..7c81b0c6f7 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -1135,6 +1135,11 @@ function(ocv_add_perf_tests) ocv_target_link_libraries(${the_target} LINK_PRIVATE ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS} ${OPENCV_PERF_${the_module}_DEPS}) add_dependencies(opencv_perf_tests ${the_target}) + if(HAVE_HPX) + message("Linking HPX to Perf test of module ${name}") + ocv_target_link_libraries(${the_target} LINK_PRIVATE "${HPX_LIBRARIES}") + endif() + set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};PerfTest") set_source_files_properties(${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};PerfTest") @@ -1220,6 +1225,11 @@ function(ocv_add_accuracy_tests) ocv_target_link_libraries(${the_target} LINK_PRIVATE ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS} ${OPENCV_TEST_${the_module}_DEPS}) add_dependencies(opencv_tests ${the_target}) + if(HAVE_HPX) + message("Linking HPX to Perf test of module ${name}") + ocv_target_link_libraries(${the_target} LINK_PRIVATE "${HPX_LIBRARIES}") + endif() + set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};AccuracyTest") set_source_files_properties(${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};AccuracyTest") diff --git a/cmake/templates/cvconfig.h.in b/cmake/templates/cvconfig.h.in index ad63e2279f..ce779934ce 100644 --- a/cmake/templates/cvconfig.h.in +++ b/cmake/templates/cvconfig.h.in @@ -174,6 +174,9 @@ /* Intel Threading Building Blocks */ #cmakedefine HAVE_TBB +/* Ste||ar Group High Performance ParallelX */ +#cmakedefine HAVE_HPX + /* TIFF codec */ #cmakedefine HAVE_TIFF diff --git a/modules/calib3d/perf/perf_main.cpp b/modules/calib3d/perf/perf_main.cpp index a8dddb81d9..54c334da13 100644 --- a/modules/calib3d/perf/perf_main.cpp +++ b/modules/calib3d/perf/perf_main.cpp @@ -1,3 +1,7 @@ #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(calib3d) diff --git a/modules/calib3d/test/test_main.cpp b/modules/calib3d/test/test_main.cpp index a6fc332d4a..faa8d0e2e2 100644 --- a/modules/calib3d/test/test_main.cpp +++ b/modules/calib3d/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("") diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index fa72e71658..73acbdd022 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -77,6 +77,10 @@ ocv_target_link_libraries(${the_module} LINK_PRIVATE "${OPENCV_HAL_LINKER_LIBS}" ) +if(HAVE_HPX) + ocv_target_link_libraries(${the_module} LINK_PRIVATE "${HPX_LIBRARIES}") +endif() + if(HAVE_CUDA) ocv_target_compile_definitions(${the_module} PUBLIC OPENCV_TRAITS_ENABLE_DEPRECATED) endif() diff --git a/modules/core/perf/perf_main.cpp b/modules/core/perf/perf_main.cpp index 7c899c2446..996dedfeb6 100644 --- a/modules/core/perf/perf_main.cpp +++ b/modules/core/perf/perf_main.cpp @@ -5,4 +5,8 @@ # endif #endif +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(core) diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 080df707c3..225e766aa3 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -79,6 +79,7 @@ /* IMPORTANT: always use the same order of defines - HAVE_TBB - 3rdparty library, should be explicitly enabled + - HAVE_HPX - 3rdparty library, should be explicitly enabled - HAVE_OPENMP - integrated to compiler, should be explicitly enabled - HAVE_GCD - system wide, used automatically (APPLE only) - WINRT - system wide, used automatically (Windows RT only) @@ -95,6 +96,16 @@ #endif #undef min #undef max +#elif defined HAVE_HPX + #include + #include + // + #include + #include + #include + #include + #include + #elif defined HAVE_OPENMP #include #elif defined HAVE_GCD @@ -109,6 +120,8 @@ #if defined HAVE_TBB # define CV_PARALLEL_FRAMEWORK "tbb" +#elif defined HAVE_HPX +# define CV_PARALLEL_FRAMEWORK "hpx" #elif defined HAVE_OPENMP # define CV_PARALLEL_FRAMEWORK "openmp" #elif defined HAVE_GCD @@ -377,6 +390,26 @@ namespace tbb::parallel_for(tbb::blocked_range(range.start, range.end), *this); } }; +#elif defined HAVE_HPX + class ProxyLoopBody : public ParallelLoopBodyWrapper + { + public: + ProxyLoopBody(ParallelLoopBodyWrapperContext& ctx_) + : ParallelLoopBodyWrapper(ctx_) + {} + + void operator ()() const // run parallel job + { + cv::Range stripeRange = this->stripeRange(); + hpx::parallel::for_loop( + hpx::parallel::execution::par, + stripeRange.start, stripeRange.end, + [&](const int &i) { ; + this->ParallelLoopBodyWrapper::operator()( + cv::Range(i, i + 1)); + }); + } + }; #elif defined HAVE_GCD typedef ParallelLoopBodyWrapper ProxyLoopBody; static void block_function(void* context, size_t index) @@ -409,6 +442,8 @@ static int numThreads = -1; #else static tbb::task_scheduler_init tbbScheduler(tbb::task_scheduler_init::deferred); #endif +#elif defined HAVE_HPX +// nothing for HPX #elif defined HAVE_OPENMP static int numThreadsMax = omp_get_max_threads(); #elif defined HAVE_GCD @@ -508,6 +543,9 @@ static void parallel_for_impl(const cv::Range& range, const cv::ParallelLoopBody pbody(); #endif +#elif defined HAVE_HPX + pbody(); + #elif defined HAVE_OPENMP #pragma omp parallel for schedule(dynamic) num_threads(numThreads > 0 ? numThreads : numThreadsMax) @@ -579,6 +617,9 @@ int cv::getNumThreads(void) : tbb::task_scheduler_init::default_num_threads(); #endif +#elif defined HAVE_HPX + return numThreads; + #elif defined HAVE_OPENMP return numThreads > 0 @@ -653,6 +694,9 @@ void cv::setNumThreads( int threads_ ) if(threads > 0) tbbScheduler.initialize(threads); #endif +#elif defined HAVE_HPX + return; // nothing needed as numThreads is used + #elif defined HAVE_OPENMP return; // nothing needed as num_threads clause is used in #pragma omp parallel for @@ -702,6 +746,8 @@ int cv::getThreadNum(void) #else return 0; #endif +#elif defined HAVE_HPX + return (int)(hpx::get_num_worker_threads()); #elif defined HAVE_OPENMP return omp_get_thread_num(); #elif defined HAVE_GCD diff --git a/modules/core/test/test_main.cpp b/modules/core/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/core/test/test_main.cpp +++ b/modules/core/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/dnn/perf/perf_main.cpp b/modules/dnn/perf/perf_main.cpp index d66f19c9dd..073921efaf 100644 --- a/modules/dnn/perf/perf_main.cpp +++ b/modules/dnn/perf/perf_main.cpp @@ -7,6 +7,10 @@ static const char* extraTestDataPath = getenv("OPENCV_DNN_TEST_DATA_PATH"); #endif +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(dnn, extraTestDataPath ? (void)cvtest::addDataSearchPath(extraTestDataPath) : (void)0 ) diff --git a/modules/dnn/test/test_main.cpp b/modules/dnn/test/test_main.cpp index 4842c15240..ce526d2e0f 100644 --- a/modules/dnn/test/test_main.cpp +++ b/modules/dnn/test/test_main.cpp @@ -7,6 +7,10 @@ static const char* extraTestDataPath = getenv("OPENCV_DNN_TEST_DATA_PATH"); #endif +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("", extraTestDataPath ? (void)cvtest::addDataSearchPath(extraTestDataPath) : (void)0 ) diff --git a/modules/features2d/perf/perf_main.cpp b/modules/features2d/perf/perf_main.cpp index 17a99fcc19..7119d25443 100644 --- a/modules/features2d/perf/perf_main.cpp +++ b/modules/features2d/perf/perf_main.cpp @@ -1,3 +1,7 @@ #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(features2d) diff --git a/modules/features2d/test/test_main.cpp b/modules/features2d/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/features2d/test/test_main.cpp +++ b/modules/features2d/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/flann/test/test_main.cpp b/modules/flann/test/test_main.cpp index 6b24993447..f377a339c4 100644 --- a/modules/flann/test/test_main.cpp +++ b/modules/flann/test/test_main.cpp @@ -1,3 +1,7 @@ #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/highgui/test/test_main.cpp b/modules/highgui/test/test_main.cpp index 4eb2abd8f8..d248327046 100644 --- a/modules/highgui/test/test_main.cpp +++ b/modules/highgui/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("highgui") diff --git a/modules/imgcodecs/perf/perf_main.cpp b/modules/imgcodecs/perf/perf_main.cpp index 421ae829e4..3455d44953 100644 --- a/modules/imgcodecs/perf/perf_main.cpp +++ b/modules/imgcodecs/perf/perf_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(imgcodecs) diff --git a/modules/imgcodecs/test/test_main.cpp b/modules/imgcodecs/test/test_main.cpp index dffac7e48f..77f7366dae 100644 --- a/modules/imgcodecs/test/test_main.cpp +++ b/modules/imgcodecs/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("highgui") diff --git a/modules/imgproc/perf/perf_main.cpp b/modules/imgproc/perf/perf_main.cpp index 807d8bab22..e4f1816cd6 100644 --- a/modules/imgproc/perf/perf_main.cpp +++ b/modules/imgproc/perf/perf_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(imgproc) diff --git a/modules/imgproc/test/test_main.cpp b/modules/imgproc/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/imgproc/test/test_main.cpp +++ b/modules/imgproc/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/ml/test/test_main.cpp b/modules/ml/test/test_main.cpp index a78a031c36..aab717ee51 100644 --- a/modules/ml/test/test_main.cpp +++ b/modules/ml/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("ml") diff --git a/modules/objdetect/perf/perf_main.cpp b/modules/objdetect/perf/perf_main.cpp index 69b8ecac5b..154b6cc2af 100644 --- a/modules/objdetect/perf/perf_main.cpp +++ b/modules/objdetect/perf/perf_main.cpp @@ -1,3 +1,7 @@ #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(objdetect) diff --git a/modules/objdetect/test/test_main.cpp b/modules/objdetect/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/objdetect/test/test_main.cpp +++ b/modules/objdetect/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/photo/perf/perf_main.cpp b/modules/photo/perf/perf_main.cpp index 9bbb8392a1..b579308a33 100644 --- a/modules/photo/perf/perf_main.cpp +++ b/modules/photo/perf/perf_main.cpp @@ -8,4 +8,8 @@ static const char * impls[] = { "plain" }; +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN_WITH_IMPLS(photo, impls, perf::printCudaInfo()) diff --git a/modules/photo/test/test_main.cpp b/modules/photo/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/photo/test/test_main.cpp +++ b/modules/photo/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/shape/test/test_main.cpp b/modules/shape/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/shape/test/test_main.cpp +++ b/modules/shape/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/stitching/perf/perf_main.cpp b/modules/stitching/perf/perf_main.cpp index 079785685e..4bc151554b 100644 --- a/modules/stitching/perf/perf_main.cpp +++ b/modules/stitching/perf/perf_main.cpp @@ -1,3 +1,7 @@ #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(stitching) diff --git a/modules/stitching/test/test_main.cpp b/modules/stitching/test/test_main.cpp index b10d0d7a39..f31f6570b3 100644 --- a/modules/stitching/test/test_main.cpp +++ b/modules/stitching/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN(".") diff --git a/modules/superres/perf/perf_main.cpp b/modules/superres/perf/perf_main.cpp index 0a8ab5deaa..af1ff2fdb9 100644 --- a/modules/superres/perf/perf_main.cpp +++ b/modules/superres/perf/perf_main.cpp @@ -51,4 +51,8 @@ static const char * impls[] = { "plain" }; +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN_WITH_IMPLS(superres, impls, printCudaInfo()) diff --git a/modules/superres/test/test_main.cpp b/modules/superres/test/test_main.cpp index b1998b9320..e9724d8096 100644 --- a/modules/superres/test/test_main.cpp +++ b/modules/superres/test/test_main.cpp @@ -42,4 +42,8 @@ #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("superres") diff --git a/modules/video/perf/perf_main.cpp b/modules/video/perf/perf_main.cpp index 2aeb908047..b6fd57a32d 100644 --- a/modules/video/perf/perf_main.cpp +++ b/modules/video/perf/perf_main.cpp @@ -1,3 +1,7 @@ #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(video) diff --git a/modules/video/test/test_main.cpp b/modules/video/test/test_main.cpp index 0e51ddfd05..93e4d2860e 100644 --- a/modules/video/test/test_main.cpp +++ b/modules/video/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv") diff --git a/modules/videoio/perf/perf_main.cpp b/modules/videoio/perf/perf_main.cpp index 70a7a47f99..433209a595 100644 --- a/modules/videoio/perf/perf_main.cpp +++ b/modules/videoio/perf/perf_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html #include "perf_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_PERF_TEST_MAIN(videoio) diff --git a/modules/videoio/test/test_main.cpp b/modules/videoio/test/test_main.cpp index 4eb2abd8f8..d248327046 100644 --- a/modules/videoio/test/test_main.cpp +++ b/modules/videoio/test/test_main.cpp @@ -3,4 +3,8 @@ // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("highgui") diff --git a/modules/videostab/test/test_main.cpp b/modules/videostab/test/test_main.cpp index bbe1431898..1eff681899 100644 --- a/modules/videostab/test/test_main.cpp +++ b/modules/videostab/test/test_main.cpp @@ -4,4 +4,8 @@ #include "test_precomp.hpp" +#if defined(HAVE_HPX) + #include +#endif + CV_TEST_MAIN("cv")