madgraph5 / madgraph4gpu

GPU development for the Madgraph5_aMC@NLO event generator software package
29 stars 33 forks source link

Improve documentation of memory accessors in the code #812

Closed valassi closed 5 months ago

valassi commented 5 months ago

Just a reminder from @oliviermattelaer ' s suggestion in https://github.com/madgraph5/madgraph4gpu/issues/765#issuecomment-1854069615

      if( channelId == 1 ) numerators_sv += cxabs2( amp_sv[0] );
      if( channelId != 0 ) denominators_sv += cxabs2( amp_sv[0] );
into something like

      channelids_sv = CHANNEL_ACCESS::kernelAccess( pchannelIds ); // the 4 channels in the SIMD vector
      bool_sv mask_sv = ( channelids_sv == 1 );
      numerators_sv += mask_sv * cxabs2( amp_sv[0] );
      if( pchannelIds != nullptr ) denominators_sv += cxabs2( amp_sv[0] );

Please put comment around those lines since you pass from an easy to read code to a code that I simply do not understand (which I'm fine with obviously but I would be nice to keep readibility whenever you have those cryptic accessor.

roiser commented 5 months ago

this is already implemented in the channelids code