Merge branch release-5-0
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_cuda / nbnxn_cuda_types.h
index f64725df9ad860809eb3fe93c9b284452ac1d3ae..7f358d3cdb9112a0b91da6d8fd8773828dddf8a0 100644 (file)
 #ifndef NBNXN_CUDA_TYPES_H
 #define NBNXN_CUDA_TYPES_H
 
-#include "types/interaction_const.h"
-#include "types/nbnxn_pairlist.h"
-#include "types/nbnxn_cuda_types_ext.h"
-#include "../../gmxlib/cuda_tools/cudautils.cuh"
-
-/* CUDA versions from 5.0 above support texture objects. */
-#if CUDA_VERSION >= 5000
-#define TEXOBJ_SUPPORTED
-#else  /* CUDA_VERSION */
+#include "config.h"
+
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+
+#ifndef HAVE_CUDA_TEXOBJ_SUPPORT
 /** This typedef allows us to define only one version of struct cu_nbparam */
 typedef int cudaTextureObject_t;
-#endif /* CUDA_VERSION */
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -228,18 +226,18 @@ struct cu_timers
 /** \internal
  * \brief Main data structure for CUDA nonbonded force calculations.
  */
-struct nbnxn_cuda
+struct gmx_nbnxn_cuda_t
 {
-    cuda_dev_info_t *dev_info;       /**< CUDA device information                              */
-    bool             bUseTwoStreams; /**< true if doing both local/non-local NB work on GPU    */
-    bool             bUseStreamSync; /**< true if the standard cudaStreamSynchronize is used
-                                          and not memory polling-based waiting                 */
-    cu_atomdata_t   *atdat;          /**< atom data                                            */
-    cu_nbparam_t    *nbparam;        /**< parameters required for the non-bonded calc.         */
-    cu_plist_t      *plist[2];       /**< pair-list data structures (local and non-local)      */
-    nb_staging_t     nbst;           /**< staging area where fshift/energies get downloaded    */
+    struct gmx_device_info_t *dev_info;       /**< CUDA device information                              */
+    bool                      bUseTwoStreams; /**< true if doing both local/non-local NB work on GPU    */
+    bool                      bUseStreamSync; /**< true if the standard cudaStreamSynchronize is used
+                                                   and not memory polling-based waiting                 */
+    cu_atomdata_t            *atdat;          /**< atom data                                            */
+    cu_nbparam_t             *nbparam;        /**< parameters required for the non-bonded calc.         */
+    cu_plist_t               *plist[2];       /**< pair-list data structures (local and non-local)      */
+    nb_staging_t              nbst;           /**< staging area where fshift/energies get downloaded    */
 
-    cudaStream_t     stream[2];      /**< local and non-local GPU streams                      */
+    cudaStream_t              stream[2];      /**< local and non-local GPU streams                      */
 
     /** events used for synchronization */
     cudaEvent_t    nonlocal_done;               /**< event triggered when the non-local non-bonded kernel
@@ -253,9 +251,9 @@ struct nbnxn_cuda
      * concurrent streams, so we won't time if both l/nl work is done on GPUs.
      * Timer init/uninit is still done even with timing off so only the condition
      * setting bDoTime needs to be change if this CUDA "feature" gets fixed. */
-    bool             bDoTime;       /**< True if event-based timing is enabled.               */
-    cu_timers_t     *timers;        /**< CUDA event-based timers.                             */
-    wallclock_gpu_t *timings;       /**< Timing data.                                         */
+    bool                 bDoTime;   /**< True if event-based timing is enabled.               */
+    cu_timers_t         *timers;    /**< CUDA event-based timers.                             */
+    gmx_wallclock_gpu_t *timings;   /**< Timing data.                                         */
 };
 
 #ifdef __cplusplus