Move main.*, splitter.*, gmx_omp_nthreads.* to mdlib
[gromacs.git] / src / gromacs / mdlib / nbnxn_gpu.h
blob318824de45ca1e19ead172e60d3241e795f9c445
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 /*! \internal \file
36 * \brief Declare interface for GPU execution for NBNXN module
38 * \author Szilard Pall <pall.szilard@gmail.com>
39 * \author Mark Abraham <mark.j.abraham@gmail.com>
40 * \ingroup module_mdlib
43 #ifndef GMX_MDLIB_NBNXN_GPU_H
44 #define GMX_MDLIB_NBNXN_GPU_H
46 #include "gromacs/gpu_utils/gpu_macros.h"
47 #include "gromacs/math/vectypes.h"
48 #include "gromacs/mdlib/nbnxn_gpu_types.h"
49 #include "gromacs/utility/basedefinitions.h"
50 #include "gromacs/utility/real.h"
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 struct nbnxn_atomdata_t;
58 /*! \brief
59 * Launch asynchronously the nonbonded force calculations.
61 * This consists of the following (async) steps launched:
62 * - upload x and q;
63 * - upload shift vector;
64 * - launch kernel;
65 * The local and non-local interaction calculations are launched in two
66 * separate streams.
68 GPU_FUNC_QUALIFIER
69 void nbnxn_gpu_launch_kernel(gmx_nbnxn_gpu_t gmx_unused *nb,
70 const struct nbnxn_atomdata_t gmx_unused *nbdata,
71 int gmx_unused flags,
72 int gmx_unused iloc) GPU_FUNC_TERM
74 /*! \brief
75 * Launch asynchronously the download of nonbonded forces from the GPU
76 * (and energies/shift forces if required).
78 GPU_FUNC_QUALIFIER
79 void nbnxn_gpu_launch_cpyback(gmx_nbnxn_gpu_t gmx_unused *nb,
80 const struct nbnxn_atomdata_t gmx_unused *nbatom,
81 int gmx_unused flags,
82 int gmx_unused aloc) GPU_FUNC_TERM
84 /*! \brief
85 * Wait for the asynchronously launched nonbonded calculations and data
86 * transfers to finish.
88 GPU_FUNC_QUALIFIER
89 void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_gpu_t gmx_unused *nb,
90 int gmx_unused flags,
91 int gmx_unused aloc,
92 real gmx_unused *e_lj,
93 real gmx_unused *e_el,
94 rvec gmx_unused *fshift) GPU_FUNC_TERM
96 /*! \brief Selects the Ewald kernel type, analytical or tabulated, single or twin cut-off. */
97 GPU_FUNC_QUALIFIER
98 int nbnxn_gpu_pick_ewald_kernel_type(bool gmx_unused bTwinCut) GPU_FUNC_TERM_WITH_RETURN(-1)
100 #ifdef __cplusplus
102 #endif
104 #endif