* \param[in] pmeGpu PME GPU data structure
* \param[out] output Pointer to PME output data structure
*/
-static void pme_gpu_getForceOutput(PmeGpu &pmeGpu,
+static void pme_gpu_getForceOutput(PmeGpu *pmeGpu,
PmeOutput *output)
{
- output->haveForceOutput_ = !pmeGpu.settings.useGpuForceReduction;
+ output->haveForceOutput_ = !pmeGpu->settings.useGpuForceReduction;
if (output->haveForceOutput_)
{
- output->forces_ = pmeGpu.staging.h_forces;
+ output->forces_ = pmeGpu->staging.h_forces;
}
}
PmeOutput output;
- pme_gpu_getForceOutput(*pmeGpu, &output);
+ pme_gpu_getForceOutput(pmeGpu, &output);
// The caller knows from the flags that the energy and the virial are not usable
// on the else branch
// Compile-time sanity check that our math is correct
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
- SimdFInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdFloat(static_cast<float>(offset/3)));
+ SimdFInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdFloat(static_cast<float>(int(offset/3))));
SimdFloat remainder = offsetExp - offsetExpDiv3 * three;
// Compile-time sanity check that our math is correct
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
// We should swap the sign here, so we change order of the terms in the subtraction
- SimdFInt32 expDiv3 = cvtR2I(SimdFloat(static_cast<float>(offset/3)) - offsetExpDiv3);
+ SimdFInt32 expDiv3 = cvtR2I(SimdFloat(static_cast<float>(int(offset/3))) - offsetExpDiv3);
// Swap sign here too, so remainder is either 0, -1 or -2
SimdFloat remainder = offsetExpDiv3 * three - offsetExp;
SimdDouble offsetExp = cvtI2R(exponent) + SimdDouble(static_cast<double>(offset) + 0.1);
SimdDouble offsetExpDiv3 = trunc(offsetExp * oneThird); // important to truncate here to mimic integer division
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
- SimdDInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdDouble(static_cast<double>(offset/3)));
+ SimdDInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdDouble(static_cast<double>(int(offset/3))));
SimdDouble remainder = offsetExp - offsetExpDiv3 * three;
SimdDouble factor = blend(one, cbrt2, SimdDouble(0.5) < remainder);
factor = blend(factor, sqrCbrt2, SimdDouble(1.5) < remainder);
SimdDouble offsetExp = cvtI2R(exponent) + SimdDouble(static_cast<double>(offset) + 0.1);
SimdDouble offsetExpDiv3 = trunc(offsetExp * oneThird); // important to truncate here to mimic integer division
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
- SimdDInt32 expDiv3 = cvtR2I(SimdDouble(static_cast<double>(offset/3)) - offsetExpDiv3);
+ SimdDInt32 expDiv3 = cvtR2I(SimdDouble(static_cast<double>(int(offset/3))) - offsetExpDiv3);
SimdDouble remainder = offsetExpDiv3 * three - offsetExp;
SimdDouble factor = blend(one, invCbrt2, remainder < SimdDouble(-0.5) );
factor = blend(factor, invSqrCbrt2, remainder < SimdDouble(-1.5));
SimdDouble offsetExp = cvtI2R(exponent) + SimdDouble(static_cast<double>(offset) + 0.1);
SimdDouble offsetExpDiv3 = trunc(offsetExp * oneThird); // important to truncate here to mimic integer division
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
- SimdDInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdDouble(static_cast<double>(offset/3)));
+ SimdDInt32 expDiv3 = cvtR2I(offsetExpDiv3 - SimdDouble(static_cast<double>(int(offset/3))));
SimdDouble remainder = offsetExp - offsetExpDiv3 * three;
SimdDouble factor = blend(one, cbrt2, SimdDouble(0.5) < remainder);
factor = blend(factor, sqrCbrt2, SimdDouble(1.5) < remainder);
SimdDouble offsetExp = cvtI2R(exponent) + SimdDouble(static_cast<double>(offset) + 0.1);
SimdDouble offsetExpDiv3 = trunc(offsetExp * oneThird); // important to truncate here to mimic integer division
static_assert( offset % 3 == 0, "Internal math algorithm/implementation inconsistency");
- SimdDInt32 expDiv3 = cvtR2I(SimdDouble(static_cast<double>(offset/3)) - offsetExpDiv3);
+ SimdDInt32 expDiv3 = cvtR2I(SimdDouble(static_cast<double>(int(offset/3))) - offsetExpDiv3);
SimdDouble remainder = offsetExpDiv3 * three - offsetExp;
SimdDouble factor = blend(one, invCbrt2, remainder < SimdDouble(-0.5) );
factor = blend(factor, invSqrCbrt2, remainder < SimdDouble(-1.5));
if (inputRange.first < 0 && inputRange.second > 0)
{
- testRanges.push_back({inputRange.first, -std::numeric_limits<real>::min()});
- testRanges.push_back({0.0, inputRange.second});
+ testRanges.emplace_back(Range({inputRange.first, -std::numeric_limits<real>::min()}));
+ testRanges.emplace_back(Range({0.0, inputRange.second}));
}
else
{
{
// See test of exp() for comments about test ranges
const real lowestRealThatProducesNormal = (std::numeric_limits<real>::min_exponent - 1)*std::log(2.0);
- const real lowestRealThatProducesCorrectExp = lowestRealThatProducesNormal + GMX_SIMD_HAVE_FMA ? 0.0 : 0.5 * std::numeric_limits<real>::digits * std::log(2.0);
+ const real lowestRealThatProducesCorrectExp = lowestRealThatProducesNormal + (GMX_SIMD_HAVE_FMA ? 0.0 : 0.5 * std::numeric_limits<real>::digits * std::log(2.0));
const real highestRealThatProducesNormal = (std::numeric_limits<real>::max_exponent - 1)*std::log(2.0);
CompareSettings settings {
{
// See test of exp() for comments about test ranges
const real lowestRealThatProducesNormal = (std::numeric_limits<real>::min_exponent - 1)*std::log(2.0);
- const real lowestRealThatProducesCorrectExp = lowestRealThatProducesNormal + GMX_SIMD_HAVE_FMA ? 0.0 : 0.5 * std::numeric_limits<real>::digits * std::log(2.0);
+ const real lowestRealThatProducesCorrectExp = lowestRealThatProducesNormal + (GMX_SIMD_HAVE_FMA ? 0.0 : 0.5 * std::numeric_limits<real>::digits * std::log(2.0));
const real highestRealThatProducesNormal = (std::numeric_limits<real>::max_exponent - 1)*std::log(2.0);
// Increase the allowed error by the difference between the actual precision and single