ATLAS Offline Software
Loading...
Searching...
No Matches
AthCUDAServicesConfig Namespace Reference

Functions

 GPUSystemInfoSvcCfg (flags)
 HostMemoryResourceToolCfg (flags, **kwargs)
 DeviceMemoryResourceToolCfg (flags, **kwargs)
 ManagedMemoryResourceToolCfg (flags, **kwargs)
 MemoryResourcesToolCfg (flags, **kwargs)
 SingleStreamToolCfg (flags, **kwargs)
 PerEventStreamToolCfg (flags, **kwargs)
 PerComponentStreamToolCfg (flags, **kwargs)
 PerEventAndComponentStreamToolCfg (flags, **kwargs)
 StreamToolCfg (flags, **kwargs)
 CopyToolCfg (flags, **kwargs)
 AsyncCopyToolCfg (flags, **kwargs)

Function Documentation

◆ AsyncCopyToolCfg()

AthCUDAServicesConfig.AsyncCopyToolCfg ( flags,
** kwargs )
Asynchronous copy object provider tool

Definition at line 290 of file AthCUDAServicesConfig.py.

290def AsyncCopyToolCfg(flags, **kwargs):
291 '''Asynchronous copy object provider tool
292 '''
293
294 # Create an accumulator to hold the configuration.
295 result = ComponentAccumulator()
296
297 # Create the tool. Attaching a stream tool to it.
298 copyTool = CompFactory.AthCUDA.AsyncCopyTool(**kwargs)
299 streamTool = StreamToolCfg(flags, **kwargs)
300 copyTool.StreamTool = streamTool.getPrimary()
301 result.merge(streamTool)
302 result.setPrivateTools(copyTool)
303
304 # Return the CA.
305 return result

◆ CopyToolCfg()

AthCUDAServicesConfig.CopyToolCfg ( flags,
** kwargs )
Synchronous copy object provider tool

Definition at line 276 of file AthCUDAServicesConfig.py.

276def CopyToolCfg(flags, **kwargs):
277 '''Synchronous copy object provider tool
278 '''
279
280 # Create an accumulator to hold the configuration.
281 result = ComponentAccumulator()
282
283 # Create the tool in a simple way.
284 result.setPrivateTools(CompFactory.AthCUDA.CopyTool(**kwargs))
285
286 # Return the CA.
287 return result
288
289

◆ DeviceMemoryResourceToolCfg()

AthCUDAServicesConfig.DeviceMemoryResourceToolCfg ( flags,
** kwargs )
Default CUDA device memory resource tool to use

It makes sure that appropriate caching would be used, as allocating device
memory is relatively slow.

Definition at line 59 of file AthCUDAServicesConfig.py.

59def DeviceMemoryResourceToolCfg(flags, **kwargs):
60 '''Default CUDA device memory resource tool to use
61
62 It makes sure that appropriate caching would be used, as allocating device
63 memory is relatively slow.
64 '''
65
66 # Create an accumulator to hold the configuration.
67 result = ComponentAccumulator()
68
69 # Create the components that would collaborate to provide thread-safe
70 # caching to the "bare" memory resource.
71 tool = CompFactory.AthCUDA.DeviceMemoryResourceTool(**kwargs)
72 if flags.Device.Memory.Debug:
73 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
74 'CUDADeviceMemoryResourceDebugTool',
75 MRTool=tool)
76 tool = debugTool
77 pass
78 if flags.Device.Memory.Cache:
79 cacheSvc = CompFactory.AthDevice.BinaryPageMemoryResourceSvc(
80 'CUDADeviceCachedMemoryResourceSvc',
81 MRTool=tool)
82 result.addService(cacheSvc)
83 cacheTool = CompFactory.AthDevice.MemoryResourceSvcAdaptorTool(
84 'CUDADeviceCachedMemoryResourceTool',
85 MRSvc=cacheSvc)
86 tool = cacheTool
87 if flags.Device.Memory.Debug:
88 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
89 'CUDADeviceCachedMemoryResourceDebugTool',
90 MRTool=tool)
91 tool = debugTool
92 pass
93 pass
94 result.setPrivateTools(tool)
95
96 # Return the CA.
97 return result
98
99

◆ GPUSystemInfoSvcCfg()

AthCUDAServicesConfig.GPUSystemInfoSvcCfg ( flags)

Definition at line 11 of file AthCUDAServicesConfig.py.

11def GPUSystemInfoSvcCfg(flags):
12 acc = ComponentAccumulator()
13 svc = CompFactory.getComp("AthCUDA::GPUSystemInfoSvc")("GPUSystemInfoSvc")
14 acc.addService(svc)
15 return acc
16
17

◆ HostMemoryResourceToolCfg()

AthCUDAServicesConfig.HostMemoryResourceToolCfg ( flags,
** kwargs )
Default CUDA host memory resource tool to use

It makes sure that appropriate caching would be used, as allocating pinned
host memory is relatively slow.

Definition at line 18 of file AthCUDAServicesConfig.py.

18def HostMemoryResourceToolCfg(flags, **kwargs):
19 '''Default CUDA host memory resource tool to use
20
21 It makes sure that appropriate caching would be used, as allocating pinned
22 host memory is relatively slow.
23 '''
24
25 # Create an accumulator to hold the configuration.
26 result = ComponentAccumulator()
27
28 # Create the components that would collaborate to provide thread-safe
29 # caching to the "bare" memory resource.
30 tool = CompFactory.AthCUDA.HostMemoryResourceTool(**kwargs)
31 if flags.Device.Memory.Debug:
32 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
33 'CUDAHostMemoryResourceDebugTool',
34 MRTool=tool)
35 tool = debugTool
36 pass
37 if flags.Device.Memory.Cache:
38 cacheSvc = CompFactory.AthDevice.BinaryPageMemoryResourceSvc(
39 'CUDAHostCachedMemoryResourceSvc',
40 MRTool=tool)
41 result.addService(cacheSvc)
42 cacheTool = CompFactory.AthDevice.MemoryResourceSvcAdaptorTool(
43 'CUDAHostCachedMemoryResourceTool',
44 MRSvc=cacheSvc)
45 tool = cacheTool
46 if flags.Device.Memory.Debug:
47 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
48 'CUDAHostCachedMemoryResourceDebugTool',
49 MRTool=tool)
50 tool = debugTool
51 pass
52 pass
53 result.setPrivateTools(tool)
54
55 # Return the CA.
56 return result
57
58

◆ ManagedMemoryResourceToolCfg()

AthCUDAServicesConfig.ManagedMemoryResourceToolCfg ( flags,
** kwargs )
Default CUDA managed memory resource tool to use

It makes sure that appropriate caching would be used, as allocating managed
memory is relatively slow.

Definition at line 100 of file AthCUDAServicesConfig.py.

100def ManagedMemoryResourceToolCfg(flags, **kwargs):
101 '''Default CUDA managed memory resource tool to use
102
103 It makes sure that appropriate caching would be used, as allocating managed
104 memory is relatively slow.
105 '''
106
107 # Create an accumulator to hold the configuration.
108 result = ComponentAccumulator()
109
110 # Create the components that would collaborate to provide thread-safe
111 # caching to the "bare" memory resource.
112 tool = CompFactory.AthCUDA.ManagedMemoryResourceTool(**kwargs)
113 if flags.Device.Memory.Debug:
114 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
115 'CUDAManagedMemoryResourceDebugTool',
116 MRTool=tool)
117 tool = debugTool
118 pass
119 if flags.Device.Memory.Cache:
120 cacheSvc = CompFactory.AthDevice.BinaryPageMemoryResourceSvc(
121 'CUDAManagedCachedMemoryResourceSvc',
122 MRTool=tool)
123 result.addService(cacheSvc)
124 cacheTool = CompFactory.AthDevice.MemoryResourceSvcAdaptorTool(
125 'CUDAManagedCachedMemoryResourceTool',
126 MRSvc=cacheSvc)
127 tool = cacheTool
128 if flags.Device.Memory.Debug:
129 debugTool = CompFactory.AthDevice.DebugMemoryResourceTool(
130 'CUDAManagedCachedMemoryResourceDebugTool',
131 MRTool=tool)
132 tool = debugTool
133 pass
134 pass
135 result.setPrivateTools(tool)
136
137 # Return the CA.
138 return result
139
140

◆ MemoryResourcesToolCfg()

AthCUDAServicesConfig.MemoryResourcesToolCfg ( flags,
** kwargs )
Default tool providing the IMemoryResourcesTool interface for CUDA

Definition at line 141 of file AthCUDAServicesConfig.py.

141def MemoryResourcesToolCfg(flags, **kwargs):
142 '''Default tool providing the IMemoryResourcesTool interface for CUDA
143 '''
144
145 # Create an accumulator to hold the configuration.
146 result = ComponentAccumulator()
147
148 # Create the main tool that would provide the
149 # AthDevice::IMemoryResourcesTool interface.
150 tool = CompFactory.AthDevice.MemoryResourcesAdaptorTool(**kwargs)
151
152 # Set up the main tool according to the received flags.
153 if flags.Device.Memory.Shared:
154 mainMRTool = ManagedMemoryResourceToolCfg(flags)
155 tool.MainMRTool = mainMRTool.getPrimary()
156 result.merge(mainMRTool)
157 else:
158 mainMRTool = DeviceMemoryResourceToolCfg(flags)
159 tool.MainMRTool = mainMRTool.getPrimary()
160 result.merge(mainMRTool)
161
162 hostMRTool = HostMemoryResourceToolCfg(flags)
163 tool.HostMRTool = hostMRTool.getPrimary()
164 result.merge(hostMRTool)
165 pass
166
167 # Return the adaptor tool as the main component of the CA.
168 result.setPrivateTools(tool)
169 return result
170
171

◆ PerComponentStreamToolCfg()

AthCUDAServicesConfig.PerComponentStreamToolCfg ( flags,
** kwargs )
Tool providing one CUDA stream per component (algorithm/tool/service)

Definition at line 214 of file AthCUDAServicesConfig.py.

214def PerComponentStreamToolCfg(flags, **kwargs):
215 '''Tool providing one CUDA stream per component (algorithm/tool/service)
216 '''
217
218 # Create an accumulator to hold the configuration.
219 result = ComponentAccumulator()
220
221 # Create an tool that implements this behaviour.
222 streamTool = CompFactory.AthCUDA.PerComponentStreamTool(**kwargs)
223 result.setPrivateTools(streamTool)
224
225 # Return the CA.
226 return result
227
228

◆ PerEventAndComponentStreamToolCfg()

AthCUDAServicesConfig.PerEventAndComponentStreamToolCfg ( flags,
** kwargs )
Tool providing one CUDA stream per component and event/slot

Definition at line 229 of file AthCUDAServicesConfig.py.

229def PerEventAndComponentStreamToolCfg(flags, **kwargs):
230 '''Tool providing one CUDA stream per component and event/slot
231 '''
232
233 # Create an accumulator to hold the configuration.
234 result = ComponentAccumulator()
235
236 # Create an tool that implements this behaviour.
237 streamTool = CompFactory.AthCUDA.PerEventAndComponentStreamTool(**kwargs)
238 result.setPrivateTools(streamTool)
239
240 # Return the CA.
241 return result
242
243

◆ PerEventStreamToolCfg()

AthCUDAServicesConfig.PerEventStreamToolCfg ( flags,
** kwargs )
Tool providing one CUDA stream per event/slot

Definition at line 193 of file AthCUDAServicesConfig.py.

193def PerEventStreamToolCfg(flags, **kwargs):
194 '''Tool providing one CUDA stream per event/slot
195 '''
196
197 # Create an accumulator to hold the configuration.
198 result = ComponentAccumulator()
199
200 # Create the stream service and add it to the accumulator.
201 streamSvc = CompFactory.AthCUDA.PerEventStreamSvc(**kwargs)
202 result.addService(streamSvc)
203
204 # Create an adaptor tool on top of the service, and set that as the main
205 # component of the CA.
206 streamTool = CompFactory.AthCUDA.StreamSvcAdaptorTool(
207 'PerEventStreamTool', StreamSvc=streamSvc)
208 result.setPrivateTools(streamTool)
209
210 # Return the CA.
211 return result
212
213

◆ SingleStreamToolCfg()

AthCUDAServicesConfig.SingleStreamToolCfg ( flags,
** kwargs )
Tool providing a single CUDA stream for all components in the entire job

Definition at line 172 of file AthCUDAServicesConfig.py.

172def SingleStreamToolCfg(flags, **kwargs):
173 '''Tool providing a single CUDA stream for all components in the entire job
174 '''
175
176 # Create an accumulator to hold the configuration.
177 result = ComponentAccumulator()
178
179 # Create the stream service and add it to the accumulator.
180 streamSvc = CompFactory.AthCUDA.SingleStreamSvc(**kwargs)
181 result.addService(streamSvc)
182
183 # Create an adaptor tool on top of the service, and set that as the main
184 # component of the CA.
185 streamTool = CompFactory.AthCUDA.StreamSvcAdaptorTool(
186 'SingleStreamTool', StreamSvc=streamSvc)
187 result.setPrivateTools(streamTool)
188
189 # Return the CA.
190 return result
191
192

◆ StreamToolCfg()

AthCUDAServicesConfig.StreamToolCfg ( flags,
** kwargs )
Default CUDA stream provider tool to use

Definition at line 244 of file AthCUDAServicesConfig.py.

244def StreamToolCfg(flags, **kwargs):
245 '''Default CUDA stream provider tool to use
246 '''
247
248 # Create an accumulator to hold the configuration.
249 result = ComponentAccumulator()
250
251 # Create the default stream tool, depending on the job's configuration.
252 if flags.CUDA.Stream == CUDAStream.Single:
253 cfg = SingleStreamToolCfg(flags, **kwargs)
254 result.setPrivateTools(cfg.getPrimary())
255 result.merge(cfg)
256 elif flags.CUDA.Stream == CUDAStream.PerEvent:
257 cfg = PerEventStreamToolCfg(flags, **kwargs)
258 result.setPrivateTools(cfg.getPrimary())
259 result.merge(cfg)
260 elif flags.CUDA.Stream == CUDAStream.PerComponent:
261 cfg = PerComponentStreamToolCfg(flags, **kwargs)
262 result.setPrivateTools(cfg.getPrimary())
263 result.merge(cfg)
264 elif flags.CUDA.Stream == CUDAStream.PerEventAndComponent:
265 cfg = PerEventAndComponentStreamToolCfg(flags, **kwargs)
266 result.setPrivateTools(cfg.getPrimary())
267 result.merge(cfg)
268 else:
269 raise ValueError(f"Invalid CUDA stream strategy: {flags.CUDA.Stream}")
270 pass
271
272 # Return the CA.
273 return result
274
275