CMakeLists.txt.user
/VersionInfo*.cmake
Testing
+/.vs
+/CMakeSettings.json
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2019, by the GROMACS development team, led by
+# Copyright (c) 2019,2020, 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.
if [ -z "$CLANG_FORMAT" ]
then
echo "Please set the path to clang-format using the git hook"
- echo "git config hooks.clang_formatpath /path/to/clang-format"
+ echo "git config hooks.clangformatpath /path/to/clang-format"
echo "or by setting an environment variable, e.g."
echo "CLANG_FORMAT=/path/to/clang-format"
echo "See docs/dev-manual/code-formatting.rst for how to get clang-format."
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, 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.
char buf[12];
int i;
- srenew(xr->dih, xr->ndih + 2);
+ srenew(xr->dih, xr->ndih + 2LL);
for (i = 0; (i < 4); i++)
{
xr->dih[xr->ndih].ai[i] = ff[i];
}
xr->ndih += 2;
- srenew(xr->pp, xr->npp + 1);
+ srenew(xr->pp, xr->npp + 1LL);
xr->pp[xr->npp].iphi = xr->ndih - 2;
xr->pp[xr->npp].ipsi = xr->ndih - 1;
xr->pp[xr->npp].bShow = FALSE;
{
for (j = 0; (j < 4); j++)
{
+ MSVC_DIAGNOSTIC_IGNORE(28182) // false positive in 2019 (16.5.4)
ai = xr->dih[i].ai[j];
+ MSVC_DIAGNOSTIC_RESET
if (ai < xr->amin)
{
xr->amin = ai;
}
i += nra + 1;
- ia += nra + 1;
+ ia += nra + 1LL;
}
/* Fill in defaults for values not in the topology */
for (i = 0; (i < xr->ndih); i++)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
//! Returns the number of cells in the column
int numCellsInColumn(int columnIndex) const
{
- return cxy_ind_[columnIndex + 1] - cxy_ind_[columnIndex];
+ return cxy_ind_[columnIndex + 1LL] - cxy_ind_[columnIndex];
}
//! Returns the index of the first atom in the column
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
* On AMD Zen, tabulated Ewald kernels are faster on all 4 combinations
* of single or double precision and 128 or 256-bit AVX2.
*/
+ MSVC_DIAGNOSTIC_IGNORE(6285) // Always zero because compile time constant
if (
#if GMX_SIMD
(GMX_SIMD_REAL_WIDTH >= 8 || (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE)) &&
{
kernelSetup.ewaldExclusionType = EwaldExclusionType::Analytical;
}
- else
- {
- kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
- }
+ MSVC_DIAGNOSTIC_RESET
+ else { kernelSetup.ewaldExclusionType = EwaldExclusionType::Table; }
if (getenv("GMX_NBNXN_EWALD_TABLE") != nullptr)
{
kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019,2020, 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.
struct nbnxn_excl_t
{
/* Constructor, sets no exclusions, so all atom pairs interacting */
+ MSVC_DIAGNOSTIC_IGNORE(26495) // pair is not being initialized!
nbnxn_excl_t()
{
for (unsigned int& pairEntry : pair)
pairEntry = NBNXN_INTERACTION_MASK_ALL;
}
}
+ MSVC_DIAGNOSTIC_RESET
/* Topology exclusion interaction bits per warp */
unsigned int pair[c_nbnxnGpuExclSize];
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2010-2018, The GROMACS development team.
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
{
store_->append(value);
}
- DIAGNOSTIC_RESET;
+ CLANG_DIAGNOSTIC_RESET;
clearSet();
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,2020, 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.
class SimdFIBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFIBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFIBool(bool b) : simdInternal_(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
// Internal utility constructor to simplify return statements
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,2020, 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.
class Simd4Double
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4Double() {}
+ MSVC_DIAGNOSTIC_RESET
Simd4Double(double d) : simdInternal_(_mm256_set1_pd(d)) {}
class Simd4DBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4DBool() {}
+ MSVC_DIAGNOSTIC_RESET
//! \brief Construct from scalar bool
Simd4DBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)))
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019,2020, 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.
class Simd4Float
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4Float() {}
-
+ MSVC_DIAGNOSTIC_RESET
Simd4Float(float f) : simdInternal_(_mm_set1_ps(f)) {}
// Internal utility constructor to simplify return statements
class Simd4FBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
Simd4FBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
//! \brief Construct from scalar bool
Simd4FBool(bool b) : simdInternal_(_mm_castsi128_ps(_mm_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019,2020, 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.
class SimdDouble
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDouble() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDouble(double d) : simdInternal_(_mm256_set1_pd(d)) {}
// Internal utility constructor to simplify return statements
class SimdDInt32
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDInt32() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDInt32(std::int32_t i) : simdInternal_(_mm_set1_epi32(i)) {}
// Internal utility constructor to simplify return statements
class SimdDBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
// Internal utility constructor to simplify return statements
class SimdDIBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdDIBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdDIBool(bool b) : simdInternal_(_mm_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
// Internal utility constructor to simplify return statements
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019,2020, 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.
class SimdFloat
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFloat() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFloat(float f) : simdInternal_(_mm256_set1_ps(f)) {}
// Internal utility constructor to simplify return statements
class SimdFInt32
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFInt32() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFInt32(std::int32_t i) : simdInternal_(_mm256_set1_epi32(i)) {}
// Internal utility constructor to simplify return statements
class SimdFBool
{
public:
+ MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
SimdFBool() {}
-
+ MSVC_DIAGNOSTIC_RESET
SimdFBool(bool b) : simdInternal_(_mm256_castsi256_ps(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
// Internal utility constructor to simplify return statements
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, 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.
#include <array>
#include <type_traits>
+#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/real.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019,2020, 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.
int numBlocks() const { return static_cast<int>(index_.size()) - 1; }
/*! \brief Returns the size of the block with index \p blockIndex */
- Block block(int blockIndex) const { return Block(index_[blockIndex], index_[blockIndex + 1]); }
+ Block block(int blockIndex) const
+ {
+ return Block(index_[blockIndex], index_[blockIndex + 1LL]);
+ }
/*! \brief Returns the full range */
Block fullRange() const { return Block(index_.front(), index_.back()); }
void reduceNumBlocks(int newNumBlocks)
{
GMX_ASSERT(newNumBlocks <= numBlocks(), "Can only shrink to fewer blocks");
- index_.resize(newNumBlocks + 1);
+ index_.resize(newNumBlocks + 1LL);
}
/*! \brief Sets the partitioning to \p numBlocks blocks each of size 1 */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, 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.
# define DO_PRAGMA(x) _Pragma(# x)
# define CLANG_DIAGNOSTIC_IGNORE(warning) \
_Pragma("clang diagnostic push") DO_PRAGMA(clang diagnostic ignored #warning)
-# define DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
+# define CLANG_DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
#else
-//! Ignore specified clang warning until DIAGNOSTIC_RESET
+//! Ignore specified clang warning until CLANG_DIAGNOSTIC_RESET
# define CLANG_DIAGNOSTIC_IGNORE(warning)
//! Reset all diagnostics to default
-# define DIAGNOSTIC_RESET
+# define CLANG_DIAGNOSTIC_RESET
+#endif
+
+#ifdef _MSC_VER
+# define MSVC_DIAGNOSTIC_IGNORE(id) __pragma(warning(push)) __pragma(warning(disable : id))
+# define MSVC_DIAGNOSTIC_RESET __pragma(warning(pop))
+#else
+//! Ignore specified MSVC warning until MSVC_DIAGNOSTIC_RESET
+# define MSVC_DIAGNOSTIC_IGNORE(warning)
+//! Reset all diagnostics to default
+# define MSVC_DIAGNOSTIC_RESET
#endif
namespace gmx