added Verlet scheme and NxN non-bonded functionality
[gromacs.git] / include / nbnxn_cuda_data_mgmt.h
blob48e54632f5d24593c2e4a29bf00d5de8801e9d3b
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
6 * G R O M A C S
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
32 * And Hey:
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"
44 #ifdef GMX_GPU
45 #define FUNC_TERM ;
46 #define FUNC_QUALIFIER
47 #else
48 #define FUNC_TERM {}
49 #define FUNC_QUALIFIER static
50 #endif
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 /*! Initializes the data structures related to CUDA nonbonded calculations. */
57 FUNC_QUALIFIER
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. */
65 FUNC_QUALIFIER
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. */
71 FUNC_QUALIFIER
72 void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t cu_nb,
73 const nbnxn_pairlist_t *h_nblist,
74 int iloc) FUNC_TERM
76 /*! Initializes atom-data on the GPU, called at every pair search step. */
77 FUNC_QUALIFIER
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 PME auto-tuning. */
82 FUNC_QUALIFIER
83 void nbnxn_cuda_pmetune_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). */
87 FUNC_QUALIFIER
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. */
92 FUNC_QUALIFIER
93 void nbnxn_cuda_clear_outputs(nbnxn_cuda_ptr_t cu_nb,
94 int flags) FUNC_TERM
96 /*! Frees all GPU resources used for the nonbonded calculations. */
97 FUNC_QUALIFIER
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. */
102 FUNC_QUALIFIER
103 wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t cu_nb)
104 #ifdef GMX_GPU
106 #else
107 { return NULL; }
108 #endif
110 /*! Resets nonbonded GPU timings. */
111 FUNC_QUALIFIER
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. */
116 FUNC_QUALIFIER
117 int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t cu_nb)
118 #ifdef GMX_GPU
120 #else
121 { return -1; }
122 #endif
124 #ifdef __cplusplus
126 #endif
128 #undef FUNC_TERM
129 #undef FUNC_QUALIFIER
131 #endif /* NBNXN_CUDA_DATA_MGMT_H */