Simplify PME GPU constants
[gromacs.git] / src / gromacs / ewald / pme_gpu_settings.h
blobd6fa414359df9afa451d36be9a62af9a5e5ed4b6
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2020, 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.
36 /*! \libinternal \file
37 * \brief Defines the PME GPU settings data structures.
38 * \todo Some renaming/refactoring, which does not impair the performance:
39 * -- PmeGpuSettings -> PmeGpuTasks
41 * \author Aleksei Iupinov <a.yupinov@gmail.com>
42 * \author Mark Abraham <mark.j.abraham@gmail.com>
43 * \ingroup module_ewald
46 #ifndef GMX_EWALD_PME_GPU_SETTINGS_H
47 #define GMX_EWALD_PME_GPU_SETTINGS_H
49 #include "gromacs/gpu_utils/gpu_utils.h" // for GpuApiCallBehavior
51 enum class ThreadsPerAtom : int;
53 /*! \internal \brief
54 * The PME GPU settings structure, included in the main PME GPU structure by value.
56 struct PmeGpuSettings
58 /* Permanent settings set on initialization */
59 /*! \brief A boolean which tells if the solving is performed on GPU. Currently always true */
60 bool performGPUSolve;
61 /*! \brief A boolean which tells if the gathering is performed on GPU. Currently always true */
62 bool performGPUGather;
63 /*! \brief A boolean which tells if the FFT is performed on GPU. Currently true for a single MPI rank. */
64 bool performGPUFFT;
65 /*! \brief A convenience boolean which tells if PME decomposition is used. */
66 bool useDecomposition;
67 /*! \brief True if PME forces are reduced on-GPU, false if reduction is done on the CPU;
68 * in the former case transfer does not need to happen.
70 * Note that this flag may change per-step.
72 bool useGpuForceReduction;
74 /*! \brief A boolean which tells if any PME GPU stage should copy all of its outputs to the
75 * host. Only intended to be used by the test framework.
77 bool copyAllOutputs;
78 /*! \brief An enum which tells whether most PME GPU D2H/H2D data transfers should be synchronous. */
79 GpuApiCallBehavior transferKind;
80 /*! \brief
81 * Controls whether we use order (i.e. 4) threads per atom for the GPU
82 * or order*order (i.e. 16) threads per atom.
84 * Currently ThreadsPerAtom::Order is only supported by CUDA.
86 ThreadsPerAtom threadsPerAtom;
87 /*! \brief
88 * Currently only supported by CUDA.
89 * Controls if we should recalculate the splines in the gather or
90 * save the values in the spread and reload in the gather.
92 bool recalculateSplines;
95 #endif