CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiPixelDigiErrorsCUDA Class Reference

#include <SiPixelDigiErrorsCUDA.h>

Public Types

using HostDataError = std::pair< SiPixelErrorCompactVector, cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> >
 
using SiPixelErrorCompactVector = cms::cuda::SimpleVector< SiPixelErrorCompact >
 

Public Member Functions

void copyErrorToHostAsync (cudaStream_t stream)
 
HostDataError dataErrorToHostAsync (cudaStream_t stream) const
 
SiPixelErrorCompactVectorerror ()
 
SiPixelErrorCompactVector const * error () const
 
const SiPixelFormatterErrorsformatterErrors () const
 
int nErrorWords () const
 
SiPixelDigiErrorsCUDAoperator= (const SiPixelDigiErrorsCUDA &)=delete
 
SiPixelDigiErrorsCUDAoperator= (SiPixelDigiErrorsCUDA &&)=default
 
 SiPixelDigiErrorsCUDA ()=default
 
 SiPixelDigiErrorsCUDA (size_t maxFedWords, SiPixelFormatterErrors errors, cudaStream_t stream)
 
 SiPixelDigiErrorsCUDA (const SiPixelDigiErrorsCUDA &)=delete
 
 SiPixelDigiErrorsCUDA (SiPixelDigiErrorsCUDA &&)=default
 
 ~SiPixelDigiErrorsCUDA ()=default
 

Private Attributes

cms::cuda::device::unique_ptr< SiPixelErrorCompact[]> data_d
 
cms::cuda::device::unique_ptr< SiPixelErrorCompactVectorerror_d
 
cms::cuda::host::unique_ptr< SiPixelErrorCompactVectorerror_h
 
SiPixelFormatterErrors formatterErrors_h
 
int nErrorWords_ = 0
 

Detailed Description

Definition at line 12 of file SiPixelDigiErrorsCUDA.h.

Member Typedef Documentation

◆ HostDataError

Definition at line 30 of file SiPixelDigiErrorsCUDA.h.

◆ SiPixelErrorCompactVector

Definition at line 14 of file SiPixelDigiErrorsCUDA.h.

Constructor & Destructor Documentation

◆ SiPixelDigiErrorsCUDA() [1/4]

SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA ( )
default

◆ SiPixelDigiErrorsCUDA() [2/4]

SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA ( size_t  maxFedWords,
SiPixelFormatterErrors  errors,
cudaStream_t  stream 
)
explicit

Definition at line 9 of file SiPixelDigiErrorsCUDA.cc.

References cms::cuda::assert(), cms::cuda::copyAsync(), data_d, error_d, error_h, cms::cuda::make_SimpleVector(), cms::cuda::memsetAsync(), and cms::cuda::stream.

11  error_d(cms::cuda::make_device_unique<SiPixelErrorCompactVector>(stream)),
12  error_h(cms::cuda::make_host_unique<SiPixelErrorCompactVector>(stream)),
14  nErrorWords_(maxFedWords) {
15  assert(maxFedWords != 0);
16  cms::cuda::memsetAsync(data_d, 0x00, maxFedWords, stream);
17 
18  cms::cuda::make_SimpleVector(error_h.get(), maxFedWords, data_d.get());
19  assert(error_h->empty());
20  assert(error_h->capacity() == static_cast<int>(maxFedWords));
21 
23 }
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
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
SiPixelFormatterErrors formatterErrors_h
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
device::impl::make_device_unique_selector< T >::non_array make_device_unique(cudaStream_t stream)
Definition: errors.py:1
def move(src, dest)
Definition: eostools.py:511

◆ ~SiPixelDigiErrorsCUDA()

SiPixelDigiErrorsCUDA::~SiPixelDigiErrorsCUDA ( )
default

◆ SiPixelDigiErrorsCUDA() [3/4]

SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA ( const SiPixelDigiErrorsCUDA )
delete

◆ SiPixelDigiErrorsCUDA() [4/4]

SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA ( SiPixelDigiErrorsCUDA &&  )
default

Member Function Documentation

◆ copyErrorToHostAsync()

void SiPixelDigiErrorsCUDA::copyErrorToHostAsync ( cudaStream_t  stream)

Definition at line 25 of file SiPixelDigiErrorsCUDA.cc.

References cms::cuda::copyAsync(), error_d, error_h, and cms::cuda::stream.

25  {
27 }
cms::cuda::host::unique_ptr< SiPixelErrorCompactVector > error_h
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
cms::cuda::device::unique_ptr< SiPixelErrorCompactVector > error_d
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20

◆ dataErrorToHostAsync()

SiPixelDigiErrorsCUDA::HostDataError SiPixelDigiErrorsCUDA::dataErrorToHostAsync ( cudaStream_t  stream) const

Definition at line 29 of file SiPixelDigiErrorsCUDA.cc.

References cms::cuda::copyAsync(), data, data_d, submitPVResolutionJobs::err, error_h, eostools::move(), and cms::cuda::stream.

29  {
30  // On one hand size() could be sufficient. On the other hand, if
31  // someone copies the SimpleVector<>, (s)he might expect the data
32  // buffer to actually have space for capacity() elements.
33  auto data = cms::cuda::make_host_unique<SiPixelErrorCompact[]>(error_h->capacity(), stream);
34 
35  // but transfer only the required amount
36  if (not error_h->empty()) {
38  }
39  auto err = *error_h;
40  err.set_data(data.get());
41  return HostDataError(err, std::move(data));
42 }
cms::cuda::host::unique_ptr< SiPixelErrorCompactVector > error_h
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
cms::cuda::device::unique_ptr< SiPixelErrorCompact[]> data_d
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
def move(src, dest)
Definition: eostools.py:511

◆ error() [1/2]

SiPixelErrorCompactVector* SiPixelDigiErrorsCUDA::error ( )
inline

Definition at line 27 of file SiPixelDigiErrorsCUDA.h.

References error_d.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

27 { return error_d.get(); }
cms::cuda::device::unique_ptr< SiPixelErrorCompactVector > error_d

◆ error() [2/2]

SiPixelErrorCompactVector const* SiPixelDigiErrorsCUDA::error ( ) const
inline

Definition at line 28 of file SiPixelDigiErrorsCUDA.h.

References error_d.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

28 { return error_d.get(); }
cms::cuda::device::unique_ptr< SiPixelErrorCompactVector > error_d

◆ formatterErrors()

const SiPixelFormatterErrors& SiPixelDigiErrorsCUDA::formatterErrors ( ) const
inline

Definition at line 25 of file SiPixelDigiErrorsCUDA.h.

References formatterErrors_h.

25 { return formatterErrors_h; }
SiPixelFormatterErrors formatterErrors_h

◆ nErrorWords()

int SiPixelDigiErrorsCUDA::nErrorWords ( ) const
inline

Definition at line 34 of file SiPixelDigiErrorsCUDA.h.

References nErrorWords_.

◆ operator=() [1/2]

SiPixelDigiErrorsCUDA& SiPixelDigiErrorsCUDA::operator= ( const SiPixelDigiErrorsCUDA )
delete

◆ operator=() [2/2]

SiPixelDigiErrorsCUDA& SiPixelDigiErrorsCUDA::operator= ( SiPixelDigiErrorsCUDA &&  )
default

Member Data Documentation

◆ data_d

cms::cuda::device::unique_ptr<SiPixelErrorCompact[]> SiPixelDigiErrorsCUDA::data_d
private

Definition at line 37 of file SiPixelDigiErrorsCUDA.h.

Referenced by dataErrorToHostAsync(), and SiPixelDigiErrorsCUDA().

◆ error_d

cms::cuda::device::unique_ptr<SiPixelErrorCompactVector> SiPixelDigiErrorsCUDA::error_d
private

Definition at line 38 of file SiPixelDigiErrorsCUDA.h.

Referenced by copyErrorToHostAsync(), error(), and SiPixelDigiErrorsCUDA().

◆ error_h

cms::cuda::host::unique_ptr<SiPixelErrorCompactVector> SiPixelDigiErrorsCUDA::error_h
private

◆ formatterErrors_h

SiPixelFormatterErrors SiPixelDigiErrorsCUDA::formatterErrors_h
private

Definition at line 40 of file SiPixelDigiErrorsCUDA.h.

Referenced by formatterErrors().

◆ nErrorWords_

int SiPixelDigiErrorsCUDA::nErrorWords_ = 0
private

Definition at line 41 of file SiPixelDigiErrorsCUDA.h.

Referenced by nErrorWords().