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
41af58d1
Commit
41af58d1
authored
Jun 01, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4076 from kalistratovag:parallel_pthreads
parents
b866e267
bf5393ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
0 deletions
+36
-0
CMakeLists.txt
CMakeLists.txt
+2
-0
OpenCVFindLibsPerf.cmake
cmake/OpenCVFindLibsPerf.cmake
+10
-0
parallel.cpp
modules/core/src/parallel.cpp
+18
-0
parallel_pthreads.cpp
modules/core/src/parallel_pthreads.cpp
+0
-0
precomp.hpp
modules/core/src/precomp.hpp
+6
-0
No files found.
CMakeLists.txt
View file @
41af58d1
...
...
@@ -188,6 +188,7 @@ OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF
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"
OFF
IF
(
NOT WIN32
)
)
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
)
)
OCV_OPTION
(
WITH_V4L
"Include Video 4 Linux support"
ON
IF
(
UNIX AND NOT ANDROID
)
)
...
...
@@ -1067,6 +1068,7 @@ status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO)
status
(
" Use GCD"
HAVE_GCD THEN YES ELSE NO
)
status
(
" Use Concurrency"
HAVE_CONCURRENCY THEN YES ELSE NO
)
status
(
" Use C=:"
HAVE_CSTRIPES THEN YES ELSE NO
)
status
(
" Use pthreads for parallel for:"
HAVE_PTHREADS_PF THEN YES ELSE NO
)
status
(
" Use Cuda:"
HAVE_CUDA THEN
"YES (ver
${
CUDA_VERSION_STRING
}
)"
ELSE NO
)
status
(
" Use OpenCL:"
HAVE_OPENCL THEN YES ELSE NO
)
...
...
cmake/OpenCVFindLibsPerf.cmake
View file @
41af58d1
...
...
@@ -119,3 +119,13 @@ if(WITH_OPENMP)
endif
()
set
(
HAVE_OPENMP
"
${
OPENMP_FOUND
}
"
)
endif
()
if
(
UNIX OR ANDROID
)
if
(
NOT APPLE AND NOT HAVE_TBB AND NOT HAVE_OPENMP
)
set
(
HAVE_PTHREADS_PF 1
)
else
()
set
(
HAVE_PTHREADS_PF 0
)
endif
()
else
()
set
(
HAVE_PTHREADS_PF 0
)
endif
()
modules/core/src/parallel.cpp
View file @
41af58d1
...
...
@@ -125,6 +125,8 @@
# define CV_PARALLEL_FRAMEWORK "winrt-concurrency"
#elif defined HAVE_CONCURRENCY
# define CV_PARALLEL_FRAMEWORK "ms-concurrency"
#elif defined HAVE_PTHREADS
# define CV_PARALLEL_FRAMEWORK "pthreads"
#endif
namespace
cv
...
...
@@ -298,6 +300,10 @@ void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body,
Concurrency
::
CurrentScheduler
::
Detach
();
}
#elif defined HAVE_PTHREADS
void
parallel_for_pthreads
(
const
Range
&
range
,
const
ParallelLoopBody
&
body
,
double
nstripes
);
parallel_for_pthreads
(
range
,
body
,
nstripes
);
#else
#error You have hacked and compiling with unsupported parallel framework
...
...
@@ -353,6 +359,12 @@ int cv::getNumThreads(void)
?
Concurrency
::
CurrentScheduler
::
Get
()
->
GetNumberOfVirtualProcessors
()
:
pplScheduler
->
GetNumberOfVirtualProcessors
());
#elif defined HAVE_PTHREADS
size_t
parallel_pthreads_get_threads_num
();
return
parallel_pthreads_get_threads_num
();
#else
return
1
;
...
...
@@ -410,6 +422,12 @@ void cv::setNumThreads( int threads )
Concurrency
::
MaxConcurrency
,
threads
-
1
));
}
#elif defined HAVE_PTHREADS
void
parallel_pthreads_set_threads_num
(
int
num
);
parallel_pthreads_set_threads_num
(
threads
);
#endif
}
...
...
modules/core/src/parallel_pthreads.cpp
0 → 100644
View file @
41af58d1
This diff is collapsed.
Click to expand it.
modules/core/src/precomp.hpp
View file @
41af58d1
...
...
@@ -292,6 +292,12 @@ TLSData<CoreTLSData>& getCoreTlsData();
#define CL_RUNTIME_EXPORT
#endif
#ifndef HAVE_PTHREADS
#if !(defined WIN32 || defined _WIN32 || defined WINCE || defined HAVE_WINRT)
#define HAVE_PTHREADS 1
#endif
#endif
extern
bool
__termination
;
// skip some cleanups, because process is terminating
// (for example, if ExitProcess() was already called)
...
...
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