CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
Matriplex Namespace Reference

Classes

struct  CholeskyInverter
 
struct  CholeskyInverter< T, 3, N >
 
struct  CholeskyInverterSym
 
struct  CholeskyInverterSym< T, 3, N >
 
struct  CramerInverter
 
struct  CramerInverter< T, 2, N >
 
struct  CramerInverter< T, 3, N >
 
struct  CramerInverterSym
 
struct  CramerInverterSym< T, 2, N >
 
struct  CramerInverterSym< T, 3, N >
 
class  Matriplex
 
class  MatriplexSym
 
class  MatriplexVector
 
struct  MultiplyCls
 
struct  MultiplyCls< T, 3, N >
 
struct  MultiplyCls< T, 6, N >
 
struct  SymMultiplyCls
 
struct  SymMultiplyCls< T, 3, N >
 
struct  SymMultiplyCls< T, 6, N >
 

Typedefs

typedef int idx_t
 
template<typename T , idx_t D1, idx_t D2, idx_t N>
using MPlex = Matriplex< T, D1, D2, N >
 
template<typename T , idx_t D, idx_t N>
using MPlexSym = MatriplexSym< T, D, N >
 
template<class MP >
using MPlexVec = MatriplexVector< MP >
 

Functions

void align_check (const char *pref, void *adr)
 
void * aligned_alloc64 (std::size_t size)
 
template<typename T , idx_t D, idx_t N>
void invertCholesky (MPlexVec< MPlex< T, D, D, N >> &A, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void invertCholesky (MPlex< T, D, D, N > &A)
 
template<typename T , idx_t D, idx_t N>
void invertCholeskySym (MPlexVec< MPlexSym< T, D, N >> &A, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void invertCholeskySym (MPlexSym< T, D, N > &A)
 
template<typename T , idx_t D, idx_t N>
void invertCramer (MPlexVec< MPlex< T, D, D, N >> &A, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void invertCramer (MPlex< T, D, D, N > &A, double *determ=nullptr)
 
template<typename T , idx_t D, idx_t N>
void invertCramerSym (MPlexVec< MPlexSym< T, D, N >> &A, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void invertCramerSym (MPlexSym< T, D, N > &A, double *determ=nullptr)
 
template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void multiply (const MPlexVec< MPlex< T, D1, D2, N >> &A, const MPlexVec< MPlex< T, D2, D3, N >> &B, MPlexVec< MPlex< T, D1, D3, N >> &C, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void multiply (const MPlexVec< MPlexSym< T, D, N >> &A, const MPlexVec< MPlexSym< T, D, N >> &B, MPlexVec< MPlex< T, D, D, N >> &C, int n_to_process=0)
 
template<typename T , idx_t D, idx_t N>
void multiply (const MPlexSym< T, D, N > &A, const MPlexSym< T, D, N > &B, MPlex< T, D, D, N > &C)
 
template<typename T , idx_t D, idx_t N>
void multiply (const MPlex< T, D, D, N > &A, const MPlex< T, D, D, N > &B, MPlex< T, D, D, N > &C)
 
template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void multiply3in (MPlexVec< MPlex< T, D1, D2, N >> &A, MPlexVec< MPlex< T, D2, D3, N >> &B, MPlexVec< MPlex< T, D1, D3, N >> &C, int n_to_process=0)
 
template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void multiplyGeneral (const MPlexVec< MPlex< T, D1, D2, N >> &A, const MPlexVec< MPlex< T, D2, D3, N >> &B, MPlexVec< MPlex< T, D1, D3, N >> &C, int n_to_process=0)
 
template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void multiplyGeneral (const MPlex< T, D1, D2, N > &A, const MPlex< T, D2, D3, N > &B, MPlex< T, D1, D3, N > &C)
 
constexpr std::size_t round_up_align64 (std::size_t size)
 

Variables

const idx_t gSymOffsets [7][36]
 

Typedef Documentation

◆ idx_t

typedef int Matriplex::idx_t

Definition at line 86 of file MatriplexCommon.h.

◆ MPlex

template<typename T , idx_t D1, idx_t D2, idx_t N>
using Matriplex::MPlex = typedef Matriplex<T, D1, D2, N>

Definition at line 188 of file Matriplex.h.

◆ MPlexSym

template<typename T , idx_t D, idx_t N>
using Matriplex::MPlexSym = typedef MatriplexSym<T, D, N>

Definition at line 269 of file MatriplexSym.h.

◆ MPlexVec

template<class MP >
using Matriplex::MPlexVec = typedef MatriplexVector<MP>

Definition at line 48 of file MatriplexVector.h.

Function Documentation

◆ align_check()

void Matriplex::align_check ( const char *  pref,
void *  adr 
)

Definition at line 4 of file MatriplexCommon.cc.

Referenced by mkfit::MkFitter::checkAlignment().

4  {
5  printf("%s 0x%llx - modulo 64 = %lld\n", pref, (long long unsigned)adr, (long long)adr % 64);
6  }

◆ aligned_alloc64()

void* Matriplex::aligned_alloc64 ( std::size_t  size)
inline

Definition at line 13 of file Memory.h.

References round_up_align64(), and findQualityFiles::size.

Referenced by mkfit::Pool< mkfit::MkFitter >::create(), and Matriplex::MatriplexVector< MP >::MatriplexVector().

13 { return std::aligned_alloc(64, round_up_align64(size)); }
size
Write out results.
constexpr std::size_t round_up_align64(std::size_t size)
Definition: Memory.h:8

◆ invertCholesky() [1/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCholesky ( MPlexVec< MPlex< T, D, D, N >> &  A,
int  n_to_process = 0 
)

Definition at line 126 of file MatriplexVector.h.

References A, mps_fire::i, invertCholesky(), and np.

126  {
127  const int np = n_to_process ? n_to_process : A.size();
128 
129  for (int i = 0; i < np; ++i) {
130  invertCholesky(A[i]);
131  }
132  }
int np
Definition: AMPTWrapper.h:43
void invertCholesky(MPlexVec< MPlex< T, D, D, N >> &A, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ invertCholesky() [2/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCholesky ( MPlex< T, D, D, N > &  A)

◆ invertCholeskySym() [1/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCholeskySym ( MPlexVec< MPlexSym< T, D, N >> &  A,
int  n_to_process = 0 
)

Definition at line 144 of file MatriplexVector.h.

References A, mps_fire::i, invertCholeskySym(), and np.

144  {
145  const int np = n_to_process ? n_to_process : A.size();
146 
147  for (int i = 0; i < np; ++i) {
149  }
150  }
void invertCholeskySym(MPlexVec< MPlexSym< T, D, N >> &A, int n_to_process=0)
int np
Definition: AMPTWrapper.h:43
Definition: APVGainStruct.h:7

◆ invertCholeskySym() [2/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCholeskySym ( MPlexSym< T, D, N > &  A)

◆ invertCramer() [1/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCramer ( MPlexVec< MPlex< T, D, D, N >> &  A,
int  n_to_process = 0 
)

Definition at line 117 of file MatriplexVector.h.

References A, mps_fire::i, invertCramer(), and np.

117  {
118  const int np = n_to_process ? n_to_process : A.size();
119 
120  for (int i = 0; i < np; ++i) {
121  invertCramer(A[i]);
122  }
123  }
int np
Definition: AMPTWrapper.h:43
void invertCramer(MPlexVec< MPlex< T, D, D, N >> &A, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ invertCramer() [2/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCramer ( MPlex< T, D, D, N > &  A,
double *  determ = nullptr 
)

◆ invertCramerSym() [1/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCramerSym ( MPlexVec< MPlexSym< T, D, N >> &  A,
int  n_to_process = 0 
)

Definition at line 135 of file MatriplexVector.h.

References A, mps_fire::i, invertCramerSym(), and np.

135  {
136  const int np = n_to_process ? n_to_process : A.size();
137 
138  for (int i = 0; i < np; ++i) {
139  invertCramerSym(A[i]);
140  }
141  }
int np
Definition: AMPTWrapper.h:43
void invertCramerSym(MPlexVec< MPlexSym< T, D, N >> &A, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ invertCramerSym() [2/2]

template<typename T , idx_t D, idx_t N>
void Matriplex::invertCramerSym ( MPlexSym< T, D, N > &  A,
double *  determ = nullptr 
)

◆ multiply() [1/4]

template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void Matriplex::multiply ( const MPlexVec< MPlex< T, D1, D2, N >> &  A,
const MPlexVec< MPlex< T, D2, D3, N >> &  B,
MPlexVec< MPlex< T, D1, D3, N >> &  C,
int  n_to_process = 0 
)

Definition at line 53 of file MatriplexVector.h.

References A, cms::cuda::assert(), B, correctionTermsCaloMet_cff::C, mps_fire::i, multiply(), and np.

56  {
57  assert(A.size() == B.size());
58  assert(A.size() == C.size());
59 
60  const int np = n_to_process ? n_to_process : A.size();
61 
62  for (int i = 0; i < np; ++i) {
63  multiply(A[i], B[i], C[i]);
64  }
65  }
Definition: APVGainStruct.h:7
assert(be >=bs)
int np
Definition: AMPTWrapper.h:43
void multiply(const MPlexVec< MPlexSym< T, D, N >> &A, const MPlexVec< MPlexSym< T, D, N >> &B, MPlexVec< MPlex< T, D, D, N >> &C, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ multiply() [2/4]

template<typename T , idx_t D, idx_t N>
void Matriplex::multiply ( const MPlexVec< MPlexSym< T, D, N >> &  A,
const MPlexVec< MPlexSym< T, D, N >> &  B,
MPlexVec< MPlex< T, D, D, N >> &  C,
int  n_to_process = 0 
)

Definition at line 100 of file MatriplexVector.h.

References A, cms::cuda::assert(), B, correctionTermsCaloMet_cff::C, mps_fire::i, multiply(), and np.

103  {
104  assert(A.size() == B.size());
105  assert(A.size() == C.size());
106 
107  const int np = n_to_process ? n_to_process : A.size();
108 
109  for (int i = 0; i < np; ++i) {
110  multiply(A[i], B[i], C[i]);
111  }
112  }
Definition: APVGainStruct.h:7
assert(be >=bs)
int np
Definition: AMPTWrapper.h:43
void multiply(const MPlexVec< MPlexSym< T, D, N >> &A, const MPlexVec< MPlexSym< T, D, N >> &B, MPlexVec< MPlex< T, D, D, N >> &C, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ multiply() [3/4]

template<typename T , idx_t D, idx_t N>
void Matriplex::multiply ( const MPlexSym< T, D, N > &  A,
const MPlexSym< T, D, N > &  B,
MPlex< T, D, D, N > &  C 
)

Definition at line 337 of file MatriplexSym.h.

References A, B, correctionTermsCaloMet_cff::C, and Matriplex::SymMultiplyCls< T, D, N >::multiply().

337  {
339  }
Definition: APVGainStruct.h:7
void multiply(const MPlexSym< T, D, N > &A, const MPlexSym< T, D, N > &B, MPlex< T, D, D, N > &C)
Definition: MatriplexSym.h:337
Definition: APVGainStruct.h:7

◆ multiply() [4/4]

template<typename T , idx_t D, idx_t N>
void Matriplex::multiply ( const MPlex< T, D, D, N > &  A,
const MPlex< T, D, D, N > &  B,
MPlex< T, D, D, N > &  C 
)

Definition at line 340 of file Matriplex.h.

References A, B, correctionTermsCaloMet_cff::C, Matriplex::MultiplyCls< T, D, N >::multiply(), and N.

Referenced by multiply(), multiply3in(), and AlignmentExtendedCorrelationsEntry::operator*=().

340  {
341 #ifdef DEBUG
342  printf("Multipl %d %d\n", D, N);
343 #endif
344 
346  }
Definition: APVGainStruct.h:7
void multiply(const MPlex< T, D, D, N > &A, const MPlex< T, D, D, N > &B, MPlex< T, D, D, N > &C)
Definition: Matriplex.h:340
#define N
Definition: blowfish.cc:9
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
Definition: APVGainStruct.h:7

◆ multiply3in()

template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void Matriplex::multiply3in ( MPlexVec< MPlex< T, D1, D2, N >> &  A,
MPlexVec< MPlex< T, D2, D3, N >> &  B,
MPlexVec< MPlex< T, D1, D3, N >> &  C,
int  n_to_process = 0 
)

Definition at line 83 of file MatriplexVector.h.

References A, cms::cuda::assert(), B, correctionTermsCaloMet_cff::C, mps_fire::i, multiply(), and np.

86  {
87  assert(A.size() == B.size());
88  assert(A.size() == C.size());
89 
90  const int np = n_to_process ? n_to_process : A.size();
91 
92  for (int i = 0; i < np; ++i) {
93  multiply(A[i], B[i], C[i]);
94  multiply(B[i], C[i], A[i]);
95  multiply(C[i], A[i], B[i]);
96  }
97  }
Definition: APVGainStruct.h:7
assert(be >=bs)
int np
Definition: AMPTWrapper.h:43
void multiply(const MPlexVec< MPlexSym< T, D, N >> &A, const MPlexVec< MPlexSym< T, D, N >> &B, MPlexVec< MPlex< T, D, D, N >> &C, int n_to_process=0)
Definition: APVGainStruct.h:7

◆ multiplyGeneral() [1/2]

template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void Matriplex::multiplyGeneral ( const MPlexVec< MPlex< T, D1, D2, N >> &  A,
const MPlexVec< MPlex< T, D2, D3, N >> &  B,
MPlexVec< MPlex< T, D1, D3, N >> &  C,
int  n_to_process = 0 
)

Definition at line 68 of file MatriplexVector.h.

References A, cms::cuda::assert(), B, correctionTermsCaloMet_cff::C, mps_fire::i, multiplyGeneral(), and np.

71  {
72  assert(A.size() == B.size());
73  assert(A.size() == C.size());
74 
75  const int np = n_to_process ? n_to_process : A.size();
76 
77  for (int i = 0; i < np; ++i) {
78  multiplyGeneral(A[i], B[i], C[i]);
79  }
80  }
Definition: APVGainStruct.h:7
void multiplyGeneral(const MPlexVec< MPlex< T, D1, D2, N >> &A, const MPlexVec< MPlex< T, D2, D3, N >> &B, MPlexVec< MPlex< T, D1, D3, N >> &C, int n_to_process=0)
assert(be >=bs)
int np
Definition: AMPTWrapper.h:43
Definition: APVGainStruct.h:7

◆ multiplyGeneral() [2/2]

template<typename T , idx_t D1, idx_t D2, idx_t D3, idx_t N>
void Matriplex::multiplyGeneral ( const MPlex< T, D1, D2, N > &  A,
const MPlex< T, D2, D3, N > &  B,
MPlex< T, D1, D3, N > &  C 
)

Definition at line 195 of file Matriplex.h.

References A, B, correctionTermsCaloMet_cff::C, trklet::D3, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, N, and dqmiodumpmetadata::n.

Referenced by multiplyGeneral().

195  {
196  for (idx_t i = 0; i < D1; ++i) {
197  for (idx_t j = 0; j < D3; ++j) {
198  const idx_t ijo = N * (i * D3 + j);
199 
200 #pragma omp simd
201  for (idx_t n = 0; n < N; ++n) {
202  C.fArray[ijo + n] = 0;
203  }
204 
205  for (idx_t k = 0; k < D2; ++k) {
206  const idx_t iko = N * (i * D2 + k);
207  const idx_t kjo = N * (k * D3 + j);
208 
209 #pragma omp simd
210  for (idx_t n = 0; n < N; ++n) {
211  C.fArray[ijo + n] += A.fArray[iko + n] * B.fArray[kjo + n];
212  }
213  }
214  }
215  }
216  }
Divides< B, C > D2
Definition: Factorize.h:137
Definition: APVGainStruct.h:7
Divides< A, C > D1
Definition: Factorize.h:136
#define N
Definition: blowfish.cc:9
Definition: APVGainStruct.h:7

◆ round_up_align64()

constexpr std::size_t Matriplex::round_up_align64 ( std::size_t  size)

Definition at line 8 of file Memory.h.

References findQualityFiles::size.

Referenced by aligned_alloc64().

8  {
9  constexpr std::size_t mask = 64 - 1;
10  return size & mask ? (size & ~mask) + 64 : size;
11  }
size
Write out results.

Variable Documentation

◆ gSymOffsets

const idx_t Matriplex::gSymOffsets[7][36]
Initial value:
= {{},
{},
{0, 1, 1, 2},
{0, 1, 3, 1, 2, 4, 3, 4, 5},
{},
{},
{0, 1, 3, 6, 10, 15, 1, 2, 4, 7, 11, 16, 3, 4, 5, 8, 12, 17,
6, 7, 8, 9, 13, 18, 10, 11, 12, 13, 14, 19, 15, 16, 17, 18, 19, 20}}

Definition at line 13 of file MatriplexSym.h.

Referenced by Matriplex::MatriplexSym< float, LL, NN >::off(), and Matriplex::MatriplexSym< float, LL, NN >::offsets().