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
 
SiPixelDigiErrorsCUDAoperator= (const SiPixelDigiErrorsCUDA &)=delete
 
SiPixelDigiErrorsCUDAoperator= (SiPixelDigiErrorsCUDA &&)=default
 
 SiPixelDigiErrorsCUDA ()=default
 
 SiPixelDigiErrorsCUDA (const SiPixelDigiErrorsCUDA &)=delete
 
 SiPixelDigiErrorsCUDA (SiPixelDigiErrorsCUDA &&)=default
 
 SiPixelDigiErrorsCUDA (size_t maxFedWords, SiPixelFormatterErrors errors, cudaStream_t stream)
 
 ~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
 

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.

11  error_d(cms::cuda::make_device_unique<SiPixelErrorCompactVector>(stream)),
12  error_h(cms::cuda::make_host_unique<SiPixelErrorCompactVector>(stream)),
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 }

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

◆ ~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 23 of file SiPixelDigiErrorsCUDA.cc.

23  {
25 }

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

◆ dataErrorToHostAsync()

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

Definition at line 27 of file SiPixelDigiErrorsCUDA.cc.

27  {
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 }

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

◆ error() [1/2]

SiPixelErrorCompactVector* SiPixelDigiErrorsCUDA::error ( )
inline

Definition at line 27 of file SiPixelDigiErrorsCUDA.h.

27 { return error_d.get(); }

References error_d.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

◆ error() [2/2]

SiPixelErrorCompactVector const* SiPixelDigiErrorsCUDA::error ( ) const
inline

Definition at line 28 of file SiPixelDigiErrorsCUDA.h.

28 { return error_d.get(); }

References error_d.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

◆ formatterErrors()

const SiPixelFormatterErrors& SiPixelDigiErrorsCUDA::formatterErrors ( ) const
inline

Definition at line 25 of file SiPixelDigiErrorsCUDA.h.

25 { return formatterErrors_h; }

References formatterErrors_h.

◆ 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 36 of file SiPixelDigiErrorsCUDA.h.

Referenced by dataErrorToHostAsync(), and SiPixelDigiErrorsCUDA().

◆ error_d

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

Definition at line 37 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 39 of file SiPixelDigiErrorsCUDA.h.

Referenced by formatterErrors().

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
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)
SiPixelErrorCompact
Definition: SiPixelErrorCompact.h:6
SiPixelDigiErrorsCUDA::formatterErrors_h
SiPixelFormatterErrors formatterErrors_h
Definition: SiPixelDigiErrorsCUDA.h:39
errors
Definition: errors.py:1
SiPixelDigiErrorsCUDA::HostDataError
std::pair< SiPixelErrorCompactVector, cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> > HostDataError
Definition: SiPixelDigiErrorsCUDA.h:30
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
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
eostools.move
def move(src, dest)
Definition: eostools.py:511
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
SiPixelDigiErrorsCUDA::error_h
cms::cuda::host::unique_ptr< SiPixelErrorCompactVector > error_h
Definition: SiPixelDigiErrorsCUDA.h:38
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20