Simplify gmx_gpu_opt_t
[gromacs.git] / src / gromacs / hardware / gpu_hw_info.h
blobf2c2c64059bd89455f477e406020e680925fe05a
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 #ifndef GMX_HARDWARE_GPU_HW_INFO_H
36 #define GMX_HARDWARE_GPU_HW_INFO_H
38 #include "gromacs/utility/basedefinitions.h"
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 #if 0
44 } /* fixes auto-indentation problems */
45 #endif
47 struct gmx_device_info_t;
49 /* Possible results of the GPU detection/check.
51 * The egpuInsane value means that during the sanity checks an error
52 * occurred that indicates malfunctioning of the device, driver, or
53 * incompatible driver/runtime. */
54 typedef enum
56 egpuCompatible = 0, egpuNonexistent, egpuIncompatible, egpuInsane, egpuNR
57 } e_gpu_detect_res_t;
59 /* Names of the GPU detection/check results */
60 extern const char * const gpu_detect_res_str[egpuNR];
62 /* GPU device information -- includes either CUDA or OpenCL devices.
63 * The gmx_hardware_detect module initializes it. */
64 struct gmx_gpu_info_t
66 gmx_bool bDetectGPUs; /* Did we try to detect GPUs? */
67 int n_dev; /* total number of GPU devices detected */
68 struct gmx_device_info_t *gpu_dev; /* GPU devices detected in the system (per node) */
69 int n_dev_compatible; /* number of compatible GPUs */
72 /* GPU device selection information -- includes either CUDA or OpenCL devices */
73 typedef struct gmx_gpu_opt_t
75 char *gpu_id; /* GPU id's to use, each specified as chars */
77 int n_dev_use; /* number of GPU devices selected to be used, either by the user or automatically */
78 int *dev_use; /* array mapping from PP rank index to GPU device ID; GPU IDs can be listed multiple times when ranks share them */
79 } gmx_gpu_opt_t;
81 #ifdef __cplusplus
83 #endif
85 #endif