MeVisLab Toolbox Reference
mlGPUInfo.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2009, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_GPUINFO_H
14 #define ML_GPUINFO_H
15 
17 
18 #include "mlOpenGLSystem.h"
19 
21 
22 //=============================================================================
25 //=============================================================================
27 {
28 public:
29  // --------------------------------------------------------------------------
33  // --------------------------------------------------------------------------
34  static GPUInfo &getInstance();
35 
36 protected:
37  // --------------------------------------------------------------------------
41  // --------------------------------------------------------------------------
43 
44 public:
45  // --------------------------------------------------------------------------
48  // --------------------------------------------------------------------------
49  unsigned long getVideoMemorySizeInMB() const { return static_cast<unsigned long>(_VRAMSize>>20); }
50 
51  // --------------------------------------------------------------------------
55  // --------------------------------------------------------------------------
56  unsigned long getTextureMemorySizeInMB() const { return static_cast<unsigned long>(_TRAMSize>>20); }
57 
58 #ifdef LINUX
59 private:
61  bool detectRAMFromLinuxProcessOutput(FILE* p);
62 #endif
63 
64 private:
65  unsigned long long _VRAMSize;
66  unsigned long long _TRAMSize;
67 };
68 
70 #endif
Singleton class that provides information about GPU.
Definition: mlGPUInfo.h:27
unsigned long getTextureMemorySizeInMB() const
Determine the amount of texture memory in megabytes that is available to the accelerated renderer of ...
Definition: mlGPUInfo.h:56
unsigned long getVideoMemorySizeInMB() const
Determines the amount of video memory in megabytes that is available to the accelerated renderer of t...
Definition: mlGPUInfo.h:49
static GPUInfo & getInstance()
Returns the single existing object of this class.
GPUInfo()
This constructor must not be called from anywhere else but the getInstance() method (which does call ...
#define ML_OPENGL_END_NAMESPACE
Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.
#define ML_OPENGL_START_NAMESPACE
Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of ...
#define MLOPENGL_EXPORT