1 import FWCore.ParameterSet.Config
as cms
5 from HeterogeneousCore.Common.PlatformStatus
import PlatformStatus
9 super(ProcessAcceleratorCUDA, self).
__init__()
19 status =
PlatformStatus(os.waitstatus_to_exitcode(os.system(
"cudaIsEnabled")))
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,
"CUDAService"):
27 from HeterogeneousCore.CUDAServices.CUDAService_cfi
import CUDAService
28 process.add_(CUDAService)
31 if not hasattr(process.MessageLogger,
"CUDAService"):
32 process.MessageLogger.CUDAService = cms.untracked.PSet()
36 if hasattr(process,
"CUDAService"):
37 del process.CUDAService
40 if hasattr(process.MessageLogger,
"CUDAService"):
41 del process.MessageLogger.CUDAService
45 cms.specialImportRegistry.registerSpecialImportForType(ProcessAcceleratorCUDA,
"from HeterogeneousCore.CUDACore.ProcessAcceleratorCUDA import ProcessAcceleratorCUDA")
def apply(self, process, accelerators)