Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing ECAL local reconstruction on GPU issues #33116

Merged
merged 26 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
669e272
Move ElectronicsMappingGPU from EventFilter/EcalRawToDigi to CondForm…
thomreis Mar 1, 2021
680b53c
Move EcalGainRatiosGPU from RecoLocalCalo/EcalRecAlgos to CondFormats…
thomreis Mar 1, 2021
cf2976b
Move EcalIntercalibConstantsGPU from RecoLocalCalo/EcalRecAlgos to Co…
thomreis Mar 1, 2021
258ff29
Move EcalLaserAPDPNRatiosGPU from RecoLocalCalo/EcalRecAlgos to CondF…
thomreis Mar 1, 2021
aabee9a
Move EcalLaserAPDPNRatiosRefGPU from RecoLocalCalo/EcalRecAlgos to Co…
thomreis Mar 1, 2021
5769d1a
Move EcalLaserAlphasGPU from RecoLocalCalo/EcalRecAlgos to CondFormat…
thomreis Mar 1, 2021
53b454d
Move EcalLinearCorrectionsGPU from RecoLocalCalo/EcalRecAlgos to Cond…
thomreis Mar 1, 2021
be8340c
Move EcalMultifitParametersGPU from RecoLocalCalo/EcalRecAlgos to Con…
thomreis Mar 1, 2021
9b3c2d1
Move EcalPedestalsGPU from RecoLocalCalo/EcalRecAlgos to CondFormats/…
thomreis Mar 1, 2021
b806a2f
Move EcalPulseCovariancesGPU from RecoLocalCalo/EcalRecAlgos to CondF…
thomreis Mar 1, 2021
cbf54d2
Move EcalPulseShapesGPU from RecoLocalCalo/EcalRecAlgos to CondFormat…
thomreis Mar 1, 2021
4589bd8
Move EcalRecHitParametersGPU from RecoLocalCalo/EcalRecAlgos to CondF…
thomreis Mar 1, 2021
7cbbefa
Move EcalRechitADCToGeVConstantGPU from RecoLocalCalo/EcalRecAlgos to…
thomreis Mar 1, 2021
afe2830
Move EcalRechitChannelStatusGPU from RecoLocalCalo/EcalRecAlgos to Co…
thomreis Mar 1, 2021
ca4c9b6
Move EcalSamplesCorrelationGPU from RecoLocalCalo/EcalRecAlgos to Con…
thomreis Mar 1, 2021
2ffdda7
Move EcalTimeBiasCorrectionsGPU from RecoLocalCalo/EcalRecAlgos to Co…
thomreis Mar 1, 2021
024bf2a
Move EcalTimeCalibConstantsGPU from RecoLocalCalo/EcalRecAlgos to Con…
thomreis Mar 1, 2021
13cf525
Clean up BuildFiles.
thomreis Mar 1, 2021
5f5cc26
Replace cudaMallow and cudaMemcpyAsync with cms::cude::make_device_un…
thomreis Mar 1, 2021
58a108e
Replace cudaMallow and cudaMemcpyAsync with cms::cude::make_device_un…
thomreis Mar 8, 2021
2c0e025
Replace cudaMallow and cudaMemcpyAsync with cms::cude::make_device_un…
thomreis Mar 8, 2021
7d6218f
Remove Common.h and use gainId and adc functions from DataFormats/Eca…
thomreis Mar 8, 2021
60c8bac
Comments cleanup.
thomreis Mar 8, 2021
79a2cee
Apply code-checks and code-format.
thomreis Mar 8, 2021
7375ce7
Fix segfault.
thomreis Mar 9, 2021
0439265
Variable name changes to comply with code rules.
thomreis Mar 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CondFormats/EcalObjects/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<use name="DataFormats/EcalDetId"/>
<use name="DataFormats/EcalDigi"/>
<use name="DataFormats/Math"/>
<use name="HeterogeneousCore/CUDACore"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="boost"/>
<use name="boost_serialization"/>
<use name="rootmath"/>
<use name="clhep"/>
<use name="cuda"/>
<export>
<lib name="1"/>
</export>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalGainRatiosGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalGainRatiosGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalGainRatiosGPU_h
#define CondFormats_EcalObjects_interface_EcalGainRatiosGPU_h

#include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,8 +13,8 @@
class EcalGainRatiosGPU {
public:
struct Product {
~Product();
float *gain12Over6 = nullptr, *gain6Over1 = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> gain12Over6;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> gain6Over1;
};

#ifndef __CUDACC__
Expand Down Expand Up @@ -40,4 +42,4 @@ class EcalGainRatiosGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalGainRatiosGPU_h
#endif // CondFormats_EcalObjects_interface_EcalGainRatiosGPU_h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalIntercalibConstantsGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalIntercalibConstantsGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalIntercalibConstantsGPU_h
#define CondFormats_EcalObjects_interface_EcalIntercalibConstantsGPU_h

#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,8 +13,7 @@
class EcalIntercalibConstantsGPU {
public:
struct Product {
~Product();
float* values = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> values;
};

#ifndef __CUDACC__
Expand All @@ -27,17 +28,17 @@ class EcalIntercalibConstantsGPU {

// TODO: do this centrally
// get offset for hashes. equals number of barrel items
uint32_t getOffset() const { return valuesEB_.size(); }
uint32_t getOffset() const { return offset_; }

//
static std::string name() { return std::string{"ecalIntercalibConstantsGPU"}; }

private:
std::vector<float> const& valuesEB_;
std::vector<float> const& valuesEE_;
std::vector<float, cms::cuda::HostAllocator<float>> values_;
uint32_t offset_;

cms::cuda::ESProduct<Product> product_;
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalIntercalibConstantsGPU_h
#endif // CondFormats_EcalObjects_interface_EcalIntercalibConstantsGPU_h
54 changes: 54 additions & 0 deletions CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosGPU.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#ifndef CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosGPU_h
#define CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosGPU_h

#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
#include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
#endif // __CUDACC__

class EcalLaserAPDPNRatiosGPU {
public:
struct Product {
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p1;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p2;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p3;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t1;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t2;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t3;
};

#ifndef __CUDACC__

//
EcalLaserAPDPNRatiosGPU(EcalLaserAPDPNRatios const &);

// will call dealloation for Product thru ~Product
~EcalLaserAPDPNRatiosGPU() = default;

// get device pointers
Product const &getProduct(cudaStream_t) const;

//
static std::string name() { return std::string{"ecalLaserAPDPNRatiosGPU"}; }

private:
// in the future, we need to arrange so to avoid this copy on the host
// store eb first then ee
std::vector<float, cms::cuda::HostAllocator<float>> p1_;
std::vector<float, cms::cuda::HostAllocator<float>> p2_;
std::vector<float, cms::cuda::HostAllocator<float>> p3_;

std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t1_;
std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t2_;
std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t3_;

cms::cuda::ESProduct<Product> product_;

#endif // __CUDACC__
};

#endif // CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosGPU_h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAPDPNRatiosRefGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAPDPNRatiosRefGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosRefGPU_h
#define CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosRefGPU_h

#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,8 +13,7 @@
class EcalLaserAPDPNRatiosRefGPU {
public:
struct Product {
~Product();
float* values = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> values;
};

#ifndef __CUDACC__
Expand All @@ -27,17 +28,17 @@ class EcalLaserAPDPNRatiosRefGPU {

// TODO: do this centrally
// get offset for hashes. equals number of barrel items
uint32_t getOffset() const { return valuesEB_.size(); }
uint32_t getOffset() const { return offset_; }
uint32_t offset_;

//
static std::string name() { return std::string{"ecalLaserAPDPNRatiosRefGPU"}; }

private:
std::vector<float> const& valuesEB_;
std::vector<float> const& valuesEE_;
std::vector<float, cms::cuda::HostAllocator<float>> values_;

cms::cuda::ESProduct<Product> product_;
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAPDPNRatiosRefGPU_h
#endif // CondFormats_EcalObjects_interface_EcalLaserAPDPNRatiosRefGPU_h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAlphasGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAlphasGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalLaserAlphasGPU_h
#define CondFormats_EcalObjects_interface_EcalLaserAlphasGPU_h

#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,8 +13,7 @@
class EcalLaserAlphasGPU {
public:
struct Product {
~Product();
float* values = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> values;
};

#ifndef __CUDACC__
Expand All @@ -27,17 +28,17 @@ class EcalLaserAlphasGPU {

// TODO: do this centrally
// get offset for hashes. equals number of barrel items
uint32_t getOffset() const { return valuesEB_.size(); }
uint32_t getOffset() const { return offset_; }

//
static std::string name() { return std::string{"ecalLaserAlphasGPU"}; }

private:
std::vector<float> const& valuesEB_;
std::vector<float> const& valuesEE_;
std::vector<float, cms::cuda::HostAllocator<float>> values_;
uint32_t offset_;

cms::cuda::ESProduct<Product> product_;
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalLaserAlphasGPU_h
#endif // CondFormats_EcalObjects_interface_EcalLaserAlphasGPU_h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalLinearCorrectionsGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalLinearCorrectionsGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalLinearCorrectionsGPU_h
#define CondFormats_EcalObjects_interface_EcalLinearCorrectionsGPU_h

#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,13 +13,12 @@
class EcalLinearCorrectionsGPU {
public:
struct Product {
~Product();
float *p1 = nullptr;
float *p2 = nullptr;
float *p3 = nullptr;
edm::TimeValue_t *t1 = nullptr;
edm::TimeValue_t *t2 = nullptr;
edm::TimeValue_t *t3 = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p1;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p2;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p3;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t1;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t2;
edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t3;
};

#ifndef __CUDACC__
Expand Down Expand Up @@ -50,4 +51,4 @@ class EcalLinearCorrectionsGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalLinearCorrectionsGPU_h
#endif // CondFormats_EcalObjects_interface_EcalLinearCorrectionsGPU_h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalMultifitParametersGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalMultifitParametersGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalMultifitParametersGPU_h
#define CondFormats_EcalObjects_interface_EcalMultifitParametersGPU_h

#include <array>

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -13,8 +15,10 @@
class EcalMultifitParametersGPU {
public:
struct Product {
~Product();
double *amplitudeFitParametersEB, *amplitudeFitParametersEE, *timeFitParametersEB, *timeFitParametersEE;
edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> amplitudeFitParametersEB;
edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> amplitudeFitParametersEE;
edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> timeFitParametersEB;
edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> timeFitParametersEE;
};

#ifndef __CUDACC__
Expand All @@ -36,4 +40,4 @@ class EcalMultifitParametersGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalMultifitParametersGPU_h
#endif // CondFormats_EcalObjects_interface_EcalMultifitParametersGPU_h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalPedestalsGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalPedestalsGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalPedestalsGPU_h
#define CondFormats_EcalObjects_interface_EcalPedestalsGPU_h

#include "CondFormats/EcalObjects/interface/EcalPedestals.h"
#include "FWCore/Utilities/interface/propagate_const_array.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"

#ifndef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
Expand All @@ -11,9 +13,12 @@
class EcalPedestalsGPU {
public:
struct Product {
~Product();
float *mean_x12 = nullptr, *mean_x6 = nullptr, *mean_x1 = nullptr;
float *rms_x12 = nullptr, *rms_x6 = nullptr, *rms_x1 = nullptr;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> mean_x12;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> mean_x6;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> mean_x1;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> rms_x12;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> rms_x6;
edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> rms_x1;
};

#ifndef __CUDACC__
Expand Down Expand Up @@ -44,4 +49,4 @@ class EcalPedestalsGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalPedestalsGPU_h
#endif // CondFormats_EcalObjects_interface_EcalPedestalsGPU_h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalPulseCovariancesGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalPulseCovariancesGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h
#define CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h

#include "CondFormats/EcalObjects/interface/EcalPulseCovariances.h"

Expand Down Expand Up @@ -37,4 +37,4 @@ class EcalPulseCovariancesGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalPulseCovariancesGPU_h
#endif // CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RecoLocalCalo_EcalRecAlgos_interface_EcalPulseShapesGPU_h
#define RecoLocalCalo_EcalRecAlgos_interface_EcalPulseShapesGPU_h
#ifndef CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h
#define CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h

#include "CondFormats/EcalObjects/interface/EcalPulseShapes.h"

Expand Down Expand Up @@ -37,4 +37,4 @@ class EcalPulseShapesGPU {
#endif // __CUDACC__
};

#endif // RecoLocalCalo_EcalRecAlgos_interface_EcalPulseShapesGPU_h
#endif // CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h
Loading