ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceConfigFlags.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3# Project import(s).
4from AthenaConfiguration.AthConfigFlags import AthConfigFlags
5from AthenaConfiguration.Enums import FlagEnum
6
7
8class DeviceBackend(FlagEnum):
9 '''Enum for the exact device (GPU) backend to use.
10 '''
11 # CUDA code, targeting NVIDIA GPUs.
12 CUDA = 'CUDA'
13 # HIP code, targeting AMD GPUs.
14 HIPAMD = 'HIPAMD'
15 # HIP code, targeting NVIDIA GPUs.
16 HIPNVIDIA = 'HIPNVIDIA'
17 # Alpaka code, targeting NVIDIA GPUs.
18 AlpakaNVIDIA = 'AlpakaNVIDIA'
19 # Alpaka code, targeting AMD GPUs.
20 AlpakaAMD = 'AlpakaAMD'
21 # Alpaka code, targeting Intel GPUs.
22 AlpakaIntel = 'AlpakaIntel'
23 # SYCL code
24 SYCL = 'SYCL'
25
26
28 '''Function to create the flags for using accelerator devices in Athena
29 '''
30
31 # Create the flags container.
32 result = AthConfigFlags()
33
34 # Memory (resource) management flags.
35 result.addFlag('Device.Memory.Cache', True,
36 help='Whether or not to cache memory allocations')
37 result.addFlag('Device.Memory.Debug', False,
38 help='Whether or not to actively debug memory allocations')
39 result.addFlag('Device.Memory.Shared', False,
40 help='Whether or not to use "shared" memory for device '
41 'allocations. In case it is set to False, a separate '
42 'host and device memory resource is to be used.')
43
44 # Memory copy management flag(s).
45 result.addFlag('Device.Copy.Async', True,
46 help='Whether or not to use asynchronous memory copies')
47
48 # Backend selection flag(s).
49 result.addFlag('Device.Backend', DeviceBackend.CUDA, type=DeviceBackend,
50 help='The backend to use for accelerator devices')
51
52 # Return the container.
53 return result