added Verlet scheme and NxN non-bonded functionality
[gromacs.git] / include / types / hw_info.h
blob1d04f60f1c0f1a8d58870b24fc233eb626b799fb
1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
3 *
4 * This file is part of GROMACS.
5 * Copyright (c) 2012-
7 * Written by the Gromacs development team under coordination of
8 * David van der Spoel, Berk Hess, and Erik Lindahl.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * To help us fund GROMACS development, we humbly ask that you cite
16 * the research papers on the package. Check out http://www.gromacs.org
18 * And Hey:
19 * Gromacs Runs On Most of All Computer Systems
22 #ifndef HWINFO_H
23 #define HWINFO_H
25 #include "types/simple.h"
26 #include "types/nbnxn_cuda_types_ext.h"
27 #include "gmx_cpuid.h"
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 #if 0
33 } /* fixes auto-indentation problems */
34 #endif
36 /* Possible results of the GPU detection/check.
38 * The egpuInsane value means that during the sanity checks an error
39 * occurred that indicates malfunctioning of the device, driver, or
40 * incompatible driver/runtime. */
41 typedef enum
43 egpuCompatible = 0, egpuNonexistent, egpuIncompatible, egpuInsane
44 } e_gpu_detect_res_t;
46 /* Textual names of the GPU detection/check results (see e_gpu_detect_res_t). */
47 static const char * const gpu_detect_res_str[] =
49 "compatible", "inexistent", "incompatible", "insane"
52 /* GPU device information -- for now with only CUDA devices.
53 * The gmx_hardware_detect module initializes it. */
54 typedef struct
56 gmx_bool bUserSet; /* true if the GPUs in cuda_dev_use are manually provided by the user */
58 int ncuda_dev_use; /* number of devices selected to be used */
59 int *cuda_dev_use; /* index of the devices selected to be used */
60 int ncuda_dev; /* total number of devices detected */
61 cuda_dev_info_ptr_t cuda_dev; /* devices detected in the system (per node) */
62 } gmx_gpu_info_t;
64 /* Hardware information structure with CPU and GPU information.
65 * It is initialized by gmx_detect_hardware(). */
66 typedef struct
68 gmx_bool bCanUseGPU; /* True if compatible GPUs are detected during hardware detection */
69 gmx_gpu_info_t gpu_info; /* Information about GPUs detected in the system */
71 gmx_cpuid_t cpuid_info; /* CPUID information about CPU detected;
72 NOTE: this will only detect the CPU thread 0 of the
73 current process runs on. */
74 int nthreads_hw_avail; /* Number of hardware threads available; this number
75 is based on the number of CPUs reported as available
76 by the OS at the time of detection. */
77 } gmx_hw_info_t;
79 #ifdef __cplusplus
81 #endif
83 #endif /* HWINFO_H */