2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2012, The GROMACS development team.
6 * Copyright (c) 2012,2013, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
38 #ifndef NBNXN_CUDA_DATA_MGMT_H
39 #define NBNXN_CUDA_DATA_MGMT_H
41 #include "types/simple.h"
42 #include "types/interaction_const.h"
43 #include "types/nbnxn_cuda_types_ext.h"
44 #include "types/hw_info.h"
48 #define FUNC_QUALIFIER
51 #define FUNC_QUALIFIER static
58 /*! Initializes the data structures related to CUDA nonbonded calculations. */
60 void nbnxn_cuda_init(FILE gmx_unused *fplog,
61 nbnxn_cuda_ptr_t gmx_unused *p_cu_nb,
62 const gmx_gpu_info_t gmx_unused *gpu_info,
63 const gmx_gpu_opt_t gmx_unused *gpu_opt,
64 int gmx_unused my_gpu_index,
65 /* true of both local and non-local are don on GPU */
66 gmx_bool gmx_unused bLocalAndNonlocal) FUNC_TERM
68 /*! Initializes simulation constant data. */
70 void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t gmx_unused cu_nb,
71 const interaction_const_t gmx_unused *ic,
72 const nonbonded_verlet_group_t gmx_unused *nbv_group) FUNC_TERM
74 /*! Initializes pair-list data for GPU, called at every pair search step. */
76 void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t gmx_unused cu_nb,
77 const nbnxn_pairlist_t gmx_unused *h_nblist,
78 int gmx_unused iloc) FUNC_TERM
80 /*! Initializes atom-data on the GPU, called at every pair search step. */
82 void nbnxn_cuda_init_atomdata(nbnxn_cuda_ptr_t gmx_unused cu_nb,
83 const nbnxn_atomdata_t gmx_unused *atomdata) FUNC_TERM
85 /*! \brief Update parameters during PP-PME load balancing. */
87 void nbnxn_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t gmx_unused cu_nb,
88 const interaction_const_t gmx_unused *ic) FUNC_TERM
90 /*! Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
92 void nbnxn_cuda_upload_shiftvec(nbnxn_cuda_ptr_t gmx_unused cu_nb,
93 const nbnxn_atomdata_t gmx_unused *nbatom) FUNC_TERM
95 /*! Clears GPU outputs: nonbonded force, shift force and energy. */
97 void nbnxn_cuda_clear_outputs(nbnxn_cuda_ptr_t gmx_unused cu_nb,
98 int gmx_unused flags) FUNC_TERM
100 /*! Frees all GPU resources used for the nonbonded calculations. */
102 void nbnxn_cuda_free(nbnxn_cuda_ptr_t gmx_unused cu_nb) FUNC_TERM
104 /*! Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
106 wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb)
115 /*! Resets nonbonded GPU timings. */
117 void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb) FUNC_TERM
119 /*! Calculates the minimum size of proximity lists to improve SM load balance
120 with CUDA non-bonded kernels. */
122 int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t gmx_unused cu_nb)
131 /*! Returns if analytical Ewald CUDA kernels are used. */
133 gmx_bool nbnxn_cuda_is_kernel_ewald_analytical(const nbnxn_cuda_ptr_t gmx_unused cu_nb)
147 #undef FUNC_QUALIFIER
149 #endif /* NBNXN_CUDA_DATA_MGMT_H */