ATLAS Offline Software
Info.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef ATHCUDACORE_INFO_H
6 #define ATHCUDACORE_INFO_H
7 
8 // System include(s).
9 #include <cstddef>
10 #include <iosfwd>
11 #include <string>
12 #include <vector>
13 
14 namespace AthCUDA {
15 
24  class Info {
25 
26  public:
28  static const Info& instance();
29 
31  int nDevices() const;
32 
34  const std::vector< std::string >& names() const;
36  const std::vector< int >& maxThreadsPerBlock() const;
38  const std::vector< bool >& concurrentKernels() const;
40  const std::vector< std::size_t >& totalMemory() const;
41 
43  void print() const;
44 
45  private:
47  Info();
48 
50  int m_nDevices = 0;
52  std::vector< std::string > m_names;
54  std::vector< int > m_maxThreadsPerBlock;
56  std::vector< bool > m_concurrentKernels;
58  std::vector< std::size_t > m_totalMemory;
59 
60  }; // class Info
61 
63  std::ostream& operator<< ( std::ostream& out, const AthCUDA::Info& info );
64 
65 } // namespace AthCUDA
66 
67 #endif // ATHCUDACORE_INFO_H
grepfile.info
info
Definition: grepfile.py:38
AthCUDA::Info::m_nDevices
int m_nDevices
The number of CUDA devices available at runtime.
Definition: Info.h:50
AthCUDA::Info::instance
static const Info & instance()
Singleton accessor function.
AthCUDA::Info
Class providing information about the CUDA devices at runtime.
Definition: Info.h:24
AthCUDA::Info::totalMemory
const std::vector< std::size_t > & totalMemory() const
Get the total amount of memory for all devices.
AthCUDA::operator<<
std::ostream & operator<<(std::ostream &out, const AthCUDA::Info &info)
Print operator for AthCUDA::Info.
AthCUDA::Info::concurrentKernels
const std::vector< bool > & concurrentKernels() const
Get the multi-kernel capabilities of all devices.
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCUDA::Info::nDevices
int nDevices() const
Get the number of available devices.
AthCUDA::Info::m_names
std::vector< std::string > m_names
The names of all available devices.
Definition: Info.h:52
AthCUDA::Info::names
const std::vector< std::string > & names() const
Get the names of all of the devices.
AthCUDA::Info::m_totalMemory
std::vector< std::size_t > m_totalMemory
The total amount of memory for all devices.
Definition: Info.h:58
AthCUDA::Info::Info
Info()
The constructor is private to implement the singleton behaviour.
AthCUDA
Definition: Info.h:14
AthCUDA::Info::m_concurrentKernels
std::vector< bool > m_concurrentKernels
The multi-kernel capabilities of all devices.
Definition: Info.h:56
AthCUDA::Info::m_maxThreadsPerBlock
std::vector< int > m_maxThreadsPerBlock
The maximum number of threads per block for each available device.
Definition: Info.h:54
AthCUDA::Info::print
void print() const
Print the properties of all detected devices.
AthCUDA::Info::maxThreadsPerBlock
const std::vector< int > & maxThreadsPerBlock() const
Get the maximum number of threads per execution block on all devices.