From cb093fca4fa2bad81e1db9e7aeb376a9f8da6771 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Tue, 16 Jun 2020 16:00:32 +0200 Subject: [PATCH 1/2] Code format --- .../EcalRecHitSoA/interface/EcalRecHit_soa.h | 3 +- .../plugins/HcalDigisProducerGPU.cc | 12 +++++-- ...eEcalMultifitResultsGpuValidationPlots.cpp | 36 +++++++++---------- RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu | 1 - 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h b/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h index a5f73d2166f7a..bea25c978fdd0 100644 --- a/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h +++ b/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h @@ -23,7 +23,8 @@ namespace ecal { typename type_wrapper::type energy; typename type_wrapper::type time; - typename type_wrapper::type chi2; // should we remove this, since already included in "extra" ? + typename type_wrapper::type + chi2; // should we remove this, since already included in "extra" ? typename type_wrapper::type extra; // packed uint32_t for timeError, chi2, energyError typename type_wrapper::type flagBits; // store rechit condition (see Flags enum) in a bit-wise way diff --git a/EventFilter/HcalRawToDigi/plugins/HcalDigisProducerGPU.cc b/EventFilter/HcalRawToDigi/plugins/HcalDigisProducerGPU.cc index ce18d78af7e84..c7bb27b60fa12 100644 --- a/EventFilter/HcalRawToDigi/plugins/HcalDigisProducerGPU.cc +++ b/EventFilter/HcalRawToDigi/plugins/HcalDigisProducerGPU.cc @@ -111,14 +111,20 @@ HcalDigisProducerGPU::HcalDigisProducerGPU(const edm::ParameterSet& ps) edm::Service cs; if (cs and cs->enabled()) { // allocate on the device - cudaCheck(cudaMalloc((void**)&df01_.data, config_.maxChannelsF01HE * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF01HE))); + cudaCheck(cudaMalloc( + (void**)&df01_.data, + config_.maxChannelsF01HE * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF01HE))); cudaCheck(cudaMalloc((void**)&df01_.ids, config_.maxChannelsF01HE * sizeof(uint32_t))); - cudaCheck(cudaMalloc((void**)&df5_.data, config_.maxChannelsF5HB * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF5HB))); + cudaCheck(cudaMalloc( + (void**)&df5_.data, + config_.maxChannelsF5HB * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF5HB))); cudaCheck(cudaMalloc((void**)&df5_.ids, config_.maxChannelsF5HB * sizeof(uint32_t))); cudaCheck(cudaMalloc((void**)&df5_.npresamples, sizeof(uint8_t) * config_.maxChannelsF5HB)); - cudaCheck(cudaMalloc((void**)&df3_.data, config_.maxChannelsF3HB * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF3HB))); + cudaCheck(cudaMalloc( + (void**)&df3_.data, + config_.maxChannelsF3HB * sizeof(uint16_t) * hcal::compute_stride(config_.nsamplesF3HB))); cudaCheck(cudaMalloc((void**)&df3_.ids, config_.maxChannelsF3HB * sizeof(uint32_t))); } diff --git a/RecoLocalCalo/EcalRecAlgos/bin/makeEcalMultifitResultsGpuValidationPlots.cpp b/RecoLocalCalo/EcalRecAlgos/bin/makeEcalMultifitResultsGpuValidationPlots.cpp index 8ddc5f9c9c028..febad835b00da 100644 --- a/RecoLocalCalo/EcalRecAlgos/bin/makeEcalMultifitResultsGpuValidationPlots.cpp +++ b/RecoLocalCalo/EcalRecAlgos/bin/makeEcalMultifitResultsGpuValidationPlots.cpp @@ -368,21 +368,21 @@ int main(int argc, char *argv[]) { stats->SetY2NDC(y1); stats->SetY1NDC(y1 - (y2 - y1)); } - + c.cd(2); gPad->SetGrid(); hSOIAmplitudesEBGPUvsCPU->Draw("COLZ"); - + c.cd(5); gPad->SetGrid(); hSOIAmplitudesEEGPUvsCPU->Draw("COLZ"); - + c.cd(3); - + hSOIAmplitudesEBGPUCPUratio->Draw(""); - + c.cd(6); - + hSOIAmplitudesEEGPUCPUratio->Draw(""); c.SaveAs("ecal-amplitudes.root"); @@ -406,7 +406,7 @@ int main(int argc, char *argv[]) { stats->SetY2NDC(y1); stats->SetY1NDC(y1 - (y2 - y1)); } - + c.cd(4); { gPad->SetLogy(); @@ -423,21 +423,21 @@ int main(int argc, char *argv[]) { stats->SetY2NDC(y1); stats->SetY1NDC(y1 - (y2 - y1)); } - + c.cd(2); gPad->SetGrid(); hChi2EBGPUvsCPU->Draw("COLZ"); - + c.cd(5); gPad->SetGrid(); hChi2EEGPUvsCPU->Draw("COLZ"); - + c.cd(3); - + hChi2EBGPUCPUratio->Draw(""); - + c.cd(6); - + hChi2EEGPUCPUratio->Draw(""); c.SaveAs("ecal-chi2.root"); @@ -445,7 +445,6 @@ int main(int argc, char *argv[]) { // flags - c.cd(1); { gPad->SetLogy(); @@ -462,7 +461,7 @@ int main(int argc, char *argv[]) { stats->SetY2NDC(y1); stats->SetY1NDC(y1 - (y2 - y1)); } - + c.cd(4); { gPad->SetLogy(); @@ -479,19 +478,18 @@ int main(int argc, char *argv[]) { stats->SetY2NDC(y1); stats->SetY1NDC(y1 - (y2 - y1)); } - + c.cd(2); gPad->SetGrid(); hFlagsEBGPUvsCPU->Draw("COLZ"); - + c.cd(5); gPad->SetGrid(); hFlagsEEGPUvsCPU->Draw("COLZ"); - + c.cd(3); hFlagsEBGPUCPUratio->Draw(""); - c.cd(6); hFlagsEEGPUCPUratio->Draw(""); diff --git a/RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu b/RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu index c1f9a62f4421b..3800ddb3cae70 100644 --- a/RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu +++ b/RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu @@ -7,7 +7,6 @@ #include "MahiGPU.h" - #ifdef HCAL_MAHI_GPUDEBUG #define DETID_TO_DEBUG 1125647428 #endif From 4767e6a5727178599791a68d663b1cebdaabd62f Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Wed, 17 Jun 2020 16:06:11 +0200 Subject: [PATCH 2/2] Format comment --- CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h b/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h index bea25c978fdd0..d4a8d027767f4 100644 --- a/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h +++ b/CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h @@ -23,8 +23,8 @@ namespace ecal { typename type_wrapper::type energy; typename type_wrapper::type time; - typename type_wrapper::type - chi2; // should we remove this, since already included in "extra" ? + // should we remove the following, since already included in "extra" ? + typename type_wrapper::type chi2; typename type_wrapper::type extra; // packed uint32_t for timeError, chi2, energyError typename type_wrapper::type flagBits; // store rechit condition (see Flags enum) in a bit-wise way