Equalizer  1.13.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  {
33  GPUInfo() : port( LB_UNDEFINED_UINT32 ), device( LB_UNDEFINED_UINT32 )
34  {}
35 
37  bool operator == ( const GPUInfo& rhs ) const
38  { return port==rhs.port && device==rhs.device && pvp==rhs.pvp; }
39 
41  bool operator != ( const GPUInfo& rhs ) const
42  { return port!=rhs.port || device!=rhs.device || pvp!=rhs.pvp; }
43 
45  uint32_t port;
46 
48  uint32_t device;
49 
52 
53  std::string hostname;
54  };
55 
56  inline std::ostream& operator << ( std::ostream& os, const GPUInfo& info )
57  {
58  if( !info.hostname.empty( ))
59  os << "hostname " << info.hostname << std::endl;
60  if( info.port != LB_UNDEFINED_UINT32 )
61  os << "port " << info.port << std::endl;
62  if( info.device != LB_UNDEFINED_UINT32 )
63  os << "device " << info.device << std::endl;
64  if( info.pvp.isValid( ))
65  os << "viewport " << info.pvp << std::endl;
66  return os;
67  }
68 
69 }
70 }
71 #endif // EQFABRIC_GPUINFO_H
72 
PixelViewport pvp
The size and location of the GPU.
Definition: gpuInfo.h:51
uint32_t device
The screen (GLX), GPU (Win32) or virtual screen (AGL).
Definition: gpuInfo.h:48
bool operator==(const GPUInfo &rhs) const
Definition: gpuInfo.h:37
The Equalizer client library.
Definition: eq/agl/types.h:23
GPUInfo()
Default constructor pointing to default display.
Definition: gpuInfo.h:33
uint32_t port
The display (GLX) or ignored (Win32, AGL).
Definition: gpuInfo.h:45
A structure containing GPU-specific information.
Definition: gpuInfo.h:30
std::string hostname
remote system hostname, empty for local GPUs
Definition: gpuInfo.h:53
Holds a 2D pixel viewport with methods for manipulation.
Definition: pixelViewport.h:34
bool operator!=(const GPUInfo &rhs) const
Definition: gpuInfo.h:41