# Since we might be overriding AVX2 architecture flags with the AVX512 flags for the
# files where it is used, we also check for a flag not to warn about the first (unused) arch.
# To avoid spamming the user with lots of gromacs tests we just call the CMake flag test directly.
- foreach(_testflag "-Wno-unused-command-line-argument" "-wd10121")
- string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" FLAG_ACCEPTED_VARIABLE "${_testflag}_FLAG_ACCEPTED")
- check_cxx_compiler_flag("${_testflag}" ${FLAG_ACCEPTED_VARIABLE})
- if(${FLAG_ACCEPTED_VARIABLE})
- set(CXX_NO_UNUSED_OPTION_WARNING_FLAGS "${_testflag}")
- break()
- endif()
- endforeach(_testflag)
+ if (NOT MSVC)
+ foreach(_testflag "-Wno-unused-command-line-argument" "-wd10121")
+ string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" FLAG_ACCEPTED_VARIABLE "${_testflag}_FLAG_ACCEPTED")
+ check_cxx_compiler_flag("${_testflag}" ${FLAG_ACCEPTED_VARIABLE})
+ if(${FLAG_ACCEPTED_VARIABLE})
+ set(CXX_NO_UNUSED_OPTION_WARNING_FLAGS "${_testflag}")
+ break()
+ endif()
+ endforeach(_testflag)
+ endif()
endif()
# By default, 32-bit windows cannot pass SIMD (SSE/AVX) arguments in registers,
# First check that the compiler is OK, and find the appropriate flag.
if(WIN32 AND NOT MINGW)
- set(CXX11_CXX_FLAG "/Qstd=c++11")
+ set(CXX11_CXX_FLAG "/std:c++14 /Zc:__cplusplus")
elseif(CYGWIN)
set(CXX11_CXX_FLAG "-std=gnu++11") #required for strdup
else()
* GNU (gcc) 4.8.1
* Intel (icc) 17.0.1
* LLVM (clang) 3.3
-* Microsoft (MSVC) 2017
+* Microsoft (MSVC) 2017 (C++14 is used)
Other compilers may work (Cray, Pathscale, older clang) but do
not offer competitive performance. We recommend against PGI because
check_cxx_compiler_flag(-Wno-missing-declarations HAS_NO_MISSING_DECL)
check_cxx_compiler_flag(-Wno-missing-prototypes HAS_NO_MISSING_PROTO)
check_cxx_compiler_flag(/wd4101 HAS_NO_MSVC_UNUSED)
-check_cxx_compiler_flag(-wd1419 HAS_DECL_IN_SOURCE)
+if (NOT MSVC)
+ check_cxx_compiler_flag(-wd1419 HAS_DECL_IN_SOURCE)
+endif()
if (HAS_NO_UNUSED)
target_compile_options(libgromacs_generated PRIVATE "-Wno-unused;-Wno-unused-parameter")
endif()
/wd28199 #uninitialized memory
# For compile time constant (e.g. templates) the following warnings have flase postives
/wd6239 #(<non-zero> && <expr>)
+ /wd6240 #(<expr> && <non-zero>)
/wd6294 #Ill-defined for-loop
/wd6326 #comparison of constant with other constant
/wd28020 #expression involving paramter is not true
{
int stride = 1;
- /* Workaround for bug in clang */
for (int k = d + 1; k < numDimensions; k++)
{
stride *= numPointsDim[k];
*/
struct AwhTestParameters
{
+ AwhTestParameters() = default;
+ //!Move constructor
+ AwhTestParameters(AwhTestParameters &&o) noexcept : beta(o.beta), awhDimParams(o.awhDimParams),
+ awhBiasParams(o.awhBiasParams), awhParams(o.awhParams),
+ dimParams(std::move(o.dimParams))
+ {
+ awhBiasParams.dimParams = &awhDimParams;
+ awhParams.awhBiasParams = &awhBiasParams;
+ }
double beta; //!< 1/(kB*T)
AwhDimParams awhDimParams; //!< Dimension parameters pointed to by \p awhBiasParams
#include <cassert>
+#include <math_constants.h>
+
#include "gromacs/gpu_utils/cuda_arch_utils.cuh"
#include "pme.cuh"
const float m2k = mhxk * mhxk + mhyk * mhyk + mhzk * mhzk;
assert(m2k != 0.0f);
//TODO: use LDG/textures for gm_splineValue
- float denom = m2k * float(M_PI) * kernelParams.current.boxVolume * gm_splineValueMajor[kMajor] * gm_splineValueMiddle[kMiddle] * gm_splineValueMinor[kMinor];
+ float denom = m2k * float(CUDART_PI_F) * kernelParams.current.boxVolume * gm_splineValueMajor[kMajor] * gm_splineValueMiddle[kMiddle] * gm_splineValueMinor[kMinor];
assert(isfinite(denom));
assert(denom != 0.0f);
const float tmp1 = expf(-kernelParams.grid.ewaldFactor * m2k);
const char *title, const char *ffdir, const char *water,
int nincl, char **incls, int nmol, t_mols *mols)
{
- int i;
- char *incl;
if (nincl > 0)
{
fprintf(out, "; Include chain topologies\n");
- for (i = 0; (i < nincl); i++)
+ for (int i = 0; i < nincl; i++)
{
- incl = strrchr(incls[i], DIR_SEPARATOR);
- if (incl == nullptr)
- {
- incl = incls[i];
- }
- else
- {
- /* Remove the path from the include name */
- incl = incl + 1;
- }
- fprintf(out, "#include \"%s\"\n", incl);
+ fprintf(out, "#include \"%s\"\n", gmx::Path::getFilename(incls[i]).c_str());
}
fprintf(out, "\n");
}
{
fprintf(out, "[ %s ]\n", dir2str(d_molecules));
fprintf(out, "; %-15s %5s\n", "Compound", "#mols");
- for (i = 0; (i < nmol); i++)
+ for (int i = 0; i < nmol; i++)
{
fprintf(out, "%-15s %5d\n", mols[i].name, mols[i].nr);
}
namespace gmx
{
-
+#pragma diag_suppress 177 // No unused attribute which works with both MSVC and NVCC
//! Is \c ptr aligned on a boundary that is a multiple of \c bytes.
gmx_unused static inline bool isAligned(const void *ptr, size_t bytes)
{
/*! \brief Log of the i and j cluster size.
* change this together with c_clSize !*/
-static const int c_clSizeLog2 = 3;
+static const int __device__ c_clSizeLog2 = 3;
/*! \brief Square of cluster size. */
-static const int c_clSizeSq = c_clSize*c_clSize;
+static const int __device__ c_clSizeSq = c_clSize*c_clSize;
/*! \brief j-cluster size after split (4 in the current implementation). */
-static const int c_splitClSize = c_clSize/c_nbnxnGpuClusterpairSplit;
+static const int __device__ c_splitClSize = c_clSize/c_nbnxnGpuClusterpairSplit;
/*! \brief Stride in the force accumualation buffer */
-static const int c_fbufStride = c_clSizeSq;
+static const int __device__ c_fbufStride = c_clSizeSq;
/*! \brief i-cluster interaction mask for a super-cluster with all c_numClPerSupercl=8 bits set */
-static const unsigned superClInteractionMask = ((1U << c_numClPerSupercl) - 1U);
+static const unsigned __device__ superClInteractionMask = ((1U << c_numClPerSupercl) - 1U);
-static const float c_oneSixth = 0.16666667f;
-static const float c_oneTwelveth = 0.08333333f;
+static const float __device__ c_oneSixth = 0.16666667f;
+static const float __device__ c_oneTwelveth = 0.08333333f;
/*! Convert LJ sigma,epsilon parameters to C6,C12. */
{
memset(m->data(), 255, b/64*8);
(*m)[b/64] = (static_cast<uint64_t>(1) << (b%64)) - 1;
- memset(&(*m)[b/64+1], 0, (BITMASK_ALEN-b/64-1)*8);
+ memset(m->data()+(b/64+1), 0, (BITMASK_ALEN-b/64-1)*8);
}
inline static bool bitmask_is_set(gmx_bitmask_t m, int b)