Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow three extra refinement levels for an ElementId #6347

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

kidder
Copy link
Member

@kidder kidder commented Oct 21, 2024

This is done by using a compact representation of a SegmentId. Also fix some clang-tidy errors.

Proposed changes

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

src/Utilities/StdHelpers/Bit.hpp Outdated Show resolved Hide resolved
Comment on lines 15 to 17
ASSERT(refinement_level < max_refinement_level,
ASSERT(refinement_level <= max_refinement_level,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove this check. It's not a constraint on SegmentId but a constraint on ElementId

Comment on lines 16 to 20
#if defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L
#include <bit>
#else
#include "Utilities/StdHelpers/Bit.hpp"
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should be in the Bit.hpp file. Nobody will know to do this magic when including that file.

src/Domain/Structure/ElementId.cpp Outdated Show resolved Hide resolved
src/Domain/Structure/ElementId.cpp Show resolved Hide resolved
src/Domain/Structure/ElementId.cpp Outdated Show resolved Hide resolved
src/Domain/Structure/ElementId.cpp Outdated Show resolved Hide resolved
src/Domain/Structure/ElementId.cpp Outdated Show resolved Hide resolved
src/Domain/Structure/ElementId.cpp Outdated Show resolved Hide resolved
nilsvu
nilsvu previously approved these changes Oct 24, 2024
Copy link
Member

@nilsvu nilsvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty cool 😎 thanks for doing this.

Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, could you move the adding of std::bit_* into a separate commit as you squash?

Some useful functions (std::has_single_bit and std::bit_floor) in
the standard library bit are not defined until the version used by
gcc10.  So if they are not in the library we add implementations
based on cppreference.com
This is done by using a compact representation of a SegmentId.
Also fix some clang-tidy errors.
@nilsdeppe nilsdeppe merged commit 7f96d57 into sxs-collaboration:develop Nov 4, 2024
23 checks passed
@kidder kidder deleted the segment_id_bit_field branch November 8, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants