CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
PortableDeviceObject< T, TDev, typename > Class Template Reference

#include <PortableDeviceObject.h>

Public Types

using Buffer = cms::alpakatools::device_buffer< TDev, Product >
 
using ConstBuffer = cms::alpakatools::const_device_buffer< TDev, Product >
 
using Product = T
 

Public Member Functions

Buffer buffer ()
 
ConstBuffer buffer () const
 
ConstBuffer const_buffer () const
 
Productdata ()
 
Product const * data () const
 
Productoperator* ()
 
Product const & operator* () const
 
Productoperator-> ()
 
Product const * operator-> () const
 
PortableDeviceObjectoperator= (PortableDeviceObject const &)=delete
 
PortableDeviceObjectoperator= (PortableDeviceObject &&)=default
 
 PortableDeviceObject ()=default
 
 PortableDeviceObject (TDev const &device)
 
template<typename TQueue , typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
 PortableDeviceObject (TQueue const &queue)
 
 PortableDeviceObject (PortableDeviceObject const &)=delete
 
 PortableDeviceObject (PortableDeviceObject &&)=default
 
Productvalue ()
 
Product const & value () const
 
 ~PortableDeviceObject ()=default
 

Private Attributes

std::optional< Bufferbuffer_
 

Detailed Description

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
class PortableDeviceObject< T, TDev, typename >

Definition at line 15 of file PortableDeviceObject.h.

Member Typedef Documentation

◆ Buffer

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
using PortableDeviceObject< T, TDev, typename >::Buffer = cms::alpakatools::device_buffer<TDev, Product>

Definition at line 21 of file PortableDeviceObject.h.

◆ ConstBuffer

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
using PortableDeviceObject< T, TDev, typename >::ConstBuffer = cms::alpakatools::const_device_buffer<TDev, Product>

Definition at line 22 of file PortableDeviceObject.h.

◆ Product

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
using PortableDeviceObject< T, TDev, typename >::Product = T

Definition at line 20 of file PortableDeviceObject.h.

Constructor & Destructor Documentation

◆ PortableDeviceObject() [1/5]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject< T, TDev, typename >::PortableDeviceObject ( )
default

◆ PortableDeviceObject() [2/5]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject< T, TDev, typename >::PortableDeviceObject ( TDev const &  device)
inline

Definition at line 26 of file PortableDeviceObject.h.

28  : buffer_{cms::alpakatools::make_device_buffer<Product>(device)} {
29  assert(reinterpret_cast<uintptr_t>(buffer_->data()) % alignof(Product) == 0);
30  }
assert(be >=bs)
std::optional< Buffer > buffer_

◆ PortableDeviceObject() [3/5]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
template<typename TQueue , typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
PortableDeviceObject< T, TDev, typename >::PortableDeviceObject ( TQueue const &  queue)
inline

Definition at line 33 of file PortableDeviceObject.h.

References createBeamHaloJobs::queue.

35  : buffer_{cms::alpakatools::make_device_buffer<Product>(queue)} {
36  assert(reinterpret_cast<uintptr_t>(buffer_->data()) % alignof(Product) == 0);
37  }
assert(be >=bs)
std::optional< Buffer > buffer_

◆ PortableDeviceObject() [4/5]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject< T, TDev, typename >::PortableDeviceObject ( PortableDeviceObject< T, TDev, typename > const &  )
delete

◆ PortableDeviceObject() [5/5]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject< T, TDev, typename >::PortableDeviceObject ( PortableDeviceObject< T, TDev, typename > &&  )
default

◆ ~PortableDeviceObject()

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject< T, TDev, typename >::~PortableDeviceObject ( )
default

Member Function Documentation

◆ buffer() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Buffer PortableDeviceObject< T, TDev, typename >::buffer ( )
inline

◆ buffer() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
ConstBuffer PortableDeviceObject< T, TDev, typename >::buffer ( ) const
inline

Definition at line 65 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

65 { return *buffer_; }
std::optional< Buffer > buffer_

◆ const_buffer()

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
ConstBuffer PortableDeviceObject< T, TDev, typename >::const_buffer ( ) const
inline

Definition at line 66 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

66 { return *buffer_; }
std::optional< Buffer > buffer_

◆ data() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product* PortableDeviceObject< T, TDev, typename >::data ( )
inline

Definition at line 54 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

54 { return buffer_->data(); }
std::optional< Buffer > buffer_

◆ data() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product const* PortableDeviceObject< T, TDev, typename >::data ( ) const
inline

Definition at line 55 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

55 { return buffer_->data(); }
std::optional< Buffer > buffer_

◆ operator*() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product& PortableDeviceObject< T, TDev, typename >::operator* ( void  )
inline

Definition at line 57 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

57 { return *buffer_->data(); }
std::optional< Buffer > buffer_

◆ operator*() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product const& PortableDeviceObject< T, TDev, typename >::operator* ( void  ) const
inline

Definition at line 58 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

58 { return *buffer_->data(); }
std::optional< Buffer > buffer_

◆ operator->() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product* PortableDeviceObject< T, TDev, typename >::operator-> ( )
inline

Definition at line 60 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

60 { return buffer_->data(); }
std::optional< Buffer > buffer_

◆ operator->() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product const* PortableDeviceObject< T, TDev, typename >::operator-> ( ) const
inline

Definition at line 61 of file PortableDeviceObject.h.

References PortableDeviceObject< T, TDev, typename >::buffer_.

61 { return buffer_->data(); }
std::optional< Buffer > buffer_

◆ operator=() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject& PortableDeviceObject< T, TDev, typename >::operator= ( PortableDeviceObject< T, TDev, typename > const &  )
delete

◆ operator=() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
PortableDeviceObject& PortableDeviceObject< T, TDev, typename >::operator= ( PortableDeviceObject< T, TDev, typename > &&  )
default

◆ value() [1/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product& PortableDeviceObject< T, TDev, typename >::value ( )
inline

◆ value() [2/2]

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
Product const& PortableDeviceObject< T, TDev, typename >::value ( ) const
inline

Member Data Documentation

◆ buffer_

template<typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>>
std::optional<Buffer> PortableDeviceObject< T, TDev, typename >::buffer_
private