Skip to content

Commit b39e508

Browse files
committed
for the CPU version correct the index access, GPU version still needs to
be done
1 parent 62c204a commit b39e508

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/process_sigmaKin_function.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
fptype_sv& MEs_sv = E_ACCESS::kernelAccess( MEs );
2727
MEs_sv = fptype_sv{ 0 };
2828
#ifdef MGONGPU_SUPPORTS_MULTICHANNEL
29-
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 );
29+
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 * %(ndiagrams)d );
3030
fptype* denominators = DEN_ACCESS::ieventAccessRecord( allDenominators, ievt0 );
3131
fptype_sv* numerators_sv = NUM_ACCESS::kernelAccessP( numerators );
3232
fptype_sv& denominators_sv = DEN_ACCESS::kernelAccess( denominators );
@@ -333,7 +333,7 @@
333333
if( allChannelIds != nullptr ) // fix segfault #892 (not 'channelIds[0] != 0')
334334
{
335335
const unsigned int channelId = getChannelId( allChannelIds, ievt0, false );
336-
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 );
336+
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 * %(ndiagrams)d );
337337
fptype* denominators = DEN_ACCESS::ieventAccessRecord( allDenominators, ievt0 );
338338
fptype_sv* numerators_sv = NUM_ACCESS::kernelAccessP( numerators );
339339
fptype_sv& denominators_sv = DEN_ACCESS::kernelAccess( denominators );

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,7 @@ def super_get_matrix_element_calls(self, matrix_element, color_amplitudes, multi
18821882
###misc.sprint(multi_channel_map)
18831883
res = []
18841884
###res.append('for(int i=0;i<%s;i++){jamp[i] = cxtype(0.,0.);}' % len(color_amplitudes))
1885+
ndiagrams = len(me)
18851886
res.append("""//constexpr size_t nxcoup = ndcoup + nicoup; // both dependent and independent couplings (BUG #823)
18861887
constexpr size_t nxcoup = ndcoup + nIPC; // both dependent and independent couplings (FIX #823)
18871888
const fptype* allCOUPs[nxcoup];
@@ -1918,7 +1919,7 @@ def super_get_matrix_element_calls(self, matrix_element, color_amplitudes, multi
19181919
COUPs[ndcoup + iicoup] = allCOUPs[ndcoup + iicoup]; // independent couplings, fixed for all events
19191920
fptype* MEs = E_ACCESS::ieventAccessRecord( allMEs, ievt0 );
19201921
#ifdef MGONGPU_SUPPORTS_MULTICHANNEL
1921-
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 );
1922+
fptype* numerators = NUM_ACCESS::ieventAccessRecord( allNumerators, ievt0 * %d );
19221923
fptype* denominators = DEN_ACCESS::ieventAccessRecord( allDenominators, ievt0 );
19231924
#endif
19241925
#endif
@@ -1930,7 +1931,7 @@ def super_get_matrix_element_calls(self, matrix_element, color_amplitudes, multi
19301931
// Numerators and denominators for the current event (CUDA) or SIMD event page (C++)
19311932
fptype_sv* numerators_sv = NUM_ACCESS::kernelAccessP( numerators );
19321933
fptype_sv& denominators_sv = DEN_ACCESS::kernelAccess( denominators );
1933-
#endif""")
1934+
#endif""" % ndiagrams)
19341935
diagrams = matrix_element.get('diagrams')
19351936
diag_to_config = {}
19361937
if multi_channel_map:

0 commit comments

Comments
 (0)