ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAServices
src
GPUSystemInfoSvc.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHCUDASERVICES_GPUSYSTEMINFOSVC_H
6
#define ATHCUDASERVICES_GPUSYSTEMINFOSVC_H
7
8
#include "
AthCUDAInterfaces/IGPUSystemInfoSvc.h
"
9
#include "
AthCUDAInterfaces/DeviceInfo.h
"
10
#include "
AthenaBaseComps/AthService.h
"
11
#include "GaudiKernel/IIncidentListener.h"
12
#include <mutex>
13
14
namespace
AthCUDA
{
15
// Helper service to perform a check if CUDA device is available.
16
// should happen once per process, before any other initialization of the CUDA context
17
// otherwise the check of cudaGetDeviceCount fails
18
class
GPUSystemInfoSvc
:
public
extends< AthService, IGPUSystemInfoSvc, IIncidentListener > {
19
public
:
20
using
extends::extends;
21
22
virtual
StatusCode
initialize
()
override
;
23
virtual
void
handle
(
const
Incident&)
override
;
24
25
virtual
const
std::vector<DeviceInfo>&
getAvailableDevices
()
const override
;
26
private
:
27
std::vector<DeviceInfo>
m_deviceInfo
;
28
bool
m_wasChecked
{};
29
std::once_flag
m_readDevicesOnceFlag
;
30
31
void
readAvailableDevices
();
32
33
};
// class GPUSystemInfoSvc
34
35
}
// namespace AthCUDA
36
37
#endif
// ATHCUDASERVICES_GPUSYSTEMINFOSVC_H
AthService.h
DeviceInfo.h
IGPUSystemInfoSvc.h
AthCUDA::GPUSystemInfoSvc
Definition
GPUSystemInfoSvc.h:18
AthCUDA::GPUSystemInfoSvc::initialize
virtual StatusCode initialize() override
Definition
GPUSystemInfoSvc.cxx:13
AthCUDA::GPUSystemInfoSvc::m_deviceInfo
std::vector< DeviceInfo > m_deviceInfo
Definition
GPUSystemInfoSvc.h:27
AthCUDA::GPUSystemInfoSvc::getAvailableDevices
virtual const std::vector< DeviceInfo > & getAvailableDevices() const override
Definition
GPUSystemInfoSvc.cxx:35
AthCUDA::GPUSystemInfoSvc::handle
virtual void handle(const Incident &) override
Definition
GPUSystemInfoSvc.cxx:30
AthCUDA::GPUSystemInfoSvc::m_wasChecked
bool m_wasChecked
Definition
GPUSystemInfoSvc.h:28
AthCUDA::GPUSystemInfoSvc::readAvailableDevices
void readAvailableDevices()
Definition
GPUSystemInfoSvc.cxx:42
AthCUDA::GPUSystemInfoSvc::m_readDevicesOnceFlag
std::once_flag m_readDevicesOnceFlag
Definition
GPUSystemInfoSvc.h:29
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.16.1