Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LHCb
LHCb
Commits
4945e596
Commit
4945e596
authored
1 year ago
by
Christopher Rob Jones
Browse files
Options
Downloads
Patches
Plain Diff
RichMirrorFinder: Add some asserts to validate indices are always in range.
parent
1fbc3550
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!4386
Merge master into FTRetinaSeedRawBanks
,
!4324
RichMirrorFinder: Add some asserts to validate indices are always in range.
Pipeline
#6345454
passed
1 year ago
Stage: test
Stage: .post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h
+9
-1
9 additions, 1 deletion
...ichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h
with
9 additions
and
1 deletion
Rich/RichFutureUtils/include/RichFutureUtils/RichMirrorFinder.h
+
9
−
1
View file @
4945e596
...
@@ -267,18 +267,25 @@ namespace Rich::Utils {
...
@@ -267,18 +267,25 @@ namespace Rich::Utils {
/// Combine two (scalar) x,y indices in a single one
/// Combine two (scalar) x,y indices in a single one
[[
nodiscard
]]
ScalarIndex
xyIndex
(
const
ScalarIndex
ix
,
//
[[
nodiscard
]]
ScalarIndex
xyIndex
(
const
ScalarIndex
ix
,
//
const
ScalarIndex
iy
)
const
noexcept
{
const
ScalarIndex
iy
)
const
noexcept
{
assert
(
ix
<
NXBINS
);
assert
(
iy
<
NYBINS
);
return
(
NYBINS
*
ix
)
+
iy
;
return
(
NYBINS
*
ix
)
+
iy
;
}
}
/// Combine two (SIMD) x,y indices in a single one
/// Combine two (SIMD) x,y indices in a single one
[[
nodiscard
]]
typename
SIMDIndices
::
IndexType
xyIndex
(
const
typename
SIMDIndices
::
IndexType
&
ix
,
//
[[
nodiscard
]]
typename
SIMDIndices
::
IndexType
xyIndex
(
const
typename
SIMDIndices
::
IndexType
&
ix
,
//
const
typename
SIMDIndices
::
IndexType
&
iy
//
const
typename
SIMDIndices
::
IndexType
&
iy
//
)
const
noexcept
{
)
const
noexcept
{
assert
(
all_of
(
ix
<
SIMDIndices
::
IndexType
(
NXBINS
)
)
);
assert
(
all_of
(
iy
<
SIMDIndices
::
IndexType
(
NYBINS
)
)
);
return
(
SIMDIndices
::
IndexType
(
NYBINS
)
*
ix
)
+
iy
;
return
(
SIMDIndices
::
IndexType
(
NYBINS
)
*
ix
)
+
iy
;
}
}
public
:
public
:
/// Access the mirror for a given combined xy index (Scalar)
/// Access the mirror for a given combined xy index (Scalar)
[[
nodiscard
]]
MirrorNum
get
(
const
ScalarIndex
ixy
)
const
noexcept
{
return
(
*
this
)[
ixy
];
}
[[
nodiscard
]]
MirrorNum
get
(
const
ScalarIndex
ixy
)
const
noexcept
{
assert
(
ixy
<
size
()
);
return
(
*
this
)[
ixy
];
}
/// Access the mirror for a given set of (x,y) indices (Scalar)
/// Access the mirror for a given set of (x,y) indices (Scalar)
[[
nodiscard
]]
MirrorNum
get
(
const
ScalarIndex
ix
,
//
[[
nodiscard
]]
MirrorNum
get
(
const
ScalarIndex
ix
,
//
const
ScalarIndex
iy
)
const
noexcept
{
const
ScalarIndex
iy
)
const
noexcept
{
...
@@ -289,6 +296,7 @@ namespace Rich::Utils {
...
@@ -289,6 +296,7 @@ namespace Rich::Utils {
/// Access the mirror for a given xy index (SIMD)
/// Access the mirror for a given xy index (SIMD)
[[
nodiscard
]]
SIMDIndices
get
(
const
typename
SIMDIndices
::
IndexType
&
ixy
)
const
noexcept
{
[[
nodiscard
]]
SIMDIndices
get
(
const
typename
SIMDIndices
::
IndexType
&
ixy
)
const
noexcept
{
// gather SIMD lookup
// gather SIMD lookup
assert
(
all_of
(
ixy
<
SIMDIndices
::
IndexType
(
size
()
)
)
);
return
(
*
this
)[
ixy
];
return
(
*
this
)[
ixy
];
}
}
...
...
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