Skip to content

Commit

Permalink
add missing CUDA product files
Browse files Browse the repository at this point in the history
  • Loading branch information
bfonta committed Dec 18, 2020
1 parent e568726 commit 74df77d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CUDADataFormats/HGCal/src/RecHitGPUProduct.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "CUDADataFormats/HGCal/interface/RecHitGPUProduct.h"

RecHitGPUProduct::RecHitGPUProduct(const uint32_t& nhits, const cudaStream_t& stream): nhits_(nhits)
{
stride_ = ( (nhits-1)/32 + 1 ) * 32; //align to warp boundary

std::vector<int> sizes = { memory::npointers::float_hgcrechits_soa * sizeof(float),
memory::npointers::uint32_hgcrechits_soa * sizeof(uint32_t),
memory::npointers::uint8_hgcrechits_soa * sizeof(uint8_t) };
size_tot_ = std::accumulate( sizes.begin(), sizes.end(), 0);
ptr_ = cms::cuda::make_device_unique<std::byte[]>(stride_ * size_tot_, stream);
assert( sizes.begin() + memory::npointers::ntypes_hgcrechits_soa == sizes.end() );
}
9 changes: 9 additions & 0 deletions CUDADataFormats/HGCal/src/classes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef HGCRECHITSOA_CLASSES_H
#define HGCRECHITSOA_CLASSES_H

#include "CUDADataFormats/Common/interface/Product.h"
#include "DataFormats/Common/interface/Wrapper.h"
#include "CUDADataFormats/HGCal/interface/RecHitGPUProduct.h"
#include "CUDADataFormats/HGCal/interface/HGCRecHitSoA.h"

#endif //HGCRECHITSOA_CLASSES_H
7 changes: 7 additions & 0 deletions CUDADataFormats/HGCal/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<lcgdict>
<class name="cms::cuda::Product<RecHitGPUProduct>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<RecHitGPUProduct>>" persistent="false"/>

<class name="HGCRecHitSoA" persistent="false"/>
<class name="edm::Wrapper<HGCRecHitSoA>" persistent="false"/>
</lcgdict>

0 comments on commit 74df77d

Please sign in to comment.