#include "gmxpre.h"
#include "gpu_utils.h"
#include "config.h"
#include <cassert>
#include "gromacs/hardware/gpu_hw_info.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
|
static constexpr bool | c_binarySupportsGpus = (GMX_GPU != GMX_GPU_NONE) |
| Constant used to help minimize preprocessed code.
|
|
static bool addMessageIfNotSupported |
( |
gmx::ArrayRef< const std::string > |
errorReasons, |
|
|
std::string * |
error |
|
) |
| |
|
static |
Help build a descriptive message in error
if there are errorReasons
why nonbondeds on a GPU are not supported.
- Returns
- Whether the lack of errorReasons indicate there is support.
bool buildSupportsNonbondedOnGpu |
( |
std::string * |
error | ) |
|
Check if GROMACS has been built with GPU support.
- Parameters
-
[in] | error | Pointer to error string or nullptr. |
- Todo:
- Move this to NB module once it exists.
bool canPerformGpuDetection |
( |
| ) |
|
Return whether GPUs can be detected.
Returns true when this is a build of GROMACS configured to support GPU usage, GPU detection is not disabled by an environment variable and a valid device driver, ICD, and/or runtime was detected. Does not throw.
Frees the gpu_dev and dev_use array fields of gpu_info
.
- Parameters
-
[in] | gpu_info | pointer to structure holding GPU information |
Return a container of the detected GPUs that are compatible.
This function filters the result of the detection for compatible GPUs, based on the previously run compatibility tests.
- Parameters
-
[in] | gpu_info | Information detected about GPUs, including compatibility. |
- Returns
- vector of IDs of GPUs already recorded as compatible
const char* getGpuCompatibilityDescription |
( |
const gmx_gpu_info_t & |
gpu_info, |
|
|
int |
index |
|
) |
| |
Return a string describing how compatible the GPU with given index
is.
- Parameters
-
[in] | gpu_info | Information about detected GPUs |
[in] | index | index of GPU to ask about |
- Returns
- A null-terminated C string describing the compatibility status, useful for error messages.