4from AthenaConfiguration.ComponentFactory
import CompFactory
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8from AthDeviceComps.DeviceConfigFlags
import DeviceBackend
12 '''Default "host side" copy object provider tool
16 result = ComponentAccumulator()
19 result.setPrivateTools(CompFactory.AthDevice.HostCopyTool(**kwargs))
26 '''Default "host side" memory resource provider tool
30 result = ComponentAccumulator()
33 if flags.Device.Backend == DeviceBackend.CUDA:
34 from AthCUDAServices.AthCUDAServicesConfig \
35 import HostMemoryResourceToolCfg
as CUDAHostMemoryResourceToolCfg
36 result.setPrivateTools(result.popToolsAndMerge(
37 CUDAHostMemoryResourceToolCfg(flags, **kwargs)))
41 result.setPrivateTools(
42 CompFactory.AthDevice.HostMemoryResourceTool(**kwargs))
50 '''Default "device side" memory resource provider tool
54 result = ComponentAccumulator()
57 if flags.Device.Backend == DeviceBackend.CUDA:
58 from AthCUDAServices.AthCUDAServicesConfig \
59 import DeviceMemoryResourceToolCfg
as \
60 CUDADeviceMemoryResourceToolCfg
61 result.setPrivateTools(result.popToolsAndMerge(
62 CUDADeviceMemoryResourceToolCfg(flags, **kwargs)))
64 raise RuntimeError(
'No device memory resource tool is available for '
65 'the selected backend: {}'.format(
66 flags.Device.Backend))
73 '''Default "host/device shared" memory resource provider tool
77 result = ComponentAccumulator()
80 if flags.Device.Backend == DeviceBackend.CUDA:
81 from AthCUDAServices.AthCUDAServicesConfig \
82 import ManagedMemoryResourceToolCfg
as \
83 CUDAManagedMemoryResourceToolCfg
84 result.setPrivateTools(result.popToolsAndMerge(
85 CUDAManagedMemoryResourceToolCfg(flags, **kwargs)))
87 raise RuntimeError(
'No shared memory resource tool is available for '
88 'the selected backend: {}'.format(
89 flags.Device.Backend))
96 '''Default tool providing the IMemoryResourcesTool interface for the
101 result = ComponentAccumulator()
104 if flags.Device.Backend == DeviceBackend.CUDA:
105 from AthCUDAServices.AthCUDAServicesConfig \
106 import MemoryResourcesToolCfg
as CUDAMemoryResourcesToolCfg
107 result.setPrivateTools(result.popToolsAndMerge(
108 CUDAMemoryResourcesToolCfg(flags, **kwargs)))
110 raise RuntimeError(
'No memory resources tool is available for the '
111 'selected backend: {}'.format(flags.Device.Backend))
118 '''Default tool providing the ICopyTool interface for the selected backend
122 result = ComponentAccumulator()
125 if flags.Device.Backend == DeviceBackend.CUDA:
126 from AthCUDAServices.AthCUDAServicesConfig \
127 import CopyToolCfg
as CUDACopyToolCfg
128 result.setPrivateTools(result.popToolsAndMerge(
129 CUDACopyToolCfg(flags, **kwargs)))
131 raise RuntimeError(
'No copy tool is available for the selected '
132 'backend: {}'.format(flags.Device.Backend))
139 '''Default tool providing the ICopiesTool interface for the selected backend
143 result = ComponentAccumulator()
146 if flags.Device.Backend == DeviceBackend.CUDA:
147 from AthCUDAServices.AthCUDAServicesConfig \
148 import CopiesToolCfg
as CUDACopiesToolCfg
149 result.setPrivateTools(result.popToolsAndMerge(
150 CUDACopiesToolCfg(flags, **kwargs)))
152 raise RuntimeError(
'No copies tool is available for the selected '
153 'backend: {}'.format(flags.Device.Backend))
HostCopyToolCfg(flags, **kwargs)
DeviceMemoryResourceToolCfg(flags, **kwargs)
SharedMemoryResourceToolCfg(flags, **kwargs)
HostMemoryResourceToolCfg(flags, **kwargs)
CopyToolCfg(flags, **kwargs)
CopiesToolCfg(flags, **kwargs)
MemoryResourcesToolCfg(flags, **kwargs)