Skip to content

Commit aad02aa

Browse files
authored
Merge pull request #47673 from fwyzard/always_load_AlpakaServiceSerialSync_150x
`AlpakaServiceSerialSync` should always be available [15.0.x]
2 parents ac2837d + a50a1ba commit aad02aa

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

HeterogeneousCore/AlpakaCore/python/ProcessAcceleratorAlpaka.py

+3-12
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,10 @@ def apply(self, process, accelerators):
8383
if not hasattr(process.MessageLogger, "AlpakaService"):
8484
process.MessageLogger.AlpakaService = cms.untracked.PSet()
8585

86-
# Check if the CPU backend is available
87-
try:
88-
if not "cpu" in accelerators:
89-
raise False
86+
# The CPU backend is effectively always available, ensure the AlpakaServiceSerialSync is loaded
87+
if not hasattr(process, "AlpakaServiceSerialSync"):
9088
from HeterogeneousCore.AlpakaServices.AlpakaServiceSerialSync_cfi import AlpakaServiceSerialSync
91-
except:
92-
# the CPU backend is not available, do not load the AlpakaServiceSerialSync
93-
if hasattr(process, "AlpakaServiceSerialSync"):
94-
del process.AlpakaServiceSerialSync
95-
else:
96-
# the CPU backend is available, ensure the AlpakaServiceSerialSync is loaded
97-
if not hasattr(process, "AlpakaServiceSerialSync"):
98-
process.add_(AlpakaServiceSerialSync)
89+
process.add_(AlpakaServiceSerialSync)
9990

10091
# Check if CUDA is available, and if the system has at least one usable NVIDIA GPU
10192
try:

0 commit comments

Comments
 (0)