Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:45:20

0001 import FWCore.ParameterSet.Config as cms
0002 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
0003 
0004 # ECAL unpacker running on CPU
0005 from EventFilter.EcalRawToDigi.EcalUnpackerData_cfi import ecalEBunpacker as _ecalEBunpacker
0006 ecalDigis = SwitchProducerCUDA(
0007     cpu = _ecalEBunpacker.clone()
0008 )
0009 
0010 ecalDigisTask = cms.Task(
0011     # ECAL unpacker running on CPU
0012     ecalDigis
0013 )
0014 
0015 # process modifier to run on GPUs
0016 from Configuration.ProcessModifiers.gpu_cff import gpu
0017 
0018 # ECAL conditions used by the unpacker running on GPU
0019 from EventFilter.EcalRawToDigi.ecalElectronicsMappingGPUESProducer_cfi import ecalElectronicsMappingGPUESProducer
0020 
0021 # ECAL unpacker running on GPU
0022 from EventFilter.EcalRawToDigi.ecalRawToDigiGPU_cfi import ecalRawToDigiGPU as _ecalRawToDigiGPU
0023 ecalDigisGPU = _ecalRawToDigiGPU.clone()
0024 
0025 # extend the SwitchProducer to add a case to copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0026 from EventFilter.EcalRawToDigi.ecalCPUDigisProducer_cfi import ecalCPUDigisProducer as _ecalCPUDigisProducer
0027 gpu.toModify(ecalDigis,
0028     # copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0029     cuda = _ecalCPUDigisProducer.clone(
0030         digisInLabelEB = ('ecalDigisGPU', 'ebDigis'),
0031         digisInLabelEE = ('ecalDigisGPU', 'eeDigis'),
0032         produceDummyIntegrityCollections = True
0033     )
0034 )
0035 
0036 gpu.toReplaceWith(ecalDigisTask, cms.Task(
0037     # ECAL conditions used by the unpacker running on GPU
0038     ecalElectronicsMappingGPUESProducer,
0039     # run the ECAL unpacker on GPU
0040     ecalDigisGPU,
0041     # run the ECAL unpacker on CPU, or copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0042     ecalDigis
0043 ))