Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Computing
cbmroot
Commits
7aab8d24
Commit
7aab8d24
authored
1 year ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
alg::sts::Hitfinder: Use more efficient parallelization on CPU.
parent
6cbfa7cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1244
algo: Add protection against monster events in Sts Hitfinder.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algo/detectors/sts/StsHitfinder.cxx
+2
-2
2 additions, 2 deletions
algo/detectors/sts/StsHitfinder.cxx
algo/detectors/sts/StsHitfinderChain.cxx
+6
-1
6 additions, 1 deletion
algo/detectors/sts/StsHitfinderChain.cxx
with
8 additions
and
3 deletions
algo/detectors/sts/StsHitfinder.cxx
+
2
−
2
View file @
7aab8d24
...
...
@@ -496,7 +496,7 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const
// On GPU process all front clusters in parallel instead (one thread per cluster)
// to fully utilize the GPU.
// Currently use option 2 for both as it is faster on CPU as well.
#if
XPU_IS_CPU
#if
0
int iModule = ctx.block_idx_x();
#else
int
iModule
=
0
;
...
...
@@ -545,7 +545,7 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const
float
maxSigmaBoth
=
4.
f
*
xpu
::
sqrt
(
maxTerrF
*
maxTerrF
+
maxTerrB
*
maxTerrB
);
int
startB
=
0
;
#if
XPU_IS_CPU
#if
0
for (int iClusterF = ctx.thread_idx_x(); iClusterF < nClustersF; iClusterF += ctx.block_dim_x()) {
#else
int
iClusterF
=
iThread
;
...
...
This diff is collapsed.
Click to expand it.
algo/detectors/sts/StsHitfinderChain.cxx
+
6
−
1
View file @
7aab8d24
...
...
@@ -134,7 +134,12 @@ void sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi> digis)
queue
.
wait
();
xpu
::
h_view
nClusters
{
hfc
.
nClustersPerModule
};
size_t
nClustersFront
=
std
::
accumulate
(
nClusters
.
begin
(),
nClusters
.
begin
()
+
nModules
,
0
);
bool
isCpu
=
xpu
::
device
::
active
().
backend
()
==
xpu
::
cpu
;
// FindHits supports to modes of parallelization: One thread per cluster or one block per module
// Currently we use method one for CPU and GPU.
// See sts::Hitfinder::FindHits() for details.
// bool isCpu = xpu::device::active().backend() == xpu::cpu;
bool
isCpu
=
false
;
xpu
::
grid
findHitsG
=
isCpu
?
xpu
::
n_blocks
(
nModules
)
:
xpu
::
n_threads
(
nClustersFront
);
queue
.
launch
<
FindHits
>
(
findHitsG
);
...
...
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