Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gpu_utils.h
index edf3f1748691dfb18ec113c8726df8065f360aad..5ed09f4f9bdcf72dd841e9dea15dc80f661864d0 100644 (file)
@@ -99,7 +99,8 @@ bool canPerformGpuDetection();
  *
  * Does not throw. */
 GPU_FUNC_QUALIFIER
-bool isGpuDetectionFunctional(std::string *GPU_FUNC_ARGUMENT(errorMessage)) GPU_FUNC_TERM_WITH_RETURN(false);
+bool isGpuDetectionFunctional(std::string* GPU_FUNC_ARGUMENT(errorMessage))
+        GPU_FUNC_TERM_WITH_RETURN(false);
 
 /*! \brief Find all GPUs in the system.
  *
@@ -120,7 +121,7 @@ bool isGpuDetectionFunctional(std::string *GPU_FUNC_ARGUMENT(errorMessage)) GPU_
  *                         the call to canDetectGpus() should always prevent this occuring)
  */
 GPU_FUNC_QUALIFIER
-void findGpus(gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info)) GPU_FUNC_TERM;
+void findGpus(gmx_gpu_info_tGPU_FUNC_ARGUMENT(gpu_info)) GPU_FUNC_TERM;
 
 /*! \brief Return a container of the detected GPUs that are compatible.
  *
@@ -129,7 +130,7 @@ void findGpus(gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info)) GPU_FUNC_TERM;
  *
  * \param[in]     gpu_info    Information detected about GPUs, including compatibility.
  * \return                    vector of IDs of GPUs already recorded as compatible */
-std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info);
+std::vector<int> getCompatibleGpus(const gmx_gpu_info_tgpu_info);
 
 /*! \brief Return a string describing how compatible the GPU with given \c index is.
  *
@@ -137,14 +138,13 @@ std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info);
  * \param[in]   index       index of GPU to ask about
  * \returns                 A null-terminated C string describing the compatibility status, useful for error messages.
  */
-const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &gpu_info,
-                                           int                   index);
+const char* getGpuCompatibilityDescription(const gmx_gpu_info_t& gpu_info, int index);
 
 /*! \brief Frees the gpu_dev and dev_use array fields of \p gpu_info.
  *
  * \param[in]    gpu_info    pointer to structure holding GPU information
  */
-void free_gpu_info(const gmx_gpu_info_t *gpu_info);
+void free_gpu_info(const gmx_gpu_info_tgpu_info);
 
 /*! \brief Initializes the GPU described by \c deviceInfo.
  *
@@ -157,7 +157,7 @@ void free_gpu_info(const gmx_gpu_info_t *gpu_info);
  * initialization.
  */
 GPU_FUNC_QUALIFIER
-void init_gpu(const gmx_device_info_t *GPU_FUNC_ARGUMENT(deviceInfo)) GPU_FUNC_TERM;
+void init_gpu(const gmx_device_info_tGPU_FUNC_ARGUMENT(deviceInfo)) GPU_FUNC_TERM;
 
 /*! \brief Frees up the CUDA GPU used by the active context at the time of calling.
  *
@@ -175,7 +175,7 @@ void init_gpu(const gmx_device_info_t *GPU_FUNC_ARGUMENT(deviceInfo)) GPU_FUNC_T
  * \returns                 true if no error occurs during the freeing.
  */
 CUDA_FUNC_QUALIFIER
-void free_gpu(const gmx_device_info_t *CUDA_FUNC_ARGUMENT(deviceInfo)) CUDA_FUNC_TERM;
+void free_gpu(const gmx_device_info_tCUDA_FUNC_ARGUMENT(deviceInfo)) CUDA_FUNC_TERM;
 
 /*! \brief Return a pointer to the device info for \c deviceId
  *
@@ -185,7 +185,7 @@ void free_gpu(const gmx_device_info_t *CUDA_FUNC_ARGUMENT(deviceInfo)) CUDA_FUNC
  * \returns                 Pointer to the device info for \c deviceId.
  */
 GPU_FUNC_QUALIFIER
-gmx_device_info_t *getDeviceInfo(const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
+gmx_device_info_t* getDeviceInfo(const gmx_gpu_info_t& GPU_FUNC_ARGUMENT(gpu_info),
                                  int GPU_FUNC_ARGUMENT(deviceId)) GPU_FUNC_TERM_WITH_RETURN(nullptr);
 
 /*! \brief Returns the device ID of the CUDA GPU currently in use.
@@ -208,9 +208,9 @@ int get_current_cuda_gpu_device_id() CUDA_FUNC_TERM_WITH_RETURN(-1);
  * \param[in]   index       an index *directly* into the array of available GPUs
  */
 GPU_FUNC_QUALIFIER
-void get_gpu_device_info_string(char *GPU_FUNC_ARGUMENT(s),
-                                const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
-                                int GPU_FUNC_ARGUMENT(index)) GPU_FUNC_TERM;
+void get_gpu_device_info_string(char*                 GPU_FUNC_ARGUMENT(s),
+                                const gmx_gpu_info_tGPU_FUNC_ARGUMENT(gpu_info),
+                                int                   GPU_FUNC_ARGUMENT(index)) GPU_FUNC_TERM;
 
 
 /*! \brief Returns the size of the gpu_dev_info struct.
@@ -223,14 +223,14 @@ GPU_FUNC_QUALIFIER
 size_t sizeof_gpu_dev_info() GPU_FUNC_TERM_WITH_RETURN(0);
 
 //! Get status of device with specified index
-int gpu_info_get_stat(const gmx_gpu_info_t &info, int index);
+int gpu_info_get_stat(const gmx_gpu_info_tinfo, int index);
 
 /*! \brief Check if GROMACS has been built with GPU support.
  *
  * \param[in] error Pointer to error string or nullptr.
  * \todo Move this to NB module once it exists.
  */
-bool buildSupportsNonbondedOnGpu(std::string *error);
+bool buildSupportsNonbondedOnGpu(std::stringerror);
 
 /*! \brief Starts the GPU profiler if mdrun is being profiled.
  *
@@ -271,14 +271,14 @@ void stopGpuProfiler() CUDA_FUNC_TERM;
 
 //! Tells whether the host buffer was pinned for non-blocking transfers. Only implemented for CUDA.
 CUDA_FUNC_QUALIFIER
-bool isHostMemoryPinned(const void *CUDA_FUNC_ARGUMENT(h_ptr)) CUDA_FUNC_TERM_WITH_RETURN(false);
+bool isHostMemoryPinned(const voidCUDA_FUNC_ARGUMENT(h_ptr)) CUDA_FUNC_TERM_WITH_RETURN(false);
 
 /*! \brief Enable peer access between GPUs where supported
  * \param[in] gpuIdsToUse   List of GPU IDs in use
  * \param[in] mdlog         Logger object
  */
 CUDA_FUNC_QUALIFIER
-void setupGpuDevicePeerAccess(const std::vector<int>  &CUDA_FUNC_ARGUMENT(gpuIdsToUse),
-                              const gmx::MDLogger     &CUDA_FUNC_ARGUMENT(mdlog)) CUDA_FUNC_TERM;
+void setupGpuDevicePeerAccess(const std::vector<int>CUDA_FUNC_ARGUMENT(gpuIdsToUse),
+                              const gmx::MDLogger&    CUDA_FUNC_ARGUMENT(mdlog)) CUDA_FUNC_TERM;
 
 #endif