Skip to content

Commit

Permalink
next: drop WITH_CSTRIPES
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Apr 10, 2018
1 parent 5b17a60 commit 250941b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 64 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O" OFF
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_OPENMP "Include OpenMP support" OFF)
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF (WIN32 AND NOT WINRT) )
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) )
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
Expand Down Expand Up @@ -1331,7 +1330,6 @@ 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_CSTRIPES THEN "C="
IF HAVE_OPENMP THEN "OpenMP"
IF HAVE_GCD THEN "GCD"
IF WINRT OR HAVE_CONCURRENCY THEN "Concurrency"
Expand Down
11 changes: 0 additions & 11 deletions cmake/OpenCVDetectCStripes.cmake

This file was deleted.

11 changes: 2 additions & 9 deletions cmake/OpenCVFindLibsPerf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,15 @@ if(WITH_CLP)
endif()
endif(WITH_CLP)

# --- C= ---
if(WITH_CSTRIPES AND NOT HAVE_TBB)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake")
else()
set(HAVE_CSTRIPES 0)
endif()

# --- GCD ---
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
if(APPLE AND NOT HAVE_TBB)
set(HAVE_GCD 1)
else()
set(HAVE_GCD 0)
endif()

# --- Concurrency ---
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
if(MSVC AND NOT HAVE_TBB)
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
Expand Down
3 changes: 0 additions & 3 deletions cmake/templates/cvconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
/* Cocoa API */
#cmakedefine HAVE_COCOA

/* C= */
#cmakedefine HAVE_CSTRIPES

/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/
#cmakedefine HAVE_CUBLAS

Expand Down
45 changes: 6 additions & 39 deletions modules/core/src/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@
#endif

/* IMPORTANT: always use the same order of defines
1. HAVE_TBB - 3rdparty library, should be explicitly enabled
2. HAVE_CSTRIPES - 3rdparty library, should be explicitly enabled
3. HAVE_OPENMP - integrated to compiler, should be explicitly enabled
4. HAVE_GCD - system wide, used automatically (APPLE only)
5. WINRT - system wide, used automatically (Windows RT only)
6. HAVE_CONCURRENCY - part of runtime, used automatically (Windows only - MSVS 10, MSVS 11)
7. HAVE_PTHREADS_PF - pthreads if available
- HAVE_TBB - 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)
- HAVE_CONCURRENCY - part of runtime, used automatically (Windows only - MSVS 10, MSVS 11)
- HAVE_PTHREADS_PF - pthreads if available
*/

#if defined HAVE_TBB
Expand All @@ -96,9 +95,6 @@
#endif
#undef min
#undef max
#elif defined HAVE_CSTRIPES
#include "C=.h"
#undef shared
#elif defined HAVE_OPENMP
#include <omp.h>
#elif defined HAVE_GCD
Expand All @@ -113,8 +109,6 @@

#if defined HAVE_TBB
# 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
Expand Down Expand Up @@ -385,8 +379,6 @@ namespace
tbb::parallel_for(tbb::blocked_range<int>(range.start, range.end), *this);
}
};
#elif defined HAVE_CSTRIPES || defined HAVE_OPENMP
typedef ParallelLoopBodyWrapper ProxyLoopBody;
#elif defined HAVE_GCD
typedef ParallelLoopBodyWrapper ProxyLoopBody;
static void block_function(void* context, size_t index)
Expand Down Expand Up @@ -419,8 +411,6 @@ static int numThreads = -1;
#else
static tbb::task_scheduler_init tbbScheduler(tbb::task_scheduler_init::deferred);
#endif
#elif defined HAVE_CSTRIPES
// nothing for C=
#elif defined HAVE_OPENMP
static int numThreadsMax = omp_get_max_threads();
#elif defined HAVE_GCD
Expand Down Expand Up @@ -520,17 +510,6 @@ static void parallel_for_impl(const cv::Range& range, const cv::ParallelLoopBody
pbody();
#endif

#elif defined HAVE_CSTRIPES

parallel(MAX(0, numThreads))
{
int offset = stripeRange.start;
int len = stripeRange.end - offset;
Range r(offset + CPX_RANGE_START(len), offset + CPX_RANGE_END(len));
pbody(r);
barrier();
}

#elif defined HAVE_OPENMP

#pragma omp parallel for schedule(dynamic) num_threads(numThreads > 0 ? numThreads : numThreadsMax)
Expand Down Expand Up @@ -602,12 +581,6 @@ int cv::getNumThreads(void)
: tbb::task_scheduler_init::default_num_threads();
#endif

#elif defined HAVE_CSTRIPES

return numThreads > 0
? numThreads
: cv::getNumberOfCPUs();

#elif defined HAVE_OPENMP

return numThreads > 0
Expand Down Expand Up @@ -682,10 +655,6 @@ void cv::setNumThreads( int threads_ )
if(threads > 0) tbbScheduler.initialize(threads);
#endif

#elif defined HAVE_CSTRIPES

return; // nothing needed

#elif defined HAVE_OPENMP

return; // nothing needed as num_threads clause is used in #pragma omp parallel for
Expand Down Expand Up @@ -735,8 +704,6 @@ int cv::getThreadNum(void)
#else
return 0;
#endif
#elif defined HAVE_CSTRIPES
return pix();
#elif defined HAVE_OPENMP
return omp_get_thread_num();
#elif defined HAVE_GCD
Expand Down

0 comments on commit 250941b

Please sign in to comment.