From: Szilárd Páll Date: Thu, 22 Aug 2019 11:01:17 +0000 (+0200) Subject: Fix clang tidy warnings in CUDA build X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=eb675585321d45258c571f1e79399a98c13c9224;p=alexxy%2Fgromacs.git Fix clang tidy warnings in CUDA build Tested with clang 7 on a build with clang for both host and device code. Change-Id: Ie2be427ae63f90f4eec4e79cc85da3ab13fcfe4a --- diff --git a/src/gromacs/gpu_utils/gpu_utils.h b/src/gromacs/gpu_utils/gpu_utils.h index ea9241b900..b0e6d86615 100644 --- a/src/gromacs/gpu_utils/gpu_utils.h +++ b/src/gromacs/gpu_utils/gpu_utils.h @@ -194,7 +194,7 @@ gmx_device_info_t *getDeviceInfo(const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_inf * \returns device ID of the GPU in use at the time of the call */ CUDA_FUNC_QUALIFIER -int get_current_cuda_gpu_device_id(void) CUDA_FUNC_TERM_WITH_RETURN(-1); +int get_current_cuda_gpu_device_id() CUDA_FUNC_TERM_WITH_RETURN(-1); /*! \brief Formats and returns a device information string for a given GPU. * @@ -240,7 +240,7 @@ bool buildSupportsNonbondedOnGpu(std::string *error); * Note that this is implemented only for the CUDA API. */ CUDA_FUNC_QUALIFIER -void startGpuProfiler(void) CUDA_FUNC_TERM; +void startGpuProfiler() CUDA_FUNC_TERM; /*! \brief Resets the GPU profiler if mdrun is being profiled. @@ -254,7 +254,7 @@ void startGpuProfiler(void) CUDA_FUNC_TERM; * Note that this is implemented only for the CUDA API. */ CUDA_FUNC_QUALIFIER -void resetGpuProfiler(void) CUDA_FUNC_TERM; +void resetGpuProfiler() CUDA_FUNC_TERM; /*! \brief Stops the CUDA profiler if mdrun is being profiled. @@ -266,7 +266,7 @@ void resetGpuProfiler(void) CUDA_FUNC_TERM; * Note that this is implemented only for the CUDA API. */ CUDA_FUNC_QUALIFIER -void stopGpuProfiler(void) CUDA_FUNC_TERM; +void stopGpuProfiler() CUDA_FUNC_TERM; //! Tells whether the host buffer was pinned for non-blocking transfers. Only implemented for CUDA. CUDA_FUNC_QUALIFIER diff --git a/src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp b/src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp index fb64ead7c1..16beb2b85e 100644 --- a/src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp +++ b/src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2017,2018, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -120,11 +120,11 @@ TEST_F(PinnedMemoryCheckerTest, PinnedCBufferIsRecognized) } real *dummy = nullptr; - pmalloc((void **)&dummy, 3 * sizeof(real)); + pmalloc(reinterpret_cast(&dummy), 3 * sizeof(real)); EXPECT_TRUE(isHostMemoryPinned(dummy)); pfree(dummy); } } // namespace -} // namespace -} // namespace +} // namespace test +} // namespace gmx diff --git a/src/gromacs/nbnxm/nbnxm_gpu.h b/src/gromacs/nbnxm/nbnxm_gpu.h index 46b1dc4c50..ba3b9a8f52 100644 --- a/src/gromacs/nbnxm/nbnxm_gpu.h +++ b/src/gromacs/nbnxm/nbnxm_gpu.h @@ -237,7 +237,7 @@ void nbnxn_gpu_x_to_nbat_x(const Nbnxm::Grid gmx_unused &grid, */ CUDA_FUNC_QUALIFIER void nbnxnInsertNonlocalGpuDependency(const gmx_nbnxn_gpu_t gmx_unused *nb, - const InteractionLocality gmx_unused interactionLocality) CUDA_FUNC_TERM; + InteractionLocality gmx_unused interactionLocality) CUDA_FUNC_TERM; /*! \brief Set up internal flags that indicate what type of short-range work there is. * @@ -277,7 +277,7 @@ void nbnxn_gpu_init_add_nbat_f_to_f(const int gmx_unused *cell, /*! \brief F buffer operations on GPU: adds nb format force to rvec format. */ CUDA_FUNC_QUALIFIER -void nbnxn_gpu_add_nbat_f_to_f(const AtomLocality gmx_unused atomLocality, +void nbnxn_gpu_add_nbat_f_to_f(AtomLocality gmx_unused atomLocality, gmx_nbnxn_gpu_t gmx_unused *gpu_nbv, void gmx_unused *fPmeDevicePtr, GpuEventSynchronizer gmx_unused *pmeForcesReady, @@ -288,21 +288,21 @@ void nbnxn_gpu_add_nbat_f_to_f(const AtomLocality gmx_unused atomLoca /*! \brief Copy force buffer from CPU to GPU */ CUDA_FUNC_QUALIFIER -void nbnxn_launch_copy_f_to_gpu(const AtomLocality gmx_unused atomLocality, +void nbnxn_launch_copy_f_to_gpu(AtomLocality gmx_unused atomLocality, const Nbnxm::GridSet gmx_unused &gridSet, gmx_nbnxn_gpu_t gmx_unused *nb, rvec gmx_unused *f) CUDA_FUNC_TERM; /*! \brief Copy force buffer from GPU to CPU */ CUDA_FUNC_QUALIFIER -void nbnxn_launch_copy_f_from_gpu(const AtomLocality gmx_unused atomLocality, +void nbnxn_launch_copy_f_from_gpu(AtomLocality gmx_unused atomLocality, const Nbnxm::GridSet gmx_unused &gridSet, gmx_nbnxn_gpu_t gmx_unused *nb, rvec gmx_unused *f) CUDA_FUNC_TERM; /*! \brief Wait for GPU stream to complete */ CUDA_FUNC_QUALIFIER -void nbnxn_wait_for_gpu_force_reduction(const AtomLocality gmx_unused atomLocality, +void nbnxn_wait_for_gpu_force_reduction(AtomLocality gmx_unused atomLocality, gmx_nbnxn_gpu_t gmx_unused *nb) CUDA_FUNC_TERM;