features->insert(CpuInfo::Feature::Arm_NeonAsimd);
}
}
+ if (s.find("sve") != std::string::npos)
+ {
+ features->insert(CpuInfo::Feature::Arm_Sve);
+ }
}
}
result.features_.insert(Feature::Arm_Neon); // ARMv8 always has Neon
result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
#endif
+#if defined __arch64__ && defined __ARM_FEATURE_SVE
+ result.features_.insert(Feature::Arm_Sve);
+#endif
#if defined sun
result.vendor_ = CpuInfo::Vendor::Oracle;
{ Feature::X86_Xop, "xop" },
{ Feature::Arm_Neon, "neon" },
{ Feature::Arm_NeonAsimd, "neon_asimd" },
+ { Feature::Arm_Sve, "sve" },
{ Feature::Ibm_Qpx, "qpx" },
{ Feature::Ibm_Vmx, "vmx" },
{ Feature::Ibm_Vsx, "vsx" },
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 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 "config.h"
+#if GMX_SIMD_ARM_SVE
+# include <arm_sve.h>
+#endif
+
#include <cstdio>
#include <cstdlib>
#include "gromacs/hardware/cpuinfo.h"
#include "gromacs/hardware/identifyavx512fmaunits.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/stringutil.h"
namespace gmx
{ SimdType::X86_Mic, "X86_MIC" },
{ SimdType::Arm_Neon, "ARM_NEON" },
{ SimdType::Arm_NeonAsimd, "ARM_NEON_ASIMD" },
+ { SimdType::Arm_Sve, "ARM_SVE" },
{ SimdType::Ibm_Vmx, "IBM_VMX" },
{ SimdType::Ibm_Vsx, "IBM_VSX" },
{ SimdType::Fujitsu_HpcAce, "Fujitsu HPC-ACE" }
break;
case CpuInfo::Vendor::Arm:
- if (c.feature(CpuInfo::Feature::Arm_NeonAsimd))
+ if (c.feature(CpuInfo::Feature::Arm_Sve))
+ {
+ suggested = SimdType::Arm_Sve;
+ }
+ else if (c.feature(CpuInfo::Feature::Arm_NeonAsimd))
{
suggested = SimdType::Arm_NeonAsimd;
}
return SimdType::Arm_Neon;
#elif GMX_SIMD_ARM_NEON_ASIMD
return SimdType::Arm_NeonAsimd;
+#elif GMX_SIMD_ARM_SVE
+ return SimdType::Arm_Sve;
#elif GMX_SIMD_IBM_VMX
return SimdType::Ibm_Vmx;
#elif GMX_SIMD_IBM_VSX
warnMsg = wrapper.wrapToString(formatString(
"Compiled SIMD: %s, but for this host/run %s might be better (see log).",
simdString(compiled).c_str(), simdString(wanted).c_str()));
+#if GMX_SIMD_ARM_SVE
+ }
+ else if ((compiled == SimdType::Arm_Sve) && (svcntb() != GMX_SIMD_ARM_SVE_LENGTH / 8))
+ {
+ logMsg = wrapper.wrapToString(formatString(
+ "Longest SVE length requested by all nodes in run: %d\n"
+ "SVE length selected at compile time: %ld\n"
+ "This program was compiled for different hardware than you are running on, "
+ "which will lead to incorrect behavior.\n"
+ "Aborting",
+ GMX_SIMD_ARM_SVE_LENGTH, svcntb() * 8));
+ warnMsg = wrapper.wrapToString(formatString(
+ "Compiled SVE Length: %d, but for this process requires %ld (see log).",
+ GMX_SIMD_ARM_SVE_LENGTH, svcntb() * 8));
+#endif
}
if (!logMsg.empty() && log != nullptr)
{
fprintf(stderr, "%s\n", warnMsg.c_str());
}
+#if GMX_SIMD_ARM_SVE
+ if ((compiled == SimdType::Arm_Sve) && (svcntb() != GMX_SIMD_ARM_SVE_LENGTH / 8))
+ {
+ gmx_exit_on_fatal_error(ExitType_Abort, 1);
+ }
+#endif
return (wanted == compiled);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 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.
X86_Mic, //!< Knight's corner
Arm_Neon, //!< 32-bit ARM NEON
Arm_NeonAsimd, //!< 64-bit ARM AArch64 Advanced SIMD
+ Arm_Sve, //!< ARM Scalable Vector Extensions
Ibm_Vmx, //!< IBM VMX SIMD (Altivec on Power6 and later)
Ibm_Vsx, //!< IBM VSX SIMD (Power7 and later)
Fujitsu_HpcAce //!< Fujitsu K-computer