CMS 3D CMS Logo

ChannelLocsGPU.cc
Go to the documentation of this file.
1 #include <cassert>
2 
3 #include <cuda_runtime.h>
6 
7 #include "ChannelLocsGPU.h"
8 
10  if (size > 0) {
11  input_ = cms::cuda::make_host_unique<const uint8_t*[]>(size, stream);
12  inoff_ = cms::cuda::make_host_unique<size_t[]>(size, stream);
13  offset_ = cms::cuda::make_host_unique<size_t[]>(size, stream);
14  length_ = cms::cuda::make_host_unique<uint16_t[]>(size, stream);
15  fedID_ = cms::cuda::make_host_unique<stripgpu::fedId_t[]>(size, stream);
16  fedCh_ = cms::cuda::make_host_unique<stripgpu::fedCh_t[]>(size, stream);
17  detID_ = cms::cuda::make_host_unique<stripgpu::detId_t[]>(size, stream);
18  }
19 }
20 
22  input_ = c.input();
23  inoff_ = c.inoff();
24  offset_ = c.offset();
25  length_ = c.length();
26  fedID_ = c.fedID();
27  fedCh_ = c.fedCh();
28  detID_ = c.detID();
29  size_ = c.size();
30 }
31 
33  if (size > 0) {
34  input_ = cms::cuda::make_device_unique<const uint8_t*[]>(size, stream);
35  inoff_ = cms::cuda::make_device_unique<size_t[]>(size, stream);
36  offset_ = cms::cuda::make_device_unique<size_t[]>(size, stream);
37  length_ = cms::cuda::make_device_unique<uint16_t[]>(size, stream);
38  fedID_ = cms::cuda::make_device_unique<stripgpu::fedId_t[]>(size, stream);
39  fedCh_ = cms::cuda::make_device_unique<stripgpu::fedCh_t[]>(size, stream);
40  detID_ = cms::cuda::make_device_unique<stripgpu::detId_t[]>(size, stream);
41 
42  auto channelLocsView = cms::cuda::make_host_unique<ChannelLocsView>(stream);
43  channelLocsView->fill(*this);
44  channelLocsViewGPU_ = cms::cuda::make_device_unique<ChannelLocsView>(stream);
46  }
47 }
48 
50  cms::cuda::host::unique_ptr<const uint8_t*[]> inputGPU,
51  cudaStream_t stream) {
52  assert(c->size() == size_);
60 }
size
Write out results.
stripgpu::detId_t * detID_
stripgpu::fedCh_t * fedCh_
stripgpu::fedId_t * fedID_
cms::cuda::host::unique_ptr< stripgpu::fedId_t[]> fedID_
const ChannelLocsView * channelLocsView() const
const uint8_t *const * input_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
assert(be >=bs)
void setVals(const ChannelLocs *c, cms::cuda::host::unique_ptr< const uint8_t *[]> inputGPU, cudaStream_t stream)
cms::cuda::host::unique_ptr< size_t[]> inoff_
cms::cuda::host::unique_ptr< stripgpu::fedCh_t[]> fedCh_
cms::cuda::host::unique_ptr< const uint8_t *[]> input_
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
ChannelLocsGPU(size_t size, cudaStream_t stream)
cms::cuda::device::unique_ptr< ChannelLocsView > channelLocsViewGPU_
void fill(const ChannelLocsGPU &c)
cms::cuda::host::unique_ptr< stripgpu::detId_t[]> detID_
std::unique_ptr< T, impl::HostDeleter > unique_ptr
cms::cuda::host::unique_ptr< uint16_t[]> length_
uint16_t * length_
cms::cuda::host::unique_ptr< size_t[]> offset_
ChannelLocs(size_t size, cudaStream_t stream)