CMS 3D CMS Logo

SiPixelDigiErrorsCUDA.cc
Go to the documentation of this file.
1 #include <cassert>
2 
8 
10  : data_d(cms::cuda::make_device_unique<SiPixelErrorCompact[]>(maxFedWords, stream)),
13  formatterErrors_h(std::move(errors)) {
14  cms::cuda::memsetAsync(data_d, 0x00, maxFedWords, stream);
15 
16  cms::cuda::make_SimpleVector(error_h.get(), maxFedWords, data_d.get());
17  assert(error_h->empty());
18  assert(error_h->capacity() == static_cast<int>(maxFedWords));
19 
21 }
22 
25 }
26 
28  // On one hand size() could be sufficient. On the other hand, if
29  // someone copies the SimpleVector<>, (s)he might expect the data
30  // buffer to actually have space for capacity() elements.
31  auto data = cms::cuda::make_host_unique<SiPixelErrorCompact[]>(error_h->capacity(), stream);
32 
33  // but transfer only the required amount
34  if (not error_h->empty()) {
36  }
37  auto err = *error_h;
38  err.set_data(data.get());
39  return HostDataError(err, std::move(data));
40 }
cms::cuda::make_device_unique
device::impl::make_device_unique_selector< T >::non_array make_device_unique(cudaStream_t stream)
Definition: device_unique_ptr.h:52
memsetAsync.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)
device_unique_ptr.h
SiPixelDigiErrorsCUDA::dataErrorToHostAsync
HostDataError dataErrorToHostAsync(cudaStream_t stream) const
Definition: SiPixelDigiErrorsCUDA.cc:27
cms::cuda::SimpleVector< SiPixelErrorCompact >
SiPixelErrorCompact
Definition: SiPixelErrorCompact.h:6
errors
Definition: errors.py:1
host_unique_ptr.h
SiPixelDigiErrorsCUDA::HostDataError
std::pair< SiPixelErrorCompactVector, cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> > HostDataError
Definition: SiPixelDigiErrorsCUDA.h:30
SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA
SiPixelDigiErrorsCUDA()=default
cms::cuda::memsetAsync
void memsetAsync(device::unique_ptr< T > &ptr, T value, cudaStream_t stream)
Definition: memsetAsync.h:12
cms::cuda::make_SimpleVector
SimpleVector< T > make_SimpleVector(int capacity, T *data)
Definition: SimpleVector.h:124
SiPixelDigiErrorsCUDA.h
copyAsync.h
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
SiPixelDigiErrorsCUDA::copyErrorToHostAsync
void copyErrorToHostAsync(cudaStream_t stream)
Definition: SiPixelDigiErrorsCUDA.cc:23
SiPixelDigiErrorsCUDA::data_d
cms::cuda::device::unique_ptr< SiPixelErrorCompact[]> data_d
Definition: SiPixelDigiErrorsCUDA.h:36
SiPixelDigiErrorsCUDA::error_d
cms::cuda::device::unique_ptr< SiPixelErrorCompactVector > error_d
Definition: SiPixelDigiErrorsCUDA.h:37
ecalDigis_cff.cuda
cuda
Definition: ecalDigis_cff.py:35
SiPixelDigiErrorsCUDA::error_h
cms::cuda::host::unique_ptr< SiPixelErrorCompactVector > error_h
Definition: SiPixelDigiErrorsCUDA.h:38
SiPixelFormatterErrors
std::map< cms_uint32_t, std::vector< SiPixelRawDataError > > SiPixelFormatterErrors
Definition: SiPixelFormatterErrors.h:10
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cms::cuda::make_host_unique
host::impl::make_host_unique_selector< T >::non_array make_host_unique(cudaStream_t stream)
Definition: host_unique_ptr.h:41
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20