Skip to content

Commit

Permalink
Fixing PhaseII Patatrack failures
Browse files Browse the repository at this point in the history
- tests in TrackingRecHit2DCUDA_t
- wf 39434.502 due to esconsumes in SiPixelPhase2DigiToClusterCUDA
  • Loading branch information
AdrianoDee committed Dec 28, 2021
1 parent 5cc0e67 commit 4184826
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
17 changes: 12 additions & 5 deletions CUDADataFormats/TrackingRecHit/test/TrackingRecHit2DCUDA_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ int main() {
cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));

auto nHits = 200;
auto nModules = 2000;
// inner scope to deallocate memory before destroying the stream
{
TrackingRecHit2DGPU tkhit(nHits, nModules, 0, nullptr, nullptr, stream);

TrackingRecHit2DGPU tkhit(nHits, false, 0, nullptr, nullptr, stream);
testTrackingRecHit2D::runKernels(tkhit.view());

TrackingRecHit2DHost tkhitH(nHits, nModules, 0, nullptr, nullptr, stream, &tkhit);
TrackingRecHit2DGPU tkhitPhase2(nHits, true, 0, nullptr, nullptr, stream);
testTrackingRecHit2D::runKernels(tkhitPhase2.view());

TrackingRecHit2DHost tkhitH(nHits, false, 0, nullptr, nullptr, stream, &tkhit);
cudaStreamSynchronize(stream);
assert(tkhitH.view());
assert(tkhitH.view()->nHits() == unsigned(nHits));
assert(tkhitH.view()->nMaxModules() == unsigned(nModules));
assert(tkhitH.view()->nMaxModules() == 1856);

TrackingRecHit2DHost tkhitHPhase2(nHits, true, 0, nullptr, nullptr, stream, &tkhit);
cudaStreamSynchronize(stream);
assert(tkhitHPhase2.view());
assert(tkhitHPhase2.view()->nHits() == unsigned(nHits));
assert(tkhitHPhase2.view()->nMaxModules() == 3892);
}

cudaCheck(cudaStreamDestroy(stream));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class SiPixelPhase2DigiToClusterCUDA : public edm::stream::EDProducer<edm::Exter
edm::WaitingTaskWithArenaHolder waitingTaskHolder) override;
void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;

const edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> pixelDigiToken_;
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_;
const edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> pixelDigiToken_;

edm::EDPutTokenT<cms::cuda::Product<SiPixelDigisCUDA>> digiPutToken_;
edm::EDPutTokenT<cms::cuda::Product<SiPixelDigiErrorsCUDA>> digiErrorPutToken_;
Expand All @@ -71,7 +71,8 @@ class SiPixelPhase2DigiToClusterCUDA : public edm::stream::EDProducer<edm::Exter
};

SiPixelPhase2DigiToClusterCUDA::SiPixelPhase2DigiToClusterCUDA(const edm::ParameterSet& iConfig)
: pixelDigiToken_(consumes<edm::DetSetVector<PixelDigi>>(iConfig.getParameter<edm::InputTag>("InputDigis"))),
: geomToken_(esConsumes()),
pixelDigiToken_(consumes<edm::DetSetVector<PixelDigi>>(iConfig.getParameter<edm::InputTag>("InputDigis"))),
digiPutToken_(produces<cms::cuda::Product<SiPixelDigisCUDA>>()),
clusterPutToken_(produces<cms::cuda::Product<SiPixelClustersCUDA>>()),
includeErrors_(iConfig.getParameter<bool>("IncludeErrors")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ namespace gpuCalibPixel {
if (invalidModuleId == id[i])
continue;

printf("%d %d %d \n", id[i], adc[i]);
constexpr int mode = (Phase2ReadoutMode < -1 ? -1 : Phase2ReadoutMode);

if constexpr (mode < 0)
Expand Down

0 comments on commit 4184826

Please sign in to comment.