1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2012, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
36 #ifndef NBNXN_CUDA_DATA_MGMT_H
37 #define NBNXN_CUDA_DATA_MGMT_H
39 #include "types/simple.h"
40 #include "types/interaction_const.h"
41 #include "types/nbnxn_cuda_types_ext.h"
42 #include "types/hw_info.h"
46 #define FUNC_QUALIFIER
49 #define FUNC_QUALIFIER static
56 /*! Initializes the data structures related to CUDA nonbonded calculations. */
58 void nbnxn_cuda_init(FILE *fplog
,
59 nbnxn_cuda_ptr_t
*p_cu_nb
,
60 gmx_gpu_info_t
*gpu_info
, int my_gpu_index
,
61 /* true of both local and non-local are don on GPU */
62 gmx_bool bLocalAndNonlocal
) FUNC_TERM
64 /*! Initializes simulation constant data. */
66 void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t p_cu_nb
,
67 const interaction_const_t
*ic
,
68 const nonbonded_verlet_t
*nbv
) FUNC_TERM
70 /*! Initializes pair-list data for GPU, called at every pair search step. */
72 void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t cu_nb
,
73 const nbnxn_pairlist_t
*h_nblist
,
76 /*! Initializes atom-data on the GPU, called at every pair search step. */
78 void nbnxn_cuda_init_atomdata(nbnxn_cuda_ptr_t cu_nb
,
79 const nbnxn_atomdata_t
*atomdata
) FUNC_TERM
81 /*! \brief Update parameters during PP-PME load balancing. */
83 void nbnxn_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t cu_nb
,
84 const interaction_const_t
*ic
) FUNC_TERM
86 /*! Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
88 void nbnxn_cuda_upload_shiftvec(nbnxn_cuda_ptr_t cu_nb
,
89 const nbnxn_atomdata_t
*nbatom
) FUNC_TERM
91 /*! Clears GPU outputs: nonbonded force, shift force and energy. */
93 void nbnxn_cuda_clear_outputs(nbnxn_cuda_ptr_t cu_nb
,
96 /*! Frees all GPU resources used for the nonbonded calculations. */
98 void nbnxn_cuda_free(FILE *fplog
,
99 nbnxn_cuda_ptr_t cu_nb
) FUNC_TERM
101 /*! Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
103 wallclock_gpu_t
* nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t cu_nb
)
110 /*! Resets nonbonded GPU timings. */
112 void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t cu_nb
) FUNC_TERM
114 /*! Calculates the minimum size of proximity lists to improve SM load balance
115 with CUDA non-bonded kernels. */
117 int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t cu_nb
)
129 #undef FUNC_QUALIFIER
131 #endif /* NBNXN_CUDA_DATA_MGMT_H */