Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
nbnxm_ocl_data_mgmt.cpp File Reference
#include "gmxpre.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include "nbnxm_ocl_types.h"
#include "gromacs/gpu_utils/gpu_utils.h"
#include "gromacs/gpu_utils/oclutils.h"
#include "gromacs/hardware/gpu_hw_info.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/mdlib/force_flags.h"
#include "gromacs/mdtypes/interaction_const.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/nbnxm/atomdata.h"
#include "gromacs/nbnxm/gpu_data_mgmt.h"
#include "gromacs/nbnxm/gpu_jit_support.h"
#include "gromacs/nbnxm/nbnxm.h"
#include "gromacs/nbnxm/nbnxm_gpu.h"
#include "gromacs/nbnxm/pairlistsets.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/timing/gpu_timing.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/real.h"
#include "gromacs/utility/smalloc.h"
#include "nbnxm_ocl_internal.h"
+ Include dependency graph for nbnxm_ocl_data_mgmt.cpp:

Description

Define OpenCL implementation of nbnxm_gpu_data_mgmt.h.

Author
Anca Hamuraru anca@.nosp@m.stre.nosp@m.amcom.nosp@m.puti.nosp@m.ng.eu
Dimitrios Karkoulis dimit.nosp@m.ris..nosp@m.karko.nosp@m.ulis.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Teemu Virolainen teemu.nosp@m.@str.nosp@m.eamco.nosp@m.mput.nosp@m.ing.e.nosp@m.u
Szilárd Páll pall..nosp@m.szil.nosp@m.ard@g.nosp@m.mail.nosp@m..com

Macros

#define CL_CONTEXT_SHOW_DIAGNOSTICS_INTEL   0x4106
 Copies of values from cl_driver_diagnostics_intel.h, which isn't guaranteed to be available.
 
#define CL_CONTEXT_DIAGNOSTICS_LEVEL_GOOD_INTEL   0x1
 
#define CL_CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL   0x2
 
#define CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL   0x4
 

Functions

bool Nbnxm::useLjCombRule (int vdwType)
 Returns true if LJ combination rules are used in the non-bonded kernels. More...
 
static void Nbnxm::init_ewald_coulomb_force_table (const EwaldCorrectionTables &tables, cl_nbparam_t *nbp, const gmx_device_runtime_data_t *runData)
 Tabulates the Ewald Coulomb force and initializes the size/scale and the table GPU array. More...
 
static void Nbnxm::init_atomdata_first (cl_atomdata_t *ad, int ntypes, gmx_device_runtime_data_t *runData)
 Initializes the atomdata structure first time, it only gets filled at pair-search.
 
static void Nbnxm::set_cutoff_parameters (cl_nbparam_t *nbp, const interaction_const_t *ic, const PairlistParams &listParams)
 Copies all parameters related to the cut-off from ic to nbp.
 
static void Nbnxm::map_interaction_types_to_gpu_kernel_flavors (const interaction_const_t *ic, int combRule, int *gpu_eeltype, int *gpu_vdwtype)
 Returns the kinds of electrostatics and Vdw OpenCL kernels that will be used. More...
 
static void Nbnxm::init_nbparam (cl_nbparam_t *nbp, const interaction_const_t *ic, const PairlistParams &listParams, const nbnxn_atomdata_t::Params &nbatParams, const gmx_device_runtime_data_t *runData)
 Initializes the nonbonded parameter data structure.
 
void Nbnxm::gpu_pme_loadbal_update_param (const nonbonded_verlet_t *nbv, const interaction_const_t *ic)
 This function is documented in the header file.
 
static void Nbnxm::init_plist (cl_plist_t *pl)
 Initializes the pair list data structure.
 
static void Nbnxm::init_timings (gmx_wallclock_gpu_nbnxn_t *t)
 Initializes the timings data structure.
 
static void CL_CALLBACK Nbnxm::ocl_notify_fn (const char *pErrInfo, const void *private_info, size_t cb, void *user_data)
 OpenCL notification callback function.
 
static void Nbnxm::nbnxn_gpu_create_context (gmx_device_runtime_data_t *runtimeData, const gmx_device_info_t *devInfo, int rank)
 Creates context for OpenCL GPU given by mygpu. More...
 
static cl_kernel Nbnxm::nbnxn_gpu_create_kernel (gmx_nbnxn_ocl_t *nb, const char *kernel_name)
 Initializes the OpenCL kernel pointers of the nbnxn_ocl_ptr_t input data structure.
 
static void Nbnxm::nbnxn_ocl_clear_e_fshift (gmx_nbnxn_ocl_t *nb)
 Clears nonbonded shift force output array and energy outputs on the GPU.
 
static void Nbnxm::nbnxn_gpu_init_kernels (gmx_nbnxn_ocl_t *nb)
 Initializes the OpenCL kernel pointers of the nbnxn_ocl_ptr_t input data structure.
 
static void Nbnxm::nbnxn_ocl_init_const (gmx_nbnxn_ocl_t *nb, const interaction_const_t *ic, const PairlistParams &listParams, const nbnxn_atomdata_t::Params &nbatParams)
 Initializes simulation constant data. More...
 
gmx_nbnxn_gpu_t * Nbnxm::gpu_init (const gmx_device_info_t *deviceInfo, const interaction_const_t *ic, const PairlistParams &listParams, const nbnxn_atomdata_t *nbat, int rank, gmx_bool bLocalAndNonlocal)
 Initializes the data structures related to GPU nonbonded calculations. More...
 
static void Nbnxm::nbnxn_ocl_clear_f (gmx_nbnxn_ocl_t *nb, int natoms_clear)
 Clears the first natoms_clear elements of the GPU nonbonded force output array.
 
void Nbnxm::gpu_clear_outputs (gmx_nbnxn_ocl_t *nb, bool computeVirial)
 This function is documented in the header file.
 
void Nbnxm::gpu_init_pairlist (gmx_nbnxn_ocl_t *nb, const NbnxnPairlistGpu *h_plist, const InteractionLocality iloc)
 This function is documented in the header file.
 
void Nbnxm::gpu_upload_shiftvec (gmx_nbnxn_ocl_t *nb, const nbnxn_atomdata_t *nbatom)
 This function is documented in the header file.
 
void Nbnxm::gpu_init_atomdata (gmx_nbnxn_ocl_t *nb, const nbnxn_atomdata_t *nbat)
 This function is documented in the header file.
 
static void Nbnxm::free_kernel (cl_kernel *kernel_ptr)
 Releases an OpenCL kernel pointer.
 
static void Nbnxm::free_kernels (cl_kernel *kernels, int count)
 Releases a list of OpenCL kernel pointers.
 
static void Nbnxm::free_gpu_device_runtime_data (gmx_device_runtime_data_t *runData)
 Free the OpenCL runtime data (context and program). More...
 
void Nbnxm::gpu_free (gmx_nbnxn_ocl_t *nb)
 This function is documented in the header file.
 
gmx_wallclock_gpu_nbnxn_tNbnxm::gpu_get_timings (gmx_nbnxn_ocl_t *nb)
 This function is documented in the header file.
 
void Nbnxm::gpu_reset_timings (struct nonbonded_verlet_t *nbv)
 Resets nonbonded GPU timings. More...
 
int Nbnxm::gpu_min_ci_balanced (gmx_nbnxn_ocl_t *nb)
 This function is documented in the header file.
 
gmx_bool Nbnxm::gpu_is_kernel_ewald_analytical (const gmx_nbnxn_ocl_t *nb)
 This function is documented in the header file.
 

Variables

static unsigned int Nbnxm::gpu_min_ci_balanced_factor = 50
 This parameter should be determined heuristically from the kernel execution times. More...