Skip to content

Commit

Permalink
Apply code formatting (cms-sw#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard authored Jul 31, 2020
1 parent 52bb988 commit 537f09e
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 105 deletions.
4 changes: 2 additions & 2 deletions CUDADataFormats/Common/interface/HeterogeneousSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class HeterogeneousSoA {

auto const &operator*() const { return *get(); }

auto const *operator-> () const { return get(); }
auto const *operator->() const { return get(); }

auto *get() { return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); }

auto &operator*() { return *get(); }

auto *operator-> () { return get(); }
auto *operator->() { return get(); }

// in reality valid only for GPU version...
cms::cuda::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const {
Expand Down
2 changes: 1 addition & 1 deletion CUDADataFormats/Common/interface/HostProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HostProduct {

auto const& operator*() const { return *get(); }

auto const* operator-> () const { return get(); }
auto const* operator->() const { return get(); }

private:
cms::cuda::host::unique_ptr<T> hm_ptr; //!
Expand Down
14 changes: 4 additions & 10 deletions RecoLocalCalo/HcalRecProducers/src/KernelHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
namespace hcal {
namespace reconstruction {


constexpr int32_t IPHI_MAX = 72;


// this is from HcalTimeSlew.
// HcalTimeSlew are values that come in from ESProducer that takes them
// from a python config. see DeclsForKernels for more explanation
Expand Down Expand Up @@ -73,7 +71,7 @@ namespace hcal {
HcalDetId did{didraw};
uint32_t const value = (did.depth() - 1) + maxDepthHB * (did.iphi() - 1);
return did.ieta() > 0 ? value + maxDepthHB * hcal::reconstruction::IPHI_MAX * (did.ieta() - firstHBRing)
: value + maxDepthHB * hcal::reconstruction::IPHI_MAX * (did.ieta() + lastHBRing + nEtaHB);
: value + maxDepthHB * hcal::reconstruction::IPHI_MAX * (did.ieta() + lastHBRing + nEtaHB);
}

__forceinline__ __device__ uint32_t did2linearIndexHE(uint32_t const didraw,
Expand Down Expand Up @@ -150,12 +148,11 @@ namespace hcal {

// FIXME remove duplication...
// this is from PulesFunctor. nvcc was complaining... if included that header...
//constexpr int maxSamples = 10;
//constexpr int maxSamples = 10;
constexpr int maxPSshapeBin = 256;
constexpr int nsPerBX = 25;
constexpr float iniTimeShift = 92.5f;


// TODO: remove what's not needed
__forceinline__ __device__ float compute_pulse_shape_value(float const pulse_time,
int const sample,
Expand All @@ -175,7 +172,7 @@ namespace hcal {

// FIXME: clean up all the rounding... this is coming from original cpu version
float const i_start_float =
-iniTimeShift - pulse_time - slew > 0.f ? 0.f : std::abs(-iniTimeShift - pulse_time - slew) + 1.f;
-iniTimeShift - pulse_time - slew > 0.f ? 0.f : std::abs(-iniTimeShift - pulse_time - slew) + 1.f;
int i_start = static_cast<int>(i_start_float);
float offset_start = static_cast<float>(i_start) - iniTimeShift - pulse_time - slew;
// FIXME: do we need a check for nan???
Expand Down Expand Up @@ -218,7 +215,7 @@ namespace hcal {
if (sample_over10ts == its_start) {
value = bin_0_start == -1
? accVarLenIdxMinusOneVec[distTo25ns_start] + factor * diffVarItvlIdxMinusOneVec[distTo25ns_start]
: accVarLenIdxZeroVec[distTo25ns_start] + factor * diffVarItvlIdxZeroVec[distTo25ns_start];
: accVarLenIdxZeroVec[distTo25ns_start] + factor * diffVarItvlIdxZeroVec[distTo25ns_start];
} else if (sample_over10ts > its_start) {
int const bin_idx = distTo25ns_start + 1 + (sample_over10ts - its_start - 1) * ns_per_bx + bin_0_start;
value = acc25nsVec[bin_idx] + factor * diff25nsItvlVec[bin_idx];
Expand All @@ -227,10 +224,7 @@ namespace hcal {
return value;
}



} // namespace reconstruction
} // namespace hcal


#endif // RecoLocalCalo_HcalRecProducers_src_KernelHelpers_h
Loading

0 comments on commit 537f09e

Please sign in to comment.