Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
atlas
athena
Merge requests
!71187
use std::assume_aligned, the CxxUtils version should have no uses anymore
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
use std::assume_aligned, the CxxUtils version should have no uses anymore
ATLAS-EGamma/athena:std__assume_alligned
into
main
Overview
3
Commits
1
Pipelines
1
Changes
5
Merged
Christos Anastopoulos
requested to merge
ATLAS-EGamma/athena:std__assume_alligned
into
main
9 months ago
Overview
3
Commits
1
Pipelines
1
Changes
5
Expand
use std::assume_aligned, the CxxUtils version should have no uses anymore
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
59f6c6e3
1 commit,
9 months ago
5 files
+
18
−
62
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
Control/CxxUtils/CxxUtils/assume_aligned.h deleted
100644 → 0
+
0
−
43
Options
/*
* Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file CxxUtils/assume_aligned.h
* @author Christos Anastopoulos
* @date Jan, 2022
* @brief @c assumed_aligned for C++17
*
*
* C++20 introduces std::assumed_aligned.
* From the relevant paper
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r1.pdf
*
* This is to allow using it already in C++17
*/
#ifndef CXXUTILS_ASSUME_ALIGNED_H
#define CXXUTILS_ASSUME_ALIGNED_H
#include
<cstddef>
#include
"CxxUtils/inline_hints.h"
namespace
CxxUtils
{
template
<
size_t
Align
,
typename
T
>
[[
nodiscard
]]
ATH_ALWAYS_INLINE
T
*
assume_aligned
(
T
*
ptr
)
noexcept
{
static_assert
((
Align
!=
0
&&
(
Align
&
(
Align
-
1
))
==
0
),
"Align not a power of 2"
);
#if (defined(__GNUC__) || defined(__clang__))
return
static_cast
<
T
*>
(
__builtin_assume_aligned
(
ptr
,
Align
));
#else
return
ptr
;
#endif
}
}
// namespace CxxUtils
#endif
Loading