Equalizer  2.1.0
Parallel Rendering Framework
gpuInfo.h
1 
2 /* Copyright (c) 2011, Stefan Eilemann <eile@eyescale.ch>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQFABRIC_GPUINFO_H
19 #define EQFABRIC_GPUINFO_H
20 
21 #include <eq/fabric/pixelViewport.h>
22 #include <eq/fabric/types.h>
23 #include <iostream>
24 
25 namespace eq
26 {
27 namespace fabric
28 {
30 struct GPUInfo
31 {
34  : port(LB_UNDEFINED_UINT32)
35  , device(LB_UNDEFINED_UINT32)
36  {
37  }
38 
40  bool operator==(const GPUInfo& rhs) const
41  {
42  return port == rhs.port && device == rhs.device && pvp == rhs.pvp;
43  }
44 
46  bool operator!=(const GPUInfo& rhs) const
47  {
48  return port != rhs.port || device != rhs.device || pvp != rhs.pvp;
49  }
50 
52  uint32_t port;
53 
55  uint32_t device;
56 
59 
60  std::string hostname;
61 };
62 
63 inline std::ostream& operator<<(std::ostream& os, const GPUInfo& info)
64 {
65  if (!info.hostname.empty())
66  os << "hostname " << info.hostname << std::endl;
67  if (info.port != LB_UNDEFINED_UINT32)
68  os << "port " << info.port << std::endl;
69  if (info.device != LB_UNDEFINED_UINT32)
70  os << "device " << info.device << std::endl;
71  if (info.pvp.isValid())
72  os << "viewport " << info.pvp << std::endl;
73  return os;
74 }
75 }
76 }
77 #endif // EQFABRIC_GPUINFO_H
PixelViewport pvp
The size and location of the GPU.
Definition: gpuInfo.h:58
uint32_t device
The screen (GLX), GPU (Win32) or virtual screen (AGL).
Definition: gpuInfo.h:55
bool operator==(const GPUInfo &rhs) const
Definition: gpuInfo.h:40
The Equalizer client library.
Definition: eq/agl/types.h:23
GPUInfo()
Default constructor pointing to default display.
Definition: gpuInfo.h:33
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49
uint32_t port
The display (GLX) or ignored (Win32, AGL).
Definition: gpuInfo.h:52
A structure containing GPU-specific information.
Definition: gpuInfo.h:30
std::string hostname
remote system hostname, empty for local GPUs
Definition: gpuInfo.h:60
Holds a 2D pixel viewport with methods for manipulation.
Definition: pixelViewport.h:34
bool operator!=(const GPUInfo &rhs) const
Definition: gpuInfo.h:46