#include <GPUSystemInfoSvc.h>
Definition at line 18 of file GPUSystemInfoSvc.h.
◆ getAvailableDevices()
| const std::vector< DeviceInfo > & AthCUDA::GPUSystemInfoSvc::getAvailableDevices |
( |
| ) |
const |
|
overridevirtual |
Definition at line 35 of file GPUSystemInfoSvc.cxx.
35 {
38 }
40 }
#define ATH_MSG_WARNING(x)
std::vector< DeviceInfo > m_deviceInfo
◆ handle()
| void AthCUDA::GPUSystemInfoSvc::handle |
( |
const Incident & | | ) |
|
|
overridevirtual |
◆ initialize()
| StatusCode AthCUDA::GPUSystemInfoSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 13 of file GPUSystemInfoSvc.cxx.
13 {
14 const bool isMultiprocess = (Gaudi::Concurrency::ConcurrencyFlags::numProcs() > 0);
15 if (isMultiprocess) {
16 SmartIF<IIncidentSvc> incsvc{service("IncidentSvc")};
18
19 ATH_MSG_DEBUG(
"In multiprocess mode the CUDA context will be only checked after fork");
20 return StatusCode::SUCCESS;
21 }
22 else {
24
26 return StatusCode::SUCCESS;
27 }
28 }
static const std::string & type()
Incident type.
◆ readAvailableDevices()
| void AthCUDA::GPUSystemInfoSvc::readAvailableDevices |
( |
| ) |
|
|
private |
Definition at line 42 of file GPUSystemInfoSvc.cxx.
42 {
44 std::string cudaErrorStr;
45
46 int deviceCount = 0;
47 cudaError_t
error = cudaGetDeviceCount(&deviceCount);
48 if (error != cudaSuccess) {
49 cudaErrorStr = cudaGetErrorString(error);
50 ATH_MSG_DEBUG(
"Error in cudaGetDeviceCount " << cudaErrorStr);
51 }
52
53 for (
int i = 0;
i < deviceCount;
i++) {
54 cudaDeviceProp prop;
55 error = cudaGetDeviceProperties(&prop, i);
56
57 if (error != cudaSuccess) {
58 cudaErrorStr = cudaGetErrorString(error);
59 ATH_MSG_DEBUG(
"Error in cudaGetDeviceProperties for device " << i <<
" " << cudaErrorStr);
60 continue;
61 }
62 m_deviceInfo.emplace_back(i, prop.name, prop.major, prop.minor);
63 }
64
65
68 return;
69 }
70
72 });
73 }
std::once_flag m_readDevicesOnceFlag
◆ m_deviceInfo
| std::vector<DeviceInfo> AthCUDA::GPUSystemInfoSvc::m_deviceInfo |
|
private |
◆ m_readDevicesOnceFlag
| std::once_flag AthCUDA::GPUSystemInfoSvc::m_readDevicesOnceFlag |
|
private |
◆ m_wasChecked
| bool AthCUDA::GPUSystemInfoSvc::m_wasChecked {} |
|
private |
The documentation for this class was generated from the following files: