Skip to content

Commit

Permalink
Got rid of some cudaStreamSynchronize.
Browse files Browse the repository at this point in the history
  • Loading branch information
hatakeyamak committed Oct 11, 2022
1 parent c2e26b3 commit d90e911
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ void PFClusterProducerCudaHCAL::acquire(edm::Event const& event,
cudaCheck(cudaMemcpyAsync(
outputCPU.pfrh_topoId.get(), outputGPU.pfrh_topoId.get(), numbytes_int, cudaMemcpyDeviceToHost, cudaStream));

if (cudaStreamQuery(cudaStream) != cudaSuccess)
cudaCheck(cudaStreamSynchronize(cudaStream));
// if (cudaStreamQuery(cudaStream) != cudaSuccess)
// cudaCheck(cudaStreamSynchronize(cudaStream));
}

void PFClusterProducerCudaHCAL::produce(edm::Event& event, const edm::EventSetup& setup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ void PFHBHERecHitProducerGPU::acquire(edm::Event const& event,
// Initialize Cuda constants
PFRecHit::HCAL::initializeCudaConstants(cudaConstants, ctx.stream());

if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
cudaCheck(cudaStreamSynchronize(ctx.stream()));
// if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
// cudaCheck(cudaStreamSynchronize(ctx.stream()));

initCuda = false;
}
Expand All @@ -339,8 +339,8 @@ void PFHBHERecHitProducerGPU::acquire(edm::Event const& event,
GPU_timers.fill(0.0);
PFRecHit::HCAL::entryPoint(HBHERecHitSoA, cudaConstants, outputGPU, persistentDataGPU, scratchDataGPU, ctx.stream(), GPU_timers);

if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
cudaCheck(cudaStreamSynchronize(ctx.stream()));
// if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
// cudaCheck(cudaStreamSynchronize(ctx.stream()));

if (!produceLegacy_ && !produceCleanedLegacy_) return; // do device->host transfer only when we are producing Legacy data

Expand All @@ -360,8 +360,9 @@ void PFHBHERecHitProducerGPU::acquire(edm::Event const& event,
lambdaToTransferSize(tmpPFRecHits.pfrh_neighbours, outputGPU.PFRecHits.pfrh_neighbours.get(), 8 * num_rechits);
lambdaToTransferSize(tmpPFRecHits.pfrh_time, outputGPU.PFRecHits.pfrh_time.get(), num_rechits);
lambdaToTransferSize(tmpPFRecHits.pfrh_energy, outputGPU.PFRecHits.pfrh_energy.get(), num_rechits);
if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
cudaCheck(cudaStreamSynchronize(ctx.stream()));
// if (cudaStreamQuery(ctx.stream()) != cudaSuccess)
// cudaCheck(cudaStreamSynchronize(ctx.stream()));

}

void PFHBHERecHitProducerGPU::produce(edm::Event& event, edm::EventSetup const& setup) {
Expand Down

0 comments on commit d90e911

Please sign in to comment.