[gmx-developers] GPU kernel code

Mahmood Naderan nt_mahmood at yahoo.com
Thu Apr 25 14:43:02 CEST 2019


> Selection happens at runtime, see in nbnxn_cuda.cu:select_nbnxn_kernel().
Yes I see that.



> Try "git grep LJComb".
I am trying to find that in 2018.2 release that I have currently.
mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$ grep -i LJ_Comb nbnxn_cuda_kernel.cuh
#if defined LJ_COMB_GEOM || defined LJ_COMB_LB
#define LJ_COMB
#ifndef LJ_COMB
    const float2       *lj_comb     = atdat.lj_comb;
#ifndef LJ_COMB
#if !defined LJ_COMB_LB || defined CALC_ENERGIES
#ifdef LJ_COMB_LB
#ifndef LJ_COMB
#ifndef LJ_COMB
        ljcpib[tidxj * c_clSize + tidxi] = lj_comb[ai];
#ifndef LJ_COMB
                    ljcp_j  = lj_comb[aj];
#ifndef LJ_COMB
#ifdef LJ_COMB_GEOM
#endif                          /* LJ_COMB_GEOM */
#endif                          /* LJ_COMB */
#if !defined LJ_COMB_LB || defined CALC_ENERGIES
#else                           /* !LJ_COMB_LB || CALC_ENERGIES */
#endif                          /* !LJ_COMB_LB || CALC_ENERGIES */
#undef LJ_COMB
mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$ grep -i LJComb nbnxn_cuda_kernel.cuh
mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$



I expect that VdwLJCombLB_F means that the statements that must be executed in nbnxn_cuda_kernel.cuh, are those that are used in defined macros.
For example, since I see Vdw, the following code must be executed
#ifdef VDW_CUTOFF_CHECK
                                /* Separate VDW cut-off check to enable twin-range cut-offs
                                 * (rvdw < rcoulomb <= rlist)
                                 */
                                vdw_in_range  = (r2 < rvdw_sq) ? 1.0f : 0.0f;
                                F_invr       *= vdw_in_range;



Also, since LJCombLB is seen, the following code must be executed


#else                           /* !LJ_COMB_LB || CALC_ENERGIES */
                                float sig_r  = sigma*inv_r;
                                float sig_r2 = sig_r*sig_r;
                                float sig_r6 = sig_r2*sig_r2*sig_r2;




And so on...
Please let me know if I still haven't understand that.


Regards,
Mahmood 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20190425/f37407f3/attachment-0001.html>


More information about the gromacs.org_gmx-developers mailing list