Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4ed001c
[heft] add heft_gg_h to repo, copied as-is from heft_gg_h.auto genera…
valassi May 6, 2022
9e928a8
[heft] remove CODEGEN_cudacpp_heft_gg_h_log.txt to make it clearer th…
valassi May 6, 2022
ddd4e1a
[heft] fix src/Makefile in older generated code (replace _sm by _heft…
valassi May 6, 2022
6c8b955
[heft] add -heftggh option to the tput scripts
valassi May 6, 2022
a35ebf1
[heft] add double/hrd0 lohs for heftggh, all looks ok - NB however fl…
valassi May 6, 2022
dafe2af
[heft] fix "make FPTYPE=f AVX=none" build for heftggh (add float * cx…
valassi May 6, 2022
048918f
[heft] add log for heftggh testst with float/hrd0, now all ok
valassi May 6, 2022
7514447
[heft] use a constexpr implementation of pow
valassi May 6, 2022
f0cf4a7
[heft] rename sqrtNR as constexpr_sqrt to be consistent with constexp…
valassi May 6, 2022
b853749
[heft] backport to codegen the changes in constexpr_pow and constexpr…
valassi May 6, 2022
6a2df46
[heft] more useful version of constexpr_pow, taking a floating point …
valassi May 6, 2022
5e42556
[heft] backport improved constexpr_pow(double,double) to codegen
valassi May 6, 2022
26f7884
[heft] backport to codegen also the missing operator*
valassi May 6, 2022
4bb80a2
[heft] TMP move codegen back to c0c2768
valassi May 6, 2022
ed65cda
[heft] TMP move over codegen c0c2768 the three recent backports
valassi May 6, 2022
605dcc6
[heft] revert the two TMP changes (I was just checking that codegen w…
valassi May 6, 2022
86f0716
[heft] regenerate heftggh with the latest codegen and move it from au…
valassi May 6, 2022
54b8e27
[heft] move Parameters_heft_[in]dependentCouplings and G2COUP to the …
valassi May 6, 2022
3b0b288
[heft] add 'using namespace Parameters_heft;' for HRDCOD=1: finally f…
valassi May 6, 2022
4bec566
[heft] backport to codegen the (partial, HRDCOD=1 only) fix for #439
valassi May 6, 2022
8d59000
[heft] regenerate all 5 processes auto and resync manual
valassi May 6, 2022
d6319bb
[heft] regenerate also eemumu.mad ggtt.mad and ggtt.madonly
valassi May 6, 2022
814cbf3
[heft] fix the operator* for mixing double and float (eemumu FPTYPE=f…
valassi May 6, 2022
df54cc3
[heft] backport to codegen the fix in operator*
valassi May 6, 2022
e8c79ce
[heft] regenerate eemumu.mad ggtt.mad and ggtt.madonly
valassi May 6, 2022
caf3e29
[heft] port fix in operator* to heftggh
valassi May 6, 2022
1440bf8
[heft] regenerate 5 processes auto and resync manual
valassi May 6, 2022
dee0a2d
[heft] add a comment about the build error in make HRDCOD=1 FPTYPE=f
valassi May 7, 2022
ff701d5
[heft] try to overload the operator fptype_v operator*( const fptype_…
valassi May 7, 2022
6e97c98
[heft] revert the attempt to overload operator* (fptype_sv is NOT a u…
valassi May 7, 2022
625a31c
[heft] try to bypass scalar double to vector float conversion issue w…
valassi May 7, 2022
cf0ca34
[heft] finally fix the build error in make HRDCOD=1 FPTYPE=f
valassi May 7, 2022
0e1dd2d
[heft] rerun heftggh d/f hrd0/hrd1 with code as of 6a2df46b5eb5e0c6a3…
valassi May 7, 2022
b74e5e7
[heft] rerun heftggh with d/f hrd1 (hrd0 fails the build #439) - ok b…
valassi May 7, 2022
fa83f42
[heft] improve(?) the heft vactor/float patch, keep SIMD for vectro d…
valassi May 7, 2022
672a832
[heft] rerun heftggh flat/hrd1, all looks ok (better perf or not even…
valassi May 7, 2022
1108922
[heft] further improve the heft vactor/float patch, keep SIMD for vec…
valassi May 8, 2022
b2900cf
[heft] rerun heftggh flat/hrd1, all looks ok (but performance is agai…
valassi May 8, 2022
b1f47ae
[heft] partial backport to codegen - missing the float vector part
valassi May 8, 2022
a2e98d3
[heft] partial backport to codegen of the float vector part
valassi May 8, 2022
8d83449
[heft] complete backport to codegen of the float vector part
valassi May 9, 2022
74866d2
[heft] regenerate 5 processes auto and resync manu with special float…
valassi May 9, 2022
99fee3f
[heft] improve handling of empty spaces in dcoupsetdpar codegen (more…
valassi May 9, 2022
840bf13
[heft] improve handling of empty spaces in dcoupsetdcoup codegen (mor…
valassi May 9, 2022
b0d7bbe
[heft] regenerate 5 processes auto and resync manu with improved spec…
valassi May 9, 2022
82aacc2
[heft] rerun heftggh flat/hrd1, all looks ok (but performance is agai…
valassi May 9, 2022
cdfd34b
[heft] Improve codegen #439: restrict special handling of float vecto…
valassi May 9, 2022
d52961d
[heft] regenerate heftggh auto and resync to manual (code unchanged, …
valassi May 9, 2022
09a0cb7
[heft] regenerate 5 processes auto and resync manu (remove special fl…
valassi May 9, 2022
12c0f08
[heft] rerun heftggh flat/hrd1, all looks ok (but performance is agai…
valassi May 9, 2022
dd24ecd
[heft] add a -short option to allTees.sh
valassi May 9, 2022
c47a773
[heft] minor fix in a tput script (fix a printout)
valassi May 9, 2022
618b5bf
[heft] fix codegen, remove hardcoded _heft
valassi May 9, 2022
7b30aaa
[heft] regenerate 5 processes auto and resync manu (remove hardcoded …
valassi May 9, 2022
982c4dd
[heft] rerun 4 processes - all seems ok
valassi May 9, 2022
d073d7f
[heft] minor imprvements in tput allTees script
valassi May 9, 2022
4dac791
[heft] add an extra error for non-SM processes
valassi May 9, 2022
2d507ef
[heft] in codegen add an error in EFT unless HRDCOD=1 is used
valassi May 9, 2022
c57ec48
[heft] remove 'FIXME' comment about mdl_complexi and clean up the code
valassi May 9, 2022
2ddc2d0
[heft] backport to codegen of Parameters.cc
valassi May 9, 2022
6c732c7
[heft] cosmetics in codegen
valassi May 9, 2022
3f337ec
[heft] backport to codegen of Parameters.h with mdl_complexi changes
valassi May 9, 2022
09b7f53
[heft] regenerate 5 processes auto and resync manu (fix mdl_complexi)
valassi May 9, 2022
bd55f84
[heft] fix eemumu manual (go back to old mdl_complexi in many respects)
valassi May 9, 2022
28cc805
[heft] fix codegen and eemumu auto/manu for Parameters_sm.h
valassi May 9, 2022
d38ca9e
[heft] fix codegen and eemumu auto for Parameters_sm.cc
valassi May 9, 2022
579c6a9
[heft] regenerate heftggh auto and move it to manual
valassi May 9, 2022
f752450
[heft] rerun heftggh flat/hrd1, all looks ok (performance fluctuates …
valassi May 9, 2022
205c0c7
[heft] regenerate 5 processes auto and resync manu (finally? fix mdl_…
valassi May 9, 2022
5efffda
[heft] regenerate also eemumu.mad ggtt.mad and ggtt.madonly
valassi May 9, 2022
03b593b
[heft] rerun ggtt d/f hrd0/1, all seems ok
valassi May 9, 2022
23c5199
[heft] rerun the full logs of allTees.sh for the main 5 processes - a…
valassi May 9, 2022
8a44ede
[heft] cleanup: remove tput/logs_ggttg_manu/log_ggttg_manu_*_inl1_* l…
valassi May 9, 2022
c112e7d
[heft] ** COMPLETE HEFT ** cleanup: remove hrd0 logs for heftggh (as …
valassi May 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,74 +13,7 @@

//==========================================================================

namespace Parameters_%(model_name)s_dependentCouplings
{
constexpr size_t ndcoup = %(ndcoup)d; // #couplings that vary event by event because they depend on the running alphas QCD
%(idcoup)s
struct DependentCouplings_sv
{
%(dcoupdecl)s
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable" // e.g. <<warning: unused variable ‘mdl_G__exp__2’ [-Wunused-variable]>>
#pragma GCC diagnostic ignored "-Wunused-parameter" // e.g. <<warning: unused parameter ‘G’ [-Wunused-parameter]>>
#ifdef __CUDACC__
#pragma nv_diagnostic push
#pragma nv_diag_suppress 177 // e.g. <<warning #177-D: variable "mdl_G__exp__2" was declared but never referenced>>
#endif
__host__ __device__ inline const DependentCouplings_sv computeDependentCouplings_fromG( const fptype_sv& G )
{
// Model parameters dependent on aS
%(dcoupsetdpar)s
// Model couplings dependent on aS
DependentCouplings_sv out;
%(dcoupsetdcoup)s
return out;
}
#ifdef __CUDACC__
#pragma GCC diagnostic pop
#pragma nv_diagnostic pop
#endif
}

//==========================================================================

namespace Parameters_%(model_name)s_independentCouplings
{
constexpr size_t nicoup = %(nicoup)d; // #couplings that are fixed for all events because they do not depend on the running alphas QCD
%(iicoup)s
}

//==========================================================================

#ifdef __CUDACC__
namespace mg5amcGpu
#else
namespace mg5amcCpu
#endif
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable" // e.g. <<warning: variable ‘couplings_sv’ set but not used [-Wunused-but-set-variable]>>
// Compute the output couplings (e.g. gc10 and gc11) from the input gs
template<class G_ACCESS, class C_ACCESS>
__device__ inline void
G2COUP( const fptype gs[],
fptype couplings[] )
{
mgDebug( 0, __FUNCTION__ );
using namespace Parameters_%(model_name)s_dependentCouplings;
const fptype_sv& gs_sv = G_ACCESS::kernelAccessConst( gs );
DependentCouplings_sv couplings_sv = computeDependentCouplings_fromG( gs_sv );
%(dcoupaccessbuffer)s%(dcoupkernelaccess)s%(dcoupcompute)s
mgDebug( 1, __FUNCTION__ );
return;
}
#pragma GCC diagnostic pop
}

//==========================================================================

#ifndef MGONGPU_HARDCODE_PARAM
#ifndef MGONGPU_HARDCODE_PARAM // this is only supported in SM processes (e.g. not in EFT models) for the moment (#439)%(efterror)s

#include "read_slha.h"

Expand Down Expand Up @@ -132,23 +65,43 @@ private:

#else

#include <cassert>
#include <limits>

// Hardcoded constexpr physics parameters
namespace Parameters_%(model_name)s // keep the same name rather than HardcodedParameters_%(model_name)s for simplicity
{
// Constexpr implementation of sqrt (see https://stackoverflow.com/a/34134071)
double constexpr detailSqrtNewtonRaphson( double x, double curr, double prev )
double constexpr sqrtNewtonRaphson( double x, double curr, double prev )
{
return curr == prev ? curr : detailSqrtNewtonRaphson( x, 0.5 * ( curr + x / curr ), curr );
return curr == prev ? curr : sqrtNewtonRaphson( x, 0.5 * ( curr + x / curr ), curr );
}
double constexpr sqrtNR( double x )
double constexpr constexpr_sqrt( double x )
{
return x >= 0 // && x < std::numeric_limits<double>::infinity() // avoid -Wtautological-constant-compare warning in fast math
? detailSqrtNewtonRaphson( x, x, 0 )
? sqrtNewtonRaphson( x, x, 0 )
: std::numeric_limits<double>::quiet_NaN();
}

// Constexpr implementation of floor (see https://stackoverflow.com/a/66146159)
constexpr int constexpr_floor( double d )
{
const int i = static_cast<int>( d );
return d < i ? i - 1 : i;
}

// Constexpr implementation of pow
constexpr double constexpr_pow( double base, double exp )
{
// NB(1): this implementation of constexpr_pow requires exponent >= 0
assert( exp >= 0 ); // NB would fail at compile time with "error: call to non-‘constexpr’ function ‘void __assert_fail'"
// NB(2): this implementation of constexpr_pow requires an integer exponent
const int iexp = constexpr_floor( exp );
assert( static_cast<double>( iexp ) == exp ); // NB would fail at compile time with "error: call to non-‘constexpr’ function ‘void __assert_fail'"
// Iterative implementation of pow if exp is a non negative integer
return iexp == 0 ? 1 : base * constexpr_pow( base, iexp - 1 );
}

// Model parameters independent of aS
constexpr double zero = 0;
constexpr double ZERO = 0;
Expand Down Expand Up @@ -176,4 +129,82 @@ namespace Parameters_%(model_name)s // keep the same name rather than HardcodedP

//==========================================================================

namespace Parameters_%(model_name)s_dependentCouplings
{
constexpr size_t ndcoup = %(ndcoup)d; // #couplings that vary event by event because they depend on the running alphas QCD
%(idcoup)s
struct DependentCouplings_sv
{
%(dcoupdecl)s
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable" // e.g. <<warning: unused variable ‘mdl_G__exp__2’ [-Wunused-variable]>>
#pragma GCC diagnostic ignored "-Wunused-parameter" // e.g. <<warning: unused parameter ‘G’ [-Wunused-parameter]>>
#ifdef __CUDACC__
#pragma nv_diagnostic push
#pragma nv_diag_suppress 177 // e.g. <<warning #177-D: variable "mdl_G__exp__2" was declared but never referenced>>
#endif
__host__ __device__ inline const DependentCouplings_sv computeDependentCouplings_fromG( const fptype_sv& G_sv )
{
#ifdef MGONGPU_HARDCODE_PARAM
using namespace Parameters_%(model_name)s;
#endif
// NB: hardcode cxtype cI(0,1) instead of cxtype (or hardcoded cxsmpl) mdl_complexi (which exists in Parameters_%(model_name)s) because:
// (1) mdl_complexi is always (0,1); (2) mdl_complexi is undefined in device code; (3) need cxsmpl conversion to cxtype in code below
const cxtype cI( 0., 1. );
DependentCouplings_sv out;
%(eftspecial1)s
{
const fptype_sv& G = G_sv;
// Model parameters dependent on aS
%(dcoupsetdpar)s
// Model couplings dependent on aS
%(dcoupsetdcoup)s
}
%(eftspecial2)s
return out;
}
#ifdef __CUDACC__
#pragma GCC diagnostic pop
#pragma nv_diagnostic pop
#endif
}

//==========================================================================

namespace Parameters_%(model_name)s_independentCouplings
{
constexpr size_t nicoup = %(nicoup)d; // #couplings that are fixed for all events because they do not depend on the running alphas QCD
%(iicoup)s
}

//==========================================================================

#ifdef __CUDACC__
namespace mg5amcGpu
#else
namespace mg5amcCpu
#endif
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable" // e.g. <<warning: variable ‘couplings_sv’ set but not used [-Wunused-but-set-variable]>>
// Compute the output couplings (e.g. gc10 and gc11) from the input gs
template<class G_ACCESS, class C_ACCESS>
__device__ inline void
G2COUP( const fptype gs[],
fptype couplings[] )
{
mgDebug( 0, __FUNCTION__ );
using namespace Parameters_%(model_name)s_dependentCouplings;
const fptype_sv& gs_sv = G_ACCESS::kernelAccessConst( gs );
DependentCouplings_sv couplings_sv = computeDependentCouplings_fromG( gs_sv );
%(dcoupaccessbuffer)s%(dcoupkernelaccess)s%(dcoupcompute)s
mgDebug( 1, __FUNCTION__ );
return;
}
#pragma GCC diagnostic pop
}

//==========================================================================

#endif // Parameters_%(model_name)s_H
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ operator*( const FP& a, const cxsmpl<FP>& b )
return cxsmpl<FP>( a, 0 ) * b;
}

inline __host__ __device__ constexpr cxsmpl<float>
operator*( const double& a, const cxsmpl<float>& b )
{
return cxsmpl<float>( a, 0 ) * b;
}

template<typename FP>
inline __host__ __device__ constexpr cxsmpl<FP>
operator/( const cxsmpl<FP>& a, const cxsmpl<FP>& b )
Expand Down
Loading