Skip to content

Commit c65f089

Browse files
committed
[hack_ihel] in gg_tt.sa MemoryAccessMatrixElements.h, rename "icomb" as "ihel" for consistency with the rest of the code
1 parent 982f0e9 commit c65f089

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

epochX/cudacpp/gg_tt.sa/SubProcesses/MemoryAccessMatrixElements.h

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace mg5amcCpu
4646
friend class KernelAccessHelper<MemoryAccessMatrixElementsBase, false>;
4747

4848
// The number of (good and bad) helicity combinations
49+
// Note that a typical loop over helicities uses ihel over ncomb values: "for( int ihel = 0; ihel < ncomb; ihel++ )"
4950
static constexpr int ncomb = CPPProcess::ncomb;
5051

5152
//--------------------------------------------------------------------------
@@ -61,22 +62,22 @@ namespace mg5amcCpu
6162
{
6263
const int ipagME = ievt / neppME; // #event "ME-page"
6364
const int ieppME = ievt % neppME; // #event in the current event ME-page
64-
constexpr int icomb = 0;
65-
return &( buffer[ipagME * ( ncomb + 1 ) * neppME + icomb * neppME + ieppME] ); // AOSOA[ipagME][icomb][ieppME]
65+
constexpr int ihel = 0;
66+
return &( buffer[ipagME * ( ncomb + 1 ) * neppME + ihel * neppME + ieppME] ); // AOSOA[ipagME][ihel][ieppME]
6667
}
6768

6869
//--------------------------------------------------------------------------
6970

7071
// Locate a field (output) of an event record (input) from the given field indexes (input)
7172
// [Signature (non-const) ===> fptype& decodeRecord( fptype* buffer, Ts... args ) <===]
72-
// [NB: expand variadic template "Ts... args" to "const int icomb" and rename "Field" as "Icomb"]
73+
// [NB: expand variadic template "Ts... args" to "const int ihel" and rename "Field" as "Ihel"]
7374
static __host__ __device__ inline fptype&
7475
decodeRecord( fptype* buffer,
75-
const int icomb )
76+
const int ihel )
7677
{
7778
constexpr int ipagME = 0;
7879
constexpr int ieppME = 0;
79-
return buffer[ipagME * ( ncomb + 1 ) * neppME + icomb * neppME + ieppME]; // AOSOA[ipagME][icomb][ieppME]
80+
return buffer[ipagME * ( ncomb + 1 ) * neppME + ihel * neppME + ieppME]; // AOSOA[ipagME][ihel][ieppME]
8081
}
8182
};
8283

@@ -97,22 +98,22 @@ namespace mg5amcCpu
9798
static constexpr auto ieventAccessRecordConst = MemoryAccessHelper<MemoryAccessMatrixElementsBase>::ieventAccessRecordConst;
9899

99100
// Locate a field (output) of an event record (input) from the given field indexes (input)
100-
// [Signature (non-const) ===> fptype& decodeRecord( fptype* buffer, const int icomb ) <===]
101-
static constexpr auto decodeRecordIcomb = MemoryAccessHelper<MemoryAccessMatrixElementsBase>::decodeRecord;
101+
// [Signature (non-const) ===> fptype& decodeRecord( fptype* buffer, const int ihel ) <===]
102+
static constexpr auto decodeRecordIhel = MemoryAccessHelper<MemoryAccessMatrixElementsBase>::decodeRecord;
102103

103104
// Locate a field (output) of an event record (input) from the given field indexes (input)
104-
// [Signature (const) ===> const fptype& decodeRecordConst( const fptype* buffer, const int icomb ) <===]
105-
static constexpr auto decodeRecordIcombConst =
105+
// [Signature (const) ===> const fptype& decodeRecordConst( const fptype* buffer, const int ihel ) <===]
106+
static constexpr auto decodeRecordIhelConst =
106107
MemoryAccessHelper<MemoryAccessMatrixElementsBase>::template decodeRecordConst<int>;
107108

108109
// Locate a field (output) in a memory buffer (input) from the given event number (input) and the given field indexes (input)
109-
// [Signature (non-const) ===> fptype& ieventAccess( fptype* buffer, const ievt, const icomb ) <===]
110-
static constexpr auto ieventAccessIcomb =
110+
// [Signature (non-const) ===> fptype& ieventAccess( fptype* buffer, const ievt, const ihel ) <===]
111+
static constexpr auto ieventAccessIhel =
111112
MemoryAccessHelper<MemoryAccessMatrixElementsBase>::template ieventAccessField<int>;
112113

113114
// Locate a field (output) in a memory buffer (input) from the given event number (input) and the given field indexes (input)
114-
// [Signature (const) ===> const fptype& ieventAccessConst( const fptype* buffer, const ievt, const icomb ) <===]
115-
static constexpr auto ieventAccessIcombConst =
115+
// [Signature (const) ===> const fptype& ieventAccessConst( const fptype* buffer, const ievt, const ihel ) <===]
116+
static constexpr auto ieventAccessIhelConst =
116117
MemoryAccessHelper<MemoryAccessMatrixElementsBase>::template ieventAccessFieldConst<int>;
117118
};
118119

@@ -129,16 +130,16 @@ namespace mg5amcCpu
129130
static constexpr auto ieventAccessRecord = MemoryAccessMatrixElements::ieventAccessRecord;
130131

131132
// Locate a field (output) in a memory buffer (input) from a kernel event-indexing mechanism (internal) and the given field indexes (input)
132-
// [Signature (non-const, SCALAR) ===> fptype& kernelAccess_s( fptype* buffer, const int icomb ) <===]
133-
static constexpr auto kernelAccessIcomb_s =
133+
// [Signature (non-const, SCALAR) ===> fptype& kernelAccess_s( fptype* buffer, const int ihel ) <===]
134+
static constexpr auto kernelAccessIhel_s =
134135
KernelAccessHelper<MemoryAccessMatrixElementsBase, onDevice>::template kernelAccessField<int>; // requires cuda 11.4
135136

136137
// Locate a field (output) in a memory buffer (input) from a kernel event-indexing mechanism (internal)
137-
// [Signature (non const, SCALAR OR VECTOR) ===> fptype_sv& kernelAccess( const fptype* buffer, const int icomb ) <===]
138+
// [Signature (non const, SCALAR OR VECTOR) ===> fptype_sv& kernelAccess( const fptype* buffer, const int ihel ) <===]
138139
static __host__ __device__ inline fptype_sv&
139-
kernelAccessIcomb( fptype* buffer )
140+
kernelAccessIhel( fptype* buffer )
140141
{
141-
fptype& out = kernelAccessIcomb_s( buffer );
142+
fptype& out = kernelAccessIhel_s( buffer );
142143
#ifndef MGONGPU_CPPSIMD
143144
return out;
144145
#else
@@ -150,8 +151,8 @@ namespace mg5amcCpu
150151
}
151152

152153
// Locate a field (output) in a memory buffer (input) from a kernel event-indexing mechanism (internal) and the given field indexes (input)
153-
// [Signature (const) ===> const fptype& kernelAccessConst( const fptype* buffer, const int icomb ) <===]
154-
static constexpr auto kernelAccessIcombConst =
154+
// [Signature (const) ===> const fptype& kernelAccessConst( const fptype* buffer, const int ihel ) <===]
155+
static constexpr auto kernelAccessIhelConst =
155156
KernelAccessHelper<MemoryAccessMatrixElementsBase, onDevice>::template kernelAccessFieldConst<int>; // requires cuda 11.4
156157
};
157158

0 commit comments

Comments
 (0)