CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)),
11  error_d(cms::cuda::make_device_unique<SiPixelErrorCompactVector>(stream)),
12  error_h(cms::cuda::make_host_unique<SiPixelErrorCompactVector>(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 }
void memsetAsync(device::unique_ptr< T > &ptr, T value, cudaStream_t stream)
Definition: memsetAsync.h:12
cms::cuda::host::unique_ptr< SiPixelErrorCompactVector > error_h
SimpleVector< T > make_SimpleVector(int capacity, T *data)
Definition: SimpleVector.h:124
std::pair< SiPixelErrorCompactVector, cms::cuda::host::unique_ptr< SiPixelErrorCompact[]>> HostDataError
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
assert(be >=bs)
cms::cuda::device::unique_ptr< SiPixelErrorCompact[]> data_d
cms::cuda::device::unique_ptr< SiPixelErrorCompactVector > error_d
std::map< cms_uint32_t, std::vector< SiPixelRawDataError >> SiPixelFormatterErrors
def move
Definition: eostools.py:511
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
HostDataError dataErrorToHostAsync(cudaStream_t stream) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
device::impl::make_device_unique_selector< T >::non_array make_device_unique(cudaStream_t stream)
void copyErrorToHostAsync(cudaStream_t stream)
host::impl::make_host_unique_selector< T >::non_array make_host_unique(cudaStream_t stream)
SiPixelDigiErrorsCUDA()=default