OpenMPCD
include
OpenMPCD
SystemInformation.hpp
Go to the documentation of this file.
1
/**
2
* @file
3
* Defines the OpenMPCD::SystemInformation class.
4
*/
5
6
#ifndef OPENMPCD_SYSTEMINFORMATION_HPP
7
#define OPENMPCD_SYSTEMINFORMATION_HPP
8
9
#include <cstddef>
10
#include <string>
11
#include <vector>
12
13
namespace
OpenMPCD
14
{
15
/**
16
* Provides information about the system the program is executing on.
17
*/
18
class
SystemInformation
19
{
20
public
:
21
/**
22
* Holds properties of a CUDA device.
23
*/
24
struct
CUDADevice
25
{
26
std::string
name
;
///< The device's name.
27
std::size_t
globalMemory
;
///< The total amount of total memory available, in bytes.
28
};
29
30
private
:
31
SystemInformation
();
///< The constructor.
32
33
public
:
34
/**
35
* Returns the hostname.
36
* @throw Exception Throws on errors.
37
*/
38
static
const
std::string
getHostname
();
39
40
/**
41
* Returns the total number of bytes of physical main memory.
42
* @throw Exception Throws on errors.
43
*/
44
static
std::size_t
getTotalPhysicalMainMemory
();
45
46
/**
47
* Returns a list of cuda devices.
48
*/
49
static
const
std::vector<CUDADevice>
getCUDADevices
();
50
};
//class SystemInformation
51
}
//namespace OpenMPCD
52
53
#endif
OpenMPCD::SystemInformation
Provides information about the system the program is executing on.
Definition:
SystemInformation.hpp:18
OpenMPCD::SystemInformation::CUDADevice
Holds properties of a CUDA device.
Definition:
SystemInformation.hpp:24
OpenMPCD::SystemInformation::CUDADevice::name
std::string name
The device's name.
Definition:
SystemInformation.hpp:26
OpenMPCD::SystemInformation::getHostname
static const std::string getHostname()
Returns the hostname.
Definition:
SystemInformation.cpp:12
OpenMPCD::SystemInformation::CUDADevice::globalMemory
std::size_t globalMemory
The total amount of total memory available, in bytes.
Definition:
SystemInformation.hpp:27
OpenMPCD::SystemInformation::getCUDADevices
static const std::vector< CUDADevice > getCUDADevices()
Returns a list of cuda devices.
Definition:
SystemInformation.cpp:36
OpenMPCD::SystemInformation::getTotalPhysicalMainMemory
static std::size_t getTotalPhysicalMainMemory()
Returns the total number of bytes of physical main memory.
Definition:
SystemInformation.cpp:24
Generated by
1.8.17