Fix for MSVC+CUDA
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 23 Jul 2019 19:46:51 +0000 (21:46 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 6 Aug 2019 05:21:32 +0000 (07:21 +0200)
MSVC finds it hard to deal with template parameter packs in a few
situations. We don't test with MSVC+CUDA, but a user reports this works in that case.

Change-Id: Id576482facaaf40972ba4fd55b2afcba3113d0e8

src/gromacs/gpu_utils/cudautils.cuh

index 1116d6667406df78c3f030364f08e17f05ca7a6c..1309a10bd970d6654a0534c1e1cbd6750ed75f0d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,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.
@@ -304,13 +304,14 @@ void prepareGpuKernelArgument(KernelPtr kernel,
  * A wrapper function for setting up all the CUDA kernel arguments.
  * Calls the recursive functions above.
  *
+ * \tparam    KernelPtr       Kernel function handle type
  * \tparam    Args            Types of all the kernel arguments
  * \param[in] kernel          Kernel function handle
  * \param[in] argsPtrs        Pointers to all the kernel arguments
  * \returns A prepared parameter pack to be used with launchGpuKernel() as the last argument.
  */
-template <typename ... Args>
-std::array<void *, sizeof ... (Args)> prepareGpuKernelArguments(void                     (*kernel)(Args...),
+template <typename KernelPtr, typename ... Args>
+std::array<void *, sizeof ... (Args)> prepareGpuKernelArguments(KernelPtr                kernel,
                                                                 const KernelLaunchConfig & /*config */,
                                                                 const Args *...          argsPtrs)
 {