Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CERN ROOT
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rutherford Experiment Lab Course Online
CERN ROOT
Commits
2e68cc0e
Commit
2e68cc0e
authored
5 years ago
by
Xavier Valls Pla
Browse files
Options
Downloads
Patches
Plain Diff
fix indentation
parent
239ee50c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/imt/src/TThreadExecutor.cxx
+26
-25
26 additions, 25 deletions
core/imt/src/TThreadExecutor.cxx
with
26 additions
and
25 deletions
core/imt/src/TThreadExecutor.cxx
+
26
−
25
View file @
2e68cc0e
...
...
@@ -115,16 +115,13 @@ static T ParallelReduceHelper(const std::vector<T> &objs, const std::function<T(
BRange_t
objRange
(
objs
.
begin
(),
objs
.
end
());
return
tbb
::
this_task_arena
::
isolate
([
&
]{
return
tbb
::
this_task_arena
::
isolate
([
&
]
{
return
tbb
::
parallel_reduce
(
objRange
,
T
{},
pred
,
redfunc
);
});
}
}
// End NS Internal
}
// End NS ROOT
namespace
ROOT
{
//////////////////////////////////////////////////////////////////////////
/// Class constructor.
...
...
@@ -138,29 +135,33 @@ namespace ROOT {
TThreadExecutor
::
TThreadExecutor
(
UInt_t
nThreads
)
{
fTaskArenaW
=
ROOT
::
Internal
::
GetGlobalTaskArena
(
nThreads
);
}
void
TThreadExecutor
::
ParallelFor
(
unsigned
int
start
,
unsigned
int
end
,
unsigned
step
,
const
std
::
function
<
void
(
unsigned
int
i
)
>
&
f
)
{
fTaskArenaW
->
Access
().
execute
([
&
]{
tbb
::
this_task_arena
::
isolate
([
&
]{
tbb
::
parallel_for
(
start
,
end
,
step
,
f
);
});
});
}
}
double
TThreadExecutor
::
ParallelReduce
(
const
std
::
vector
<
double
>
&
objs
,
const
std
::
function
<
double
(
double
a
,
double
b
)
>
&
redfunc
)
{
return
fTaskArenaW
->
Access
().
execute
([
&
]
{
return
ROOT
::
Internal
::
ParallelReduceHelper
<
double
>
(
objs
,
redfunc
);
});
}
void
TThreadExecutor
::
ParallelFor
(
unsigned
int
start
,
unsigned
int
end
,
unsigned
step
,
const
std
::
function
<
void
(
unsigned
int
i
)
>
&
f
)
{
fTaskArenaW
->
Access
().
execute
([
&
]
{
tbb
::
this_task_arena
::
isolate
([
&
]
{
tbb
::
parallel_for
(
start
,
end
,
step
,
f
);
});
});
}
float
TThreadExecutor
::
ParallelReduce
(
const
std
::
vector
<
float
>
&
objs
,
const
std
::
function
<
float
(
float
a
,
float
b
)
>
&
redfunc
)
{
return
fTaskArenaW
->
Access
().
execute
([
&
]
{
return
ROOT
::
Internal
::
ParallelReduceHelper
<
float
>
(
objs
,
redfunc
);
});
}
double
TThreadExecutor
::
ParallelReduce
(
const
std
::
vector
<
double
>
&
objs
,
const
std
::
function
<
double
(
double
a
,
double
b
)
>
&
redfunc
)
{
return
fTaskArenaW
->
Access
().
execute
([
&
]
{
return
ROOT
::
Internal
::
ParallelReduceHelper
<
double
>
(
objs
,
redfunc
);
});
}
unsigned
TThreadExecutor
::
GetPoolSize
(){
return
fTaskArenaW
->
TaskArenaSize
();
}
float
TThreadExecutor
::
ParallelReduce
(
const
std
::
vector
<
float
>
&
objs
,
const
std
::
function
<
float
(
float
a
,
float
b
)
>
&
redfunc
)
{
return
fTaskArenaW
->
Access
().
execute
([
&
]
{
return
ROOT
::
Internal
::
ParallelReduceHelper
<
float
>
(
objs
,
redfunc
);
});
}
unsigned
TThreadExecutor
::
GetPoolSize
()
{
return
fTaskArenaW
->
TaskArenaSize
();
}
}
// namespace ROOT
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment