CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HeterogeneousSoA< T > Class Template Reference

#include <HeterogeneousSoA.h>

Public Types

using Product = T
 

Public Member Functions

auto const * get () const
 
auto * get ()
 
 HeterogeneousSoA ()=default
 
 HeterogeneousSoA (HeterogeneousSoA &&)=default
 
 HeterogeneousSoA (cms::cuda::device::unique_ptr< T > &&p)
 
 HeterogeneousSoA (cms::cuda::host::unique_ptr< T > &&p)
 
 HeterogeneousSoA (std::unique_ptr< T > &&p)
 
auto const & operator* () const
 
auto & operator* ()
 
auto const * operator-> () const
 
auto * operator-> ()
 
HeterogeneousSoAoperator= (HeterogeneousSoA &&)=default
 
cms::cuda::host::unique_ptr< TtoHostAsync (cudaStream_t stream) const
 
 ~HeterogeneousSoA ()=default
 

Private Attributes

cms::cuda::device::unique_ptr< Tdm_ptr
 
cms::cuda::host::unique_ptr< Thm_ptr
 
std::unique_ptr< Tstd_ptr
 

Detailed Description

template<typename T>
class HeterogeneousSoA< T >

Definition at line 13 of file HeterogeneousSoA.h.

Member Typedef Documentation

◆ Product

template<typename T >
using HeterogeneousSoA< T >::Product = T

Definition at line 15 of file HeterogeneousSoA.h.

Constructor & Destructor Documentation

◆ HeterogeneousSoA() [1/5]

template<typename T >
HeterogeneousSoA< T >::HeterogeneousSoA ( )
default

◆ ~HeterogeneousSoA()

template<typename T >
HeterogeneousSoA< T >::~HeterogeneousSoA ( )
default

◆ HeterogeneousSoA() [2/5]

template<typename T >
HeterogeneousSoA< T >::HeterogeneousSoA ( HeterogeneousSoA< T > &&  )
default

◆ HeterogeneousSoA() [3/5]

template<typename T >
HeterogeneousSoA< T >::HeterogeneousSoA ( cms::cuda::device::unique_ptr< T > &&  p)
inlineexplicit

Definition at line 22 of file HeterogeneousSoA.h.

22 : dm_ptr(std::move(p)) {}
cms::cuda::device::unique_ptr< T > dm_ptr
def move(src, dest)
Definition: eostools.py:511

◆ HeterogeneousSoA() [4/5]

template<typename T >
HeterogeneousSoA< T >::HeterogeneousSoA ( cms::cuda::host::unique_ptr< T > &&  p)
inlineexplicit

Definition at line 23 of file HeterogeneousSoA.h.

23 : hm_ptr(std::move(p)) {}
cms::cuda::host::unique_ptr< T > hm_ptr
def move(src, dest)
Definition: eostools.py:511

◆ HeterogeneousSoA() [5/5]

template<typename T >
HeterogeneousSoA< T >::HeterogeneousSoA ( std::unique_ptr< T > &&  p)
inlineexplicit

Definition at line 24 of file HeterogeneousSoA.h.

24 : std_ptr(std::move(p)) {}
std::unique_ptr< T > std_ptr
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ get() [1/2]

template<typename T >
auto const* HeterogeneousSoA< T >::get ( ) const
inline

◆ get() [2/2]

template<typename T >
auto* HeterogeneousSoA< T >::get ( )
inline

◆ operator*() [1/2]

template<typename T >
auto const& HeterogeneousSoA< T >::operator* ( ) const
inline

Definition at line 28 of file HeterogeneousSoA.h.

28 { return *get(); }

◆ operator*() [2/2]

template<typename T >
auto& HeterogeneousSoA< T >::operator* ( )
inline

Definition at line 34 of file HeterogeneousSoA.h.

34 { return *get(); }

◆ operator->() [1/2]

template<typename T >
auto const* HeterogeneousSoA< T >::operator-> ( ) const
inline

Definition at line 30 of file HeterogeneousSoA.h.

30 { return get(); }

◆ operator->() [2/2]

template<typename T >
auto* HeterogeneousSoA< T >::operator-> ( )
inline

Definition at line 36 of file HeterogeneousSoA.h.

36 { return get(); }

◆ operator=()

template<typename T >
HeterogeneousSoA& HeterogeneousSoA< T >::operator= ( HeterogeneousSoA< T > &&  )
default

◆ toHostAsync()

template<typename T >
cms::cuda::host::unique_ptr<T> HeterogeneousSoA< T >::toHostAsync ( cudaStream_t  stream) const
inline

Definition at line 39 of file HeterogeneousSoA.h.

References cms::cuda::assert(), cudaCheck, HeterogeneousSoA< T >::dm_ptr, runTheMatrix::ret, and cms::cuda::stream.

39  {
40  assert(dm_ptr);
41  auto ret = cms::cuda::make_host_unique<T>(stream);
42  cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream));
43  return ret;
44  }
ret
prodAgent to be discontinued
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< T > dm_ptr
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
long double T

Member Data Documentation

◆ dm_ptr

template<typename T >
cms::cuda::device::unique_ptr<T> HeterogeneousSoA< T >::dm_ptr
private

◆ hm_ptr

template<typename T >
cms::cuda::host::unique_ptr<T> HeterogeneousSoA< T >::hm_ptr
private

Definition at line 49 of file HeterogeneousSoA.h.

Referenced by HeterogeneousSoA< T >::get().

◆ std_ptr

template<typename T >
std::unique_ptr<T> HeterogeneousSoA< T >::std_ptr
private

Definition at line 50 of file HeterogeneousSoA.h.

Referenced by HeterogeneousSoA< T >::get().