/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
const std::vector<int> &gpuIdsToUse,
const std::vector<int> &userGpuTaskAssignment,
const EmulateGpuNonbonded emulateGpuNonbonded,
+ const bool buildSupportsNonbondedOnGpu,
const bool usingVerletScheme,
const bool nonbondedOnGpuIsUseful,
const int numRanksPerSimulation)
if (nonbondedTarget == TaskTarget::Cpu ||
emulateGpuNonbonded == EmulateGpuNonbonded::Yes ||
!usingVerletScheme ||
- !nonbondedOnGpuIsUseful)
+ !nonbondedOnGpuIsUseful ||
+ !buildSupportsNonbondedOnGpu)
{
// If the user required NB on GPUs, we issue an error later.
return false;
bool decideWhetherToUseGpusForNonbonded(const TaskTarget nonbondedTarget,
const std::vector<int> &userGpuTaskAssignment,
const EmulateGpuNonbonded emulateGpuNonbonded,
+ const bool buildSupportsNonbondedOnGpu,
const bool usingVerletScheme,
const bool nonbondedOnGpuIsUseful,
const bool gpusWereDetected)
return false;
}
+ if (!buildSupportsNonbondedOnGpu && nonbondedTarget == TaskTarget::Gpu)
+ {
+ GMX_THROW(InconsistentInputError
+ ("Nonbonded interactions on the GPU were requested with -nb gpu, "
+ "but the GROMACS binary has been built without GPU support. "
+ "Either run without selecting GPU options, or recompile GROMACS "
+ "with GPU support enabled"));
+ }
+
// TODO refactor all these TaskTarget::Gpu checks into one place?
// e.g. use a subfunction that handles only the cases where
// TaskTargets are not Cpu?