CMS 3D CMS Logo

CAHitNtupletGeneratorKernelsAlloc.cc
Go to the documentation of this file.
2 
4 
5 template <>
6 #ifdef __CUDACC__
8 #else
10 #endif
11  // ALLOCATIONS FOR THE INTERMEDIATE RESULTS (STAYS ON WORKER)
14 
15  device_theCellNeighbors_ = Traits::template make_unique<caConstants::CellNeighborsVector>(stream);
16  device_theCellTracks_ = Traits::template make_unique<caConstants::CellTracksVector>(stream);
17 
18 #ifdef GPU_DEBUG
19  std::cout << "Allocation for tuple building. N hits " << nHits << std::endl;
20 #endif
21 
22  nHits++; // storage requires one more counter;
23  assert(nHits > 0);
24  device_hitToTuple_ = Traits::template make_unique<HitToTuple>(stream);
25  device_hitToTupleStorage_ = Traits::template make_unique<HitToTuple::Counter[]>(nHits, stream);
29 
30  device_tupleMultiplicity_ = Traits::template make_unique<TupleMultiplicity>(stream);
31 
32  device_storage_ = Traits::template make_unique<cms::cuda::AtomicPairCounter::c_type[]>(3, stream);
33 
36  device_nCells_ = (uint32_t*)(device_storage_.get() + 2);
37 
38  // FIXME: consider collapsing these 3 in one adhoc kernel
40  cudaCheck(cudaMemsetAsync(device_nCells_, 0, sizeof(uint32_t), stream));
41  } else {
42  *device_nCells_ = 0;
43  }
44  cms::cuda::launchZero(device_tupleMultiplicity_.get(), stream);
45  cms::cuda::launchZero(hitToTupleView_, stream); // we may wish to keep it in the edm
46 #ifdef GPU_DEBUG
47  cudaDeviceSynchronize();
48  cudaCheck(cudaGetLastError());
49 #endif
50 }
cms::cuda::OneToManyAssocView::assoc
Assoc * assoc
Definition: OneToManyAssoc.h:27
cms::cuda::OneToManyAssocView::offSize
int32_t offSize
Definition: OneToManyAssoc.h:30
cms::cuda::OneToManyAssocView::offStorage
Counter * offStorage
Definition: OneToManyAssoc.h:28
CAHitNtupletGeneratorKernels::device_hitTuple_apc_
cms::cuda::AtomicPairCounter * device_hitTuple_apc_
Definition: CAHitNtupletGeneratorKernels.h:217
CAHitNtupletGeneratorKernels::allocateOnGPU
void allocateOnGPU(int32_t nHits, cudaStream_t stream)
Definition: CAHitNtupletGeneratorKernelsAlloc.cc:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CAHitNtupletGeneratorKernels.h
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
cms::cuda::assert
assert(be >=bs)
CAHitNtupletGeneratorKernels::device_theCellTracks_
unique_ptr< caConstants::CellTracksVector > device_theCellTracks_
Definition: CAHitNtupletGeneratorKernels.h:204
CAHitNtupletGeneratorKernels::device_theCellNeighbors_
unique_ptr< caConstants::CellNeighborsVector > device_theCellNeighbors_
Definition: CAHitNtupletGeneratorKernels.h:202
CAHitNtupletGeneratorKernels::device_nCells_
uint32_t * device_nCells_
Definition: CAHitNtupletGeneratorKernels.h:209
CAHitNtupletGeneratorKernels::device_tupleMultiplicity_
unique_ptr< TupleMultiplicity > device_tupleMultiplicity_
Definition: CAHitNtupletGeneratorKernels.h:219
CAHitNtupletGeneratorKernels::device_hitToTuple_apc_
cms::cuda::AtomicPairCounter * device_hitToTuple_apc_
Definition: CAHitNtupletGeneratorKernels.h:215
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
CAHitNtupletGeneratorKernels::device_hitToTuple_
unique_ptr< HitToTuple > device_hitToTuple_
Definition: CAHitNtupletGeneratorKernels.h:211
CAHitNtupletGeneratorKernels::device_storage_
unique_ptr< cms::cuda::AtomicPairCounter::c_type[]> device_storage_
Definition: CAHitNtupletGeneratorKernels.h:221
cms::cuda::AtomicPairCounter
Definition: AtomicPairCounter.h:11
cudaCheck.h
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
CAHitNtupletGeneratorKernels::hitToTupleView_
HitToTuple::View hitToTupleView_
Definition: CAHitNtupletGeneratorKernels.h:213
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CAHitNtupletGeneratorKernels::device_hitToTupleStorage_
unique_ptr< HitToTuple::Counter[]> device_hitToTupleStorage_
Definition: CAHitNtupletGeneratorKernels.h:212