CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CAHitNtupletGeneratorKernelsAlloc.cc
Go to the documentation of this file.
2 
4 
5 template <>
6 #ifdef __CUDACC__
8 #else
9 void CAHitNtupletGeneratorKernelsCPU::allocateOnGPU(int32_t nHits, cudaStream_t stream) {
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);
27  hitToTupleView_.offStorage = device_hitToTupleStorage_.get();
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 }
unique_ptr< HitToTuple > device_hitToTuple_
unique_ptr< HitToTuple::Counter[]> device_hitToTupleStorage_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
assert(be >=bs)
void allocateOnGPU(int32_t nHits, cudaStream_t stream)
unique_ptr< caConstants::CellNeighborsVector > device_theCellNeighbors_
cms::cuda::AtomicPairCounter * device_hitTuple_apc_
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
unique_ptr< cms::cuda::AtomicPairCounter::c_type[]> device_storage_
__device__ __host__ Counters get() const
tuple cout
Definition: gather_cfg.py:144
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
unique_ptr< caConstants::CellTracksVector > device_theCellTracks_
def template
Definition: svgfig.py:521
unique_ptr< TupleMultiplicity > device_tupleMultiplicity_
cms::cuda::AtomicPairCounter * device_hitToTuple_apc_