Skip to content

Commit

Permalink
Enable SoA range checking by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed May 16, 2024
1 parent 43944b8 commit d6d45f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions DataFormats/SoATemplate/interface/SoACommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ namespace cms::soa {
namespace RestrictQualify {
constexpr bool enabled = true;
constexpr bool disabled = false;
constexpr bool Default = disabled;
constexpr bool Default = enabled;
} // namespace RestrictQualify

namespace RangeChecking {
constexpr bool enabled = true;
constexpr bool disabled = false;
constexpr bool Default = disabled;
constexpr bool Default = enabled;
} // namespace RangeChecking

template <typename T, bool RESTRICT_QUALIFY>
Expand Down
8 changes: 4 additions & 4 deletions DataFormats/SoATemplate/interface/SoALayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@
\
template <CMS_SOA_BYTE_SIZE_TYPE VIEW_ALIGNMENT = cms::soa::CacheLineSize::defaultSize, \
bool VIEW_ALIGNMENT_ENFORCEMENT = cms::soa::AlignmentEnforcement::relaxed, \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::enabled, \
bool RANGE_CHECKING = cms::soa::RangeChecking::disabled> \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::Default, \
bool RANGE_CHECKING = cms::soa::RangeChecking::Default> \
struct ViewTemplateFreeParams; \
\
/* dump the SoA internal structure */ \
Expand Down Expand Up @@ -539,7 +539,7 @@
using ConstViewTemplate = ConstViewTemplateFreeParams<ALIGNMENT, ALIGNMENT_ENFORCEMENT, RESTRICT_QUALIFY, \
RANGE_CHECKING>; \
\
using ConstView = ConstViewTemplate<cms::soa::RestrictQualify::enabled, cms::soa::RangeChecking::disabled>; \
using ConstView = ConstViewTemplate<cms::soa::RestrictQualify::Default, cms::soa::RangeChecking::Default>; \
\
/* Generate the mutable View template */ \
_GENERATE_SOA_TRIVIAL_VIEW(CLASS, \
Expand All @@ -552,7 +552,7 @@
template <bool RESTRICT_QUALIFY, bool RANGE_CHECKING> \
using ViewTemplate = ViewTemplateFreeParams<ALIGNMENT, ALIGNMENT_ENFORCEMENT, RESTRICT_QUALIFY, RANGE_CHECKING>; \
\
using View = ViewTemplate<cms::soa::RestrictQualify::enabled, cms::soa::RangeChecking::disabled>; \
using View = ViewTemplate<cms::soa::RestrictQualify::Default, cms::soa::RangeChecking::Default>; \
\
/* Trivial constuctor */ \
CLASS() \
Expand Down
8 changes: 4 additions & 4 deletions DataFormats/SoATemplate/interface/SoAView.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ namespace cms::soa {
#define _GENERATE_SOA_VIEW_PART_0(CONST_VIEW, VIEW, LAYOUTS_LIST, VALUE_LIST) \
template <CMS_SOA_BYTE_SIZE_TYPE VIEW_ALIGNMENT = cms::soa::CacheLineSize::defaultSize, \
bool VIEW_ALIGNMENT_ENFORCEMENT = cms::soa::AlignmentEnforcement::relaxed, \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::enabled, \
bool RANGE_CHECKING = cms::soa::RangeChecking::disabled> \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::Default, \
bool RANGE_CHECKING = cms::soa::RangeChecking::Default> \
struct VIEW : public CONST_VIEW<VIEW_ALIGNMENT, VIEW_ALIGNMENT_ENFORCEMENT, RESTRICT_QUALIFY, RANGE_CHECKING> { \
/* Declare the parametrized layouts as the default */ \
/*BOOST_PP_SEQ_CAT(_ITERATE_ON_ALL(_DECLARE_VIEW_LAYOUT_PARAMETRIZED_TEMPLATE, ~, LAYOUTS_LIST)) */ \
Expand Down Expand Up @@ -671,8 +671,8 @@ namespace cms::soa {
#define _GENERATE_SOA_CONST_VIEW_PART_0(CONST_VIEW, VIEW, LAYOUTS_LIST, VALUE_LIST) \
template <CMS_SOA_BYTE_SIZE_TYPE VIEW_ALIGNMENT = cms::soa::CacheLineSize::defaultSize, \
bool VIEW_ALIGNMENT_ENFORCEMENT = cms::soa::AlignmentEnforcement::relaxed, \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::enabled, \
bool RANGE_CHECKING = cms::soa::RangeChecking::disabled> \
bool RESTRICT_QUALIFY = cms::soa::RestrictQualify::Default, \
bool RANGE_CHECKING = cms::soa::RangeChecking::Default> \
struct CONST_VIEW { \
/* these could be moved to an external type trait to free up the symbol names */ \
using self_type = CONST_VIEW;
Expand Down

0 comments on commit d6d45f7

Please sign in to comment.