ATLAS Offline Software
Loading...
Searching...
No Matches
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
11#include "GaudiKernel/IIncidentListener.h"
12#include <mutex>
13
14namespace 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;
29 std::once_flag m_readDevicesOnceFlag;
30
32
33 }; // class GPUSystemInfoSvc
34
35} // namespace AthCUDA
36
37#endif // ATHCUDASERVICES_GPUSYSTEMINFOSVC_H
virtual StatusCode initialize() override
std::vector< DeviceInfo > m_deviceInfo
virtual const std::vector< DeviceInfo > & getAvailableDevices() const override
virtual void handle(const Incident &) override
std::once_flag m_readDevicesOnceFlag
Definition Info.h:14