/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 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 <cstddef>
+#include <memory>
#include <string>
#include <vector>
#include "gromacs/utility/arrayref.h"
-struct gmx_gpu_info_t;
+struct DeviceInformation;
namespace gmx
{
* all compatible GPUs on this physical node. Otherwise, check the
* user specified compatible GPUs and return their IDs.
*
- * \param[in] gpuInfo Information detected about GPUs on this physical node
+ * \param[in] deviceInfoList Information on the GPUs on this physical node.
* \param[in] gpuIdsAvailableString String like "013" or "0,1,3" typically
* supplied by the user to mdrun -gpu_id.
* Must contain only unique decimal digits, or only decimal
* InvalidInputError If gpuIdsAvailableString specifies GPU IDs that are
* not compatible.
*/
-std::vector<int> makeGpuIdsToUse(const gmx_gpu_info_t& gpuInfo, const std::string& gpuIdsAvailableString);
+std::vector<int> makeGpuIdsToUse(const std::vector<std::unique_ptr<DeviceInformation>>& deviceInfoList,
+ const std::string& gpuIdsAvailableString);
/*! \brief Parse a GPU ID specifier string into a container describing device ID to task mapping.
*
* infrastructure to do a good job of coordinating error messages and
* behaviour across MPMD ranks and multiple simulations.
*
- * \param[in] gpu_info Information detected about GPUs
+ * \param[in] deviceInfoList Information on the GPUs on this physical node.
* \param[in] compatibleGpus Vector of GPUs that are compatible
* \param[in] gpuIds The GPU IDs selected by the user.
*
* \throws std::bad_alloc If out of memory
* InconsistentInputError If the assigned GPUs are not valid
*/
-void checkUserGpuIds(const gmx_gpu_info_t& gpu_info,
- const std::vector<int>& compatibleGpus,
- const std::vector<int>& gpuIds);
+void checkUserGpuIds(const std::vector<std::unique_ptr<DeviceInformation>>& deviceInfoList,
+ const std::vector<int>& compatibleGpus,
+ const std::vector<int>& gpuIds);
} // namespace gmx