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
36918b3b
Commit
36918b3b
authored
May 29, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8814 from woodychow:openmp_num_threads
parents
35de1c9f
6e00c765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
parallel.cpp
modules/core/src/parallel.cpp
+6
-6
No files found.
modules/core/src/parallel.cpp
View file @
36918b3b
...
...
@@ -349,7 +349,7 @@ void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body,
#elif defined HAVE_OPENMP
#pragma omp parallel for schedule(dynamic)
#pragma omp parallel for schedule(dynamic)
num_threads(numThreads > 0 ? numThreads : numThreadsMax)
for
(
int
i
=
stripeRange
.
start
;
i
<
stripeRange
.
end
;
++
i
)
pbody
(
Range
(
i
,
i
+
1
));
...
...
@@ -418,7 +418,10 @@ int cv::getNumThreads(void)
#elif defined HAVE_OPENMP
return
omp_get_max_threads
();
return
numThreads
>
0
?
numThreads
:
numThreadsMax
;
#elif defined HAVE_GCD
...
...
@@ -463,10 +466,7 @@ void cv::setNumThreads( int threads )
#elif defined HAVE_OPENMP
if
(
omp_in_parallel
())
return
;
// can't change number of openmp threads inside a parallel region
omp_set_num_threads
(
threads
>
0
?
threads
:
numThreadsMax
);
return
;
// nothing needed as num_threads clause is used in #pragma omp parallel for
#elif defined HAVE_GCD
...
...
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