1 import FWCore.ParameterSet.Config
as cms
5 from HeterogeneousCore.Common.PlatformStatus
import PlatformStatus
9 super(ProcessAcceleratorROCm, self).
__init__()
19 status =
PlatformStatus(os.waitstatus_to_exitcode(os.system(
"rocmIsEnabled")))
20 return self.
labels()
if status == PlatformStatus.Success
else []
22 def apply(self, process, accelerators):
24 if self.
_label in accelerators:
26 if not hasattr(process,
"ROCmService"):
27 from HeterogeneousCore.ROCmServices.ROCmService_cfi
import ROCmService
28 process.add_(ROCmService)
31 if not hasattr(process.MessageLogger,
"ROCmService"):
32 process.MessageLogger.ROCmService = cms.untracked.PSet()
36 if hasattr(process,
"ROCmService"):
37 del process.ROCmService
40 if hasattr(process.MessageLogger,
"ROCmService"):
41 del process.MessageLogger.ROCmService
45 cms.specialImportRegistry.registerSpecialImportForType(ProcessAcceleratorROCm,
"from HeterogeneousCore.ROCmCore.ProcessAcceleratorROCm import ProcessAcceleratorROCm")
def apply(self, process, accelerators)