Skip to content

Commit

Permalink
Apply code checks and code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Nov 29, 2019
1 parent 3422777 commit a2ead18
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ TrackingRecHit2DHeterogeneous<Traits>::TrackingRecHit2DHeterogeneous(uint32_t nH
(std::is_same<Traits, cudaCompat::GPUTraits>::value) {
cudautils::copyAsync(m_view, view, stream);
} else {
m_view.reset(view.release());
m_view.reset(view.release()); // NOLINT: std::move() breaks CUDA version
}
return;
}
Expand Down Expand Up @@ -138,7 +138,7 @@ TrackingRecHit2DHeterogeneous<Traits>::TrackingRecHit2DHeterogeneous(uint32_t nH
(std::is_same<Traits, cudaCompat::GPUTraits>::value) {
cudautils::copyAsync(m_view, view, stream);
} else {
m_view.reset(view.release());
m_view.reset(view.release()); // NOLINT: std::move() breaks CUDA version
}
}

Expand Down
4 changes: 1 addition & 3 deletions DataFormats/Math/test/testAtan2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ void testIntPhi() {
}

int main() {

constexpr float p2i = ((int)(std::numeric_limits<short>::max()) + 1) / M_PI;
constexpr float i2p = M_PI / ((int)(std::numeric_limits<short>::max()) + 1);
std::cout << std::hexfloat << "p2i i2p " << p2i <<" "<< i2p << std::defaultfloat << std::endl;

std::cout << std::hexfloat << "p2i i2p " << p2i << " " << i2p << std::defaultfloat << std::endl;

std::cout << unsafe_atan2f<5>(0.f, 0.f) << " " << std::atan2(0., 0.) << std::endl;
std::cout << unsafe_atan2f<5>(0.5f, 0.5f) << " " << std::atan2(0.5, 0.5) << std::endl;
Expand Down
8 changes: 4 additions & 4 deletions HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace cudautils {
inline void launchZero(Histo *__restrict__ h,
cudaStream_t stream
#ifndef __CUDACC__
= 0
= cudaStreamDefault
#endif
) {
uint32_t *off = (uint32_t *)((char *)(h) + offsetof(Histo, off));
Expand All @@ -72,12 +72,12 @@ namespace cudautils {
inline void launchFinalize(Histo *__restrict__ h,
uint8_t *__restrict__ ws
#ifndef __CUDACC__
= nullptr
= cudaStreamDefault
#endif
,
cudaStream_t stream
#ifndef __CUDACC__
= 0
= cudaStreamDefault
#endif
) {
#ifdef __CUDACC__
Expand All @@ -101,7 +101,7 @@ namespace cudautils {
int nthreads,
cudaStream_t stream
#ifndef __CUDACC__
= 0
= cudaStreamDefault
#endif
) {
launchZero(h, stream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void PixelCPEFastESProducer::fillDescriptions(edm::ConfigurationDescriptions& de
desc.add<bool>("LoadTemplatesFromDB", true);
desc.add<bool>("UseErrorsFromTemplates", true);
desc.add<double>("EdgeClusterErrorX", 50.0);
desc.add<edm::ESInputTag>("MagneticFieldRecord", edm::ESInputTag("",""));
desc.add<edm::ESInputTag>("MagneticFieldRecord", edm::ESInputTag());
desc.add<bool>("useLAWidthFromDB", true);
desc.add<bool>("TruncatePixelCharge", true);
desc.add<int>("ClusterProbComputationFlag", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void SiPixelRecHitSoAFromLegacy::produce(edm::StreamID streamID, edm::Event& iEv
output->hitsLayerStart()[i] = hitsModuleStart[cpeView.layerGeometry().layerStart[i]];
}
cudautils::fillManyFromVector(
output->phiBinner(), nullptr, 10, output->iphi(), output->hitsLayerStart(), numberOfHits, 256, 0);
output->phiBinner(), nullptr, 10, output->iphi(), output->hitsLayerStart(), numberOfHits, 256, nullptr);

// std::cout << "created HitSoa for " << numberOfClusters << " clusters in " << numberOfDetUnits << " Dets" << std::endl;
iEvent.put(std::move(output));
Expand Down
3 changes: 1 addition & 2 deletions RecoLocalTracker/SiPixelRecHits/src/PixelCPEFast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,4 @@ LocalError PixelCPEFast::localError(DetParam const& theDetParam, ClusterParam& t
return LocalError(xerr_sq, 0, yerr_sq);
}

void PixelCPEFast::fillPSetDescription(edm::ParameterSetDescription& desc) {
}
void PixelCPEFast::fillPSetDescription(edm::ParameterSetDescription& desc) {}
2 changes: 1 addition & 1 deletion RecoPixelVertexing/PixelTriplets/plugins/CAConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace CAConstants {
constexpr uint32_t maxCellsPerHit() { return 128 / 2; }
#endif
#else
constexpr uint32_t maxNumberOfDoublets() { return 2*1024 * 1024; }
constexpr uint32_t maxNumberOfDoublets() { return 2 * 1024 * 1024; }
constexpr uint32_t maxCellsPerHit() { return 8 * 128; }
#endif
constexpr uint32_t maxNumOfActiveDoublets() { return maxNumberOfDoublets() / 4; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ __global__ void kernel_find_ntuplets(GPUCACell::Hits const *__restrict__ hhp,
GPUCACell::TmpTuple stack;
stack.reset();
thisCell.find_ntuplets(hh, cells, *cellTracks, *foundNtuplets, *apc, quality, stack, minHitsPerNtuplet, pid < 3);
assert(stack.size() == 0);
assert(stack.empty());
// printf("in %d found quadruplets: %d\n", cellIndex, apc->get());
}
}
Expand Down
16 changes: 10 additions & 6 deletions RecoPixelVertexing/PixelTriplets/plugins/gpuPixelDoubletsAlgos.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,20 @@ namespace gpuPixelDoubletsAlgos {
auto mo = hh.detectorIndex(oi);
if (mo > 2000)
continue; // invalid

if (doZ0Cut && z0cutoff(oi)) continue;

if (doZ0Cut && z0cutoff(oi))
continue;

auto mop = hh.iphi(oi);
uint16_t idphi = std::min(std::abs(int16_t(mop - mep)), std::abs(int16_t(mep - mop)));
if (idphi > iphicut) continue;
if (idphi > iphicut)
continue;

if (doClusterCut && zsizeCut(oi))
continue;
if (doPtCut && ptcut(oi, idphi))
continue;

if (doClusterCut && zsizeCut(oi)) continue;
if (doPtCut && ptcut(oi, idphi)) continue;

auto ind = atomicAdd(nCells, 1);
if (ind >= maxNumOfDoublets) {
atomicSub(nCells, 1);
Expand Down

0 comments on commit a2ead18

Please sign in to comment.