CMS 3D CMS Logo

SoACommon.h
Go to the documentation of this file.
1 #ifndef DataFormats_SoATemplate_interface_SoACommon_h
2 #define DataFormats_SoATemplate_interface_SoACommon_h
3 
4 /*
5  * Definitions of SoA common parameters for SoA class generators
6  */
7 
8 #include <cstdint>
9 #include <cassert>
10 #include <ostream>
11 #include <tuple>
12 #include <type_traits>
13 
14 #include <boost/preprocessor.hpp>
15 
17 
18 // CUDA attributes
19 #ifdef __CUDACC__
20 #define SOA_HOST_ONLY __host__
21 #define SOA_DEVICE_ONLY __device__
22 #define SOA_HOST_DEVICE __host__ __device__
23 #define SOA_INLINE __forceinline__
24 #else
25 #define SOA_HOST_ONLY
26 #define SOA_DEVICE_ONLY
27 #define SOA_HOST_DEVICE
28 #define SOA_INLINE inline __attribute__((always_inline))
29 #endif
30 
31 // Exception throwing (or willful crash in kernels)
32 #if defined(__CUDACC__) && defined(__CUDA_ARCH__)
33 #define SOA_THROW_OUT_OF_RANGE(A) \
34  { \
35  printf("%s\n", (A)); \
36  __trap(); \
37  }
38 #else
39 #define SOA_THROW_OUT_OF_RANGE(A) \
40  { throw std::out_of_range(A); }
41 #endif
42 
43 /* declare "scalars" (one value shared across the whole SoA) and "columns" (one value per element) */
44 #define _VALUE_TYPE_SCALAR 0
45 #define _VALUE_TYPE_COLUMN 1
46 #define _VALUE_TYPE_EIGEN_COLUMN 2
47 
48 /* The size type need to be "hardcoded" in the template parameters for classes serialized by ROOT */
49 #define CMS_SOA_BYTE_SIZE_TYPE std::size_t
50 
51 namespace cms::soa {
52 
53  // size_type for indices. Compatible with ROOT Int_t, but limited to 2G entries
55  // byte_size_type for byte counts. Not creating an artificial limit (and not ROOT serialized).
57 
58  enum class SoAColumnType {
62  };
63 
64  namespace RestrictQualify {
65  constexpr bool enabled = true;
66  constexpr bool disabled = false;
67  constexpr bool Default = disabled;
68  } // namespace RestrictQualify
69 
70  namespace RangeChecking {
71  constexpr bool enabled = true;
72  constexpr bool disabled = false;
73  constexpr bool Default = disabled;
74  } // namespace RangeChecking
75 
76  template <typename T, bool RESTRICT_QUALIFY>
77  struct add_restrict {};
78 
79  template <typename T>
80  struct add_restrict<T, RestrictQualify::enabled> {
81  using Value = T;
82  using Pointer = T* __restrict__;
83  using Reference = T& __restrict__;
84  using ConstValue = const T;
85  using PointerToConst = const T* __restrict__;
86  using ReferenceToConst = const T& __restrict__;
87  };
88 
89  template <typename T>
90  struct add_restrict<T, RestrictQualify::disabled> {
91  using Value = T;
92  using Pointer = T*;
93  using Reference = T&;
94  using ConstValue = const T;
95  using PointerToConst = const T*;
96  using ReferenceToConst = const T&;
97  };
98 
99  // Forward declarations
100  template <SoAColumnType COLUMN_TYPE, typename T>
102 
103  template <SoAColumnType COLUMN_TYPE, typename T>
105 
106  // Templated const parameter sets for scalars, columns and Eigen columns
107  template <SoAColumnType COLUMN_TYPE, typename T>
108  struct SoAConstParametersImpl {
109  static constexpr SoAColumnType columnType = COLUMN_TYPE;
110 
111  using ValueType = T;
112  using ScalarType = T;
114 
115  // default constructor
116  SoAConstParametersImpl() = default;
117 
118  // constructor from an address
120 
121  // constructor from a non-const parameter set
123  : addr_{o.addr_} {}
124 
125  static constexpr bool checkAlignment(ValueType* addr, byte_size_type alignment) {
126  return reinterpret_cast<intptr_t>(addr) % alignment;
127  }
128 
129  public:
130  // scalar or column
131  ValueType const* addr_ = nullptr;
132  };
133 
134  // Templated const parameter specialisation for Eigen columns
135  template <typename T>
138 
139  using ValueType = T;
140  using ScalarType = typename T::Scalar;
141  using TupleOrPointerType = std::tuple<ScalarType*, byte_size_type>;
142 
143  // default constructor
144  SoAConstParametersImpl() = default;
145 
146  // constructor from individual address and stride
148  : addr_(addr), stride_(stride) {}
149 
150  // constructor from address and stride packed in a tuple
152  : addr_(std::get<0>(tuple)), stride_(std::get<1>(tuple)) {}
153 
154  // constructor from a non-const parameter set
156  : addr_{o.addr_}, stride_{o.stride_} {}
157 
158  static constexpr bool checkAlignment(TupleOrPointerType const& tuple, byte_size_type alignment) {
159  const auto& [addr, stride] = tuple;
160  return reinterpret_cast<intptr_t>(addr) % alignment;
161  }
162 
163  public:
164  // address and stride
165  ScalarType const* addr_ = nullptr;
166  byte_size_type stride_ = 0;
167  };
168 
169  // Matryoshka template to avoid commas inside macros
170  template <SoAColumnType COLUMN_TYPE>
172  template <typename T>
174  };
175 
176  // Templated parameter sets for scalars, columns and Eigen columns
177  template <SoAColumnType COLUMN_TYPE, typename T>
178  struct SoAParametersImpl {
179  static constexpr SoAColumnType columnType = COLUMN_TYPE;
180 
181  using ValueType = T;
182  using ScalarType = T;
184 
186  friend ConstType;
187 
188  // default constructor
189  SoAParametersImpl() = default;
190 
191  // constructor from an address
193 
195  return reinterpret_cast<intptr_t>(addr) % alignment;
196  }
197 
198  public:
199  // scalar or column
200  ValueType* addr_ = nullptr;
201  };
202 
203  // Templated parameter specialisation for Eigen columns
204  template <typename T>
207 
208  using ValueType = T;
209  using ScalarType = typename T::Scalar;
210  using TupleOrPointerType = std::tuple<ScalarType*, byte_size_type>;
211 
213  friend ConstType;
214 
215  // default constructor
216  SoAParametersImpl() = default;
217 
218  // constructor from individual address and stride
220  : addr_(addr), stride_(stride) {}
221 
222  // constructor from address and stride packed in a tuple
224  : addr_(std::get<0>(tuple)), stride_(std::get<1>(tuple)) {}
225 
227  const auto& [addr, stride] = tuple;
228  return reinterpret_cast<intptr_t>(addr) % alignment;
229  }
230 
231  public:
232  // address and stride
233  ScalarType* addr_ = nullptr;
234  byte_size_type stride_ = 0;
235  };
236 
237  // Matryoshka template to avoid commas inside macros
238  template <SoAColumnType COLUMN_TYPE>
240  template <typename T>
242  };
243 
244  // Helper converting a const parameter set to a non-const parameter set, to be used only in the constructor of non-const "element"
245  namespace {
246  template <typename T>
247  constexpr inline std::remove_const_t<T>* non_const_ptr(T* p) {
248  return const_cast<std::remove_const_t<T>*>(p);
249  }
250  } // namespace
251 
252  template <SoAColumnType COLUMN_TYPE, typename T>
255  return SoAParametersImpl<COLUMN_TYPE, T>{non_const_ptr(o.addr_)};
256  }
257 
258  template <typename T>
261  return SoAParametersImpl<SoAColumnType::eigen, T>{non_const_ptr(o.addr_), o.stride_};
262  }
263 
264  // Helper template managing the value at index idx within a column.
265  // The optional compile time alignment parameter enables informing the
266  // compiler of alignment (enforced by caller).
267  template <SoAColumnType COLUMN_TYPE,
268  typename T,
269  byte_size_type ALIGNMENT,
270  bool RESTRICT_QUALIFY = RestrictQualify::disabled>
271  class SoAValue {
272  // Eigen is implemented in a specialization
273  static_assert(COLUMN_TYPE != SoAColumnType::eigen);
274 
275  public:
277  using Val = typename Restr::Value;
278  using Ptr = typename Restr::Pointer;
279  using Ref = typename Restr::Reference;
280  using PtrToConst = typename Restr::PointerToConst;
281  using RefToConst = typename Restr::ReferenceToConst;
282 
284 
286  : idx_(i), col_(params.addr_) {}
287 
289  // Ptr type will add the restrict qualifyer if needed
290  Ptr col = col_;
291  return col[idx_];
292  }
293 
294  SOA_HOST_DEVICE SOA_INLINE RefToConst operator()() const {
295  // PtrToConst type will add the restrict qualifyer if needed
296  PtrToConst col = col_();
297  return col[idx_];
298  }
299 
301 
303 
304  /* This was an attempt to implement the syntax
305  *
306  * old_value = view.x
307  * view.x = new_value
308  *
309  * instead of
310  *
311  * old_value = view.x()
312  * view.x() = new_value
313  *
314  * but it was found to break in some corner cases.
315  * We keep them commented out for the time being.
316 
317  SOA_HOST_DEVICE SOA_INLINE operator T&() { return col_[idx_]; }
318 
319  template <typename T2>
320  SOA_HOST_DEVICE SOA_INLINE Ref operator=(const T2& v) {
321  return col_[idx_] = v;
322  }
323  */
324 
325  using valueType = Val;
326 
327  static constexpr auto valueSize = sizeof(T);
328 
329  private:
331  T* col_;
332  };
333 
334  // Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.
335 #ifdef EIGEN_WORLD_VERSION
336  // Helper template managing an Eigen-type value at index idx within a column.
337  template <class C, byte_size_type ALIGNMENT, bool RESTRICT_QUALIFY>
338  class SoAValue<SoAColumnType::eigen, C, ALIGNMENT, RESTRICT_QUALIFY> {
339  public:
340  using Type = C;
341  using MapType = Eigen::Map<C, 0, Eigen::InnerStride<Eigen::Dynamic>>;
342  using CMapType = const Eigen::Map<const C, 0, Eigen::InnerStride<Eigen::Dynamic>>;
344  using Val = typename Restr::Value;
345  using Ptr = typename Restr::Pointer;
346  using Ref = typename Restr::Reference;
347  using PtrToConst = typename Restr::PointerToConst;
348  using RefToConst = typename Restr::ReferenceToConst;
349 
351  : val_(col + i, C::RowsAtCompileTime, C::ColsAtCompileTime, Eigen::InnerStride<Eigen::Dynamic>(stride)),
352  crCol_(col),
353  cVal_(crCol_ + i, C::RowsAtCompileTime, C::ColsAtCompileTime, Eigen::InnerStride<Eigen::Dynamic>(stride)),
354  stride_(stride) {}
355 
356  SOA_HOST_DEVICE SOA_INLINE SoAValue(size_type i, SoAParametersImpl<SoAColumnType::eigen, C> params)
357  : val_(params.addr_ + i,
358  C::RowsAtCompileTime,
359  C::ColsAtCompileTime,
360  Eigen::InnerStride<Eigen::Dynamic>(params.stride_)),
361  crCol_(params.addr_),
362  cVal_(crCol_ + i,
363  C::RowsAtCompileTime,
364  C::ColsAtCompileTime,
365  Eigen::InnerStride<Eigen::Dynamic>(params.stride_)),
366  stride_(params.stride_) {}
367 
368  SOA_HOST_DEVICE SOA_INLINE MapType& operator()() { return val_; }
369 
370  SOA_HOST_DEVICE SOA_INLINE const CMapType& operator()() const { return cVal_; }
371 
372  SOA_HOST_DEVICE SOA_INLINE operator C() { return val_; }
373 
374  SOA_HOST_DEVICE SOA_INLINE operator const C() const { return cVal_; }
375 
376  SOA_HOST_DEVICE SOA_INLINE C* operator&() { return &val_; }
377 
378  SOA_HOST_DEVICE SOA_INLINE const C* operator&() const { return &cVal_; }
379 
380  template <class C2>
381  SOA_HOST_DEVICE SOA_INLINE MapType& operator=(const C2& v) {
382  return val_ = v;
383  }
384 
385  using ValueType = typename C::Scalar;
386  static constexpr auto valueSize = sizeof(typename C::Scalar);
387  SOA_HOST_DEVICE SOA_INLINE byte_size_type stride() const { return stride_; }
388 
389  private:
390  MapType val_;
391  const Ptr crCol_;
392  CMapType cVal_;
393  byte_size_type stride_;
394  };
395 #else
396  // Raise a compile-time error
397  template <class C, byte_size_type ALIGNMENT, bool RESTRICT_QUALIFY>
398  class SoAValue<SoAColumnType::eigen, C, ALIGNMENT, RESTRICT_QUALIFY> {
399  static_assert(!sizeof(C),
400  "Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.");
401  };
402 #endif
403 
404  // Helper template managing a const value at index idx within a column.
405  template <SoAColumnType COLUMN_TYPE,
406  typename T,
407  byte_size_type ALIGNMENT,
408  bool RESTRICT_QUALIFY = RestrictQualify::disabled>
410  // Eigen is implemented in a specialization
411  static_assert(COLUMN_TYPE != SoAColumnType::eigen);
412 
413  public:
415  using Val = typename Restr::Value;
416  using Ptr = typename Restr::Pointer;
417  using Ref = typename Restr::Reference;
418  using PtrToConst = typename Restr::PointerToConst;
419  using RefToConst = typename Restr::ReferenceToConst;
422 
424 
426  : idx_(i), col_(params.addr_) {}
427 
429  : idx_(i), col_(params.addr_) {}
430 
431  SOA_HOST_DEVICE SOA_INLINE RefToConst operator()() const {
432  // Ptr type will add the restrict qualifyer if needed
433  PtrToConst col = col_;
434  return col[idx_];
435  }
436 
437  SOA_HOST_DEVICE SOA_INLINE const T* operator&() const { return &col_[idx_]; }
438 
439  /* This was an attempt to implement the syntax
440  *
441  * old_value = view.x
442  *
443  * instead of
444  *
445  * old_value = view.x()
446  *
447  * but it was found to break in some corner cases.
448  * We keep them commented out for the time being.
449 
450  SOA_HOST_DEVICE SOA_INLINE operator T&() { return col_[idx_]; }
451  */
452 
453  using valueType = T;
454  static constexpr auto valueSize = sizeof(T);
455 
456  private:
458  const T* col_;
459  };
460 
461  // Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.
462 #ifdef EIGEN_WORLD_VERSION
463  // Helper template managing a const Eigen-type value at index idx within a column.
464  template <class C, byte_size_type ALIGNMENT, bool RESTRICT_QUALIFY>
465  class SoAConstValue<SoAColumnType::eigen, C, ALIGNMENT, RESTRICT_QUALIFY> {
466  public:
467  using Type = C;
468  using CMapType = Eigen::Map<const C, 0, Eigen::InnerStride<Eigen::Dynamic>>;
469  using RefToConst = const CMapType&;
471 
473  : crCol_(col),
474  cVal_(crCol_ + i, C::RowsAtCompileTime, C::ColsAtCompileTime, Eigen::InnerStride<Eigen::Dynamic>(stride)),
475  stride_(stride) {}
476 
477  SOA_HOST_DEVICE SOA_INLINE SoAConstValue(size_type i, SoAConstParametersImpl<SoAColumnType::eigen, C> params)
478  : crCol_(params.addr_),
479  cVal_(crCol_ + i,
480  C::RowsAtCompileTime,
481  C::ColsAtCompileTime,
482  Eigen::InnerStride<Eigen::Dynamic>(params.stride_)),
483  stride_(params.stride_) {}
484 
485  SOA_HOST_DEVICE SOA_INLINE const CMapType& operator()() const { return cVal_; }
486 
487  SOA_HOST_DEVICE SOA_INLINE operator const C() const { return cVal_; }
488 
489  SOA_HOST_DEVICE SOA_INLINE const C* operator&() const { return &cVal_; }
490 
491  using ValueType = typename C::Scalar;
492  static constexpr auto valueSize = sizeof(typename C::Scalar);
493 
494  SOA_HOST_DEVICE SOA_INLINE byte_size_type stride() const { return stride_; }
495 
496  private:
497  const typename C::Scalar* __restrict__ crCol_;
498  CMapType cVal_;
499  byte_size_type stride_;
500  };
501 #else
502  // Raise a compile-time error
503  template <class C, byte_size_type ALIGNMENT, bool RESTRICT_QUALIFY>
504  class SoAConstValue<SoAColumnType::eigen, C, ALIGNMENT, RESTRICT_QUALIFY> {
505  static_assert(!sizeof(C),
506  "Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.");
507  };
508 #endif
509 
510  // Helper template to avoid commas inside macros
511 #ifdef EIGEN_WORLD_VERSION
512  template <class C>
513  struct EigenConstMapMaker {
514  using Type = Eigen::Map<const C, Eigen::AlignmentType::Unaligned, Eigen::InnerStride<Eigen::Dynamic>>;
515 
516  class DataHolder {
517  public:
518  DataHolder(const typename C::Scalar* data) : data_(data) {}
519 
522  data_, C::RowsAtCompileTime, C::ColsAtCompileTime, Eigen::InnerStride<Eigen::Dynamic>(stride));
523  }
524 
525  private:
526  const typename C::Scalar* const data_;
527  };
528 
529  static DataHolder withData(const typename C::Scalar* data) { return DataHolder(data); }
530  };
531 #else
532  template <class C>
534  // Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.
535  static_assert(!sizeof(C),
536  "Eigen/Core should be pre-included before the SoA headers to enable support for Eigen columns.");
537  };
538 #endif
539 
540  // Helper function to compute aligned size
542  return ((size + alignment - 1) / alignment) * alignment;
543  }
544 
545 } // namespace cms::soa
546 
547 #define SOA_SCALAR(TYPE, NAME) (_VALUE_TYPE_SCALAR, TYPE, NAME)
548 #define SOA_COLUMN(TYPE, NAME) (_VALUE_TYPE_COLUMN, TYPE, NAME)
549 #define SOA_EIGEN_COLUMN(TYPE, NAME) (_VALUE_TYPE_EIGEN_COLUMN, TYPE, NAME)
550 
551 /* Iterate on the macro MACRO and return the result as a comma separated list */
552 #define _ITERATE_ON_ALL_COMMA(MACRO, DATA, ...) \
553  BOOST_PP_TUPLE_ENUM(BOOST_PP_SEQ_TO_TUPLE(_ITERATE_ON_ALL(MACRO, DATA, __VA_ARGS__)))
554 
555 /* Iterate MACRO on all elements */
556 #define _ITERATE_ON_ALL(MACRO, DATA, ...) BOOST_PP_SEQ_FOR_EACH(MACRO, DATA, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))
557 
558 /* Switch on macros depending on scalar / column type */
559 #define _SWITCH_ON_TYPE(VALUE_TYPE, IF_SCALAR, IF_COLUMN, IF_EIGEN_COLUMN) \
560  BOOST_PP_IF( \
561  BOOST_PP_EQUAL(VALUE_TYPE, _VALUE_TYPE_SCALAR), \
562  IF_SCALAR, \
563  BOOST_PP_IF( \
564  BOOST_PP_EQUAL(VALUE_TYPE, _VALUE_TYPE_COLUMN), \
565  IF_COLUMN, \
566  BOOST_PP_IF(BOOST_PP_EQUAL(VALUE_TYPE, _VALUE_TYPE_EIGEN_COLUMN), IF_EIGEN_COLUMN, BOOST_PP_EMPTY())))
567 
568 namespace cms::soa {
569 
570  /* Column accessors: templates implementing the global accesors (soa::x() and soa::x(index) */
572 
573  template <typename, SoAColumnType, SoAAccessType, byte_size_type, bool>
575 
576  // TODO from Eric Cano:
577  // - add alignment support
578  // - SFINAE-based const/non const variants
579 
580  // Column
581  template <typename T, byte_size_type alignment, bool restrictQualify>
584  : params_(params) {}
585  SOA_HOST_DEVICE SOA_INLINE T* operator()() { return params_.addr_; }
587  using ParamReturnType = T&;
588  SOA_HOST_DEVICE SOA_INLINE T& operator()(size_type index) { return params_.addr_[index]; }
589 
590  private:
592  };
593 
594  // Const column
595  template <typename T, byte_size_type alignment, bool restrictQualify>
598  : params_(params) {}
599  SOA_HOST_DEVICE SOA_INLINE const T* operator()() const { return params_.addr_; }
600  using NoParamReturnType = const T*;
601  using ParamReturnType = const T&;
602  SOA_HOST_DEVICE SOA_INLINE T const& operator()(size_type index) const { return params_.addr_[index]; }
603 
604  private:
606  };
607 
608  // Scalar
609  template <typename T, byte_size_type alignment, bool restrictQualify>
612  : params_(params) {}
613  SOA_HOST_DEVICE SOA_INLINE T& operator()() { return *params_.addr_; }
616  SOA_HOST_DEVICE SOA_INLINE void operator()(size_type index) const {
617  assert(false && "Indexed access impossible for SoA scalars.");
618  }
619 
620  private:
622  };
623 
624  // Const scalar
625  template <typename T, byte_size_type alignment, bool restrictQualify>
628  : params_(params) {}
629  SOA_HOST_DEVICE SOA_INLINE T const& operator()() const { return *params_.addr_; }
630  using NoParamReturnType = T const&;
632  SOA_HOST_DEVICE SOA_INLINE void operator()(size_type index) const {
633  assert(false && "Indexed access impossible for SoA scalars.");
634  }
635 
636  private:
638  };
639 
640  // Eigen-type
641  template <typename T, byte_size_type alignment, bool restrictQualify>
644  : params_(params) {}
645  SOA_HOST_DEVICE SOA_INLINE typename T::Scalar* operator()() { return params_.addr_; }
646  using NoParamReturnType = typename T::Scalar*;
650  }
651 
652  private:
654  };
655 
656  // Const Eigen-type
657  template <typename T, byte_size_type alignment, bool restrictQualify>
660  : params_(params) {}
661  SOA_HOST_DEVICE SOA_INLINE typename T::Scalar const* operator()() const { return params_.addr_; }
662  using NoParamReturnType = typename T::Scalar const*;
666  }
667 
668  private:
670  };
671 
672  /* A helper template stager to avoid commas inside macros */
673  template <typename T>
674  struct SoAAccessors {
675  template <auto columnType>
676  struct ColumnType {
677  template <auto accessType>
678  struct AccessType {
679  template <auto alignment>
680  struct Alignment {
681  template <auto restrictQualify>
683  : public SoAColumnAccessorsImpl<T, columnType, accessType, alignment, restrictQualify> {
685  };
686  };
687  };
688  };
689  };
690 
691  /* Enum parameters allowing templated control of layout/view behaviors */
692  /* Alignment enforcement verifies every column is aligned, and
693  * hints the compiler that it can expect column pointers to be aligned */
695  static constexpr bool relaxed = false;
696  static constexpr bool enforced = true;
697  };
698 
699  struct CacheLineSize {
700  static constexpr byte_size_type NvidiaGPU = 128;
701  static constexpr byte_size_type IntelCPU = 64;
702  static constexpr byte_size_type AMDCPU = 64;
703  static constexpr byte_size_type ARMCPU = 64;
705  };
706 
707 } // namespace cms::soa
708 
709 // Small wrapper for stream insertion of SoA printing
710 template <typename SOA,
711  typename SFINAE =
712  typename std::enable_if_t<std::is_invocable_v<decltype(&SOA::soaToStreamInternal), SOA&, std::ostream&>>>
713 SOA_HOST_ONLY std::ostream& operator<<(std::ostream& os, const SOA& soa) {
714  soa.soaToStreamInternal(os);
715  return os;
716 }
717 
718 #endif // DataFormats_SoATemplate_interface_SoACommon_h
size
Write out results.
static constexpr auto valueSize
Definition: SoACommon.h:327
typename Restr::PointerToConst PtrToConst
Definition: SoACommon.h:280
static constexpr bool enforced
Definition: SoACommon.h:696
constexpr byte_size_type alignSize(byte_size_type size, byte_size_type alignment)
Definition: SoACommon.h:541
static constexpr bool checkAlignment(TupleOrPointerType const &tuple, byte_size_type alignment)
Definition: SoACommon.h:226
std::ostream & operator<<(std::ostream &os, const SOA &soa)
Definition: SoACommon.h:713
mathSSE::Vec4< double > operator &(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Definition: AVXVec.h:99
static constexpr byte_size_type AMDCPU
Definition: SoACommon.h:702
double Scalar
Definition: Definitions.h:25
cms_int32_t size_type
Definition: SoACommon.h:54
constexpr bool Default
Definition: SoACommon.h:73
int cms_int32_t
Definition: typedefs.h:14
static constexpr SoAColumnType columnType
Definition: SoACommon.h:179
std::tuple< ScalarType *, byte_size_type > TupleOrPointerType
Definition: SoACommon.h:210
constexpr bool enabled
Definition: SoACommon.h:71
T ScalarType
assert(be >=bs)
SoAConstParametersImpl< COLUMN_TYPE, T > ConstParams
Definition: SoACommon.h:421
constexpr bool enabled
Definition: SoACommon.h:65
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
add_restrict< T, RESTRICT_QUALIFY > Restr
Definition: SoACommon.h:276
static constexpr auto valueSize
Definition: SoACommon.h:454
typename Restr::PointerToConst PtrToConst
Definition: SoACommon.h:418
#define _VALUE_TYPE_SCALAR
Definition: SoACommon.h:44
typename Restr::Value Val
Definition: SoACommon.h:277
static constexpr byte_size_type IntelCPU
Definition: SoACommon.h:701
typename Restr::Reference Ref
Definition: SoACommon.h:279
#define SOA_HOST_ONLY
Definition: SoACommon.h:25
static constexpr byte_size_type ARMCPU
Definition: SoACommon.h:703
static constexpr byte_size_type defaultSize
Definition: SoACommon.h:704
size_type idx_
Definition: SoACommon.h:330
ZVertexSoA * soa
T const_cast_SoAParametersImpl(SoAConstParametersImpl< COLUMN_TYPE, T > const &o)
Definition: SoACommon.h:253
std::size_t byte_size_type
Definition: SoACommon.h:56
reco::JetExtendedAssociation::JetExtendedData Value
ValueType
Type of the value held by a Value object.
Definition: value.h:23
#define SOA_INLINE
Definition: SoACommon.h:28
SoAParametersImpl< COLUMN_TYPE, T > params
Definition: SoACommon.h:286
static constexpr SoAColumnType columnType
Definition: SoACommon.h:109
SoAParametersImpl< COLUMN_TYPE, T > params
Definition: SoACommon.h:426
#define SOA_HOST_DEVICE
Definition: SoACommon.h:27
#define _VALUE_TYPE_EIGEN_COLUMN
Definition: SoACommon.h:46
static constexpr bool relaxed
Definition: SoACommon.h:695
#define _VALUE_TYPE_COLUMN
Definition: SoACommon.h:45
typename Restr::ReferenceToConst RefToConst
Definition: SoACommon.h:281
SoAColumnType
Definition: SoACommon.h:58
typename Restr::ReferenceToConst RefToConst
Definition: SoACommon.h:419
static constexpr byte_size_type NvidiaGPU
Definition: SoACommon.h:700
typename Restr::Pointer Ptr
Definition: SoACommon.h:278
typename Restr::Reference Ref
Definition: SoACommon.h:417
std::tuple< ScalarType *, byte_size_type > TupleOrPointerType
Definition: SoACommon.h:141
constexpr bool Default
Definition: SoACommon.h:67
static constexpr bool checkAlignment(ValueType *addr, byte_size_type alignment)
Definition: SoACommon.h:194
typename SoAValue< SoAColumnType::eigen, T, alignment, restrictQualify >::MapType ParamReturnType
Definition: SoACommon.h:647
((always_inline)) typename T typename SoAValue< SoAColumnType::eigen, T, alignment, restrictQualify >::CMapType ParamReturnType
Definition: SoACommon.h:663
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
constexpr bool disabled
Definition: SoACommon.h:66
typename Restr::Value Val
Definition: SoACommon.h:415
#define CMS_SOA_BYTE_SIZE_TYPE
Definition: SoACommon.h:49
constexpr bool disabled
Definition: SoACommon.h:72
#define get
long double T
typename Restr::Pointer Ptr
Definition: SoACommon.h:416
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
Definition: matutil.cc:166