1 #ifndef DataFormats_Portable_interface_PortableDeviceObject_h 2 #define DataFormats_Portable_interface_PortableDeviceObject_h 8 #include <alpaka/alpaka.hpp> 14 template <
typename T,
typename TDev,
typename = std::enable_if_t<alpaka::isDevice<TDev>>>
16 static_assert(not std::is_same_v<TDev, alpaka_common::DevHost>,
17 "Use PortableHostObject<T> instead of PortableDeviceObject<T, DevHost>");
28 :
buffer_{cms::alpakatools::make_device_buffer<Product>(device)} {
32 template <
typename TQueue,
typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
35 :
buffer_{cms::alpakatools::make_device_buffer<Product>(
queue)} {
71 template <
typename TQueue,
typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
73 alpaka::memset(std::forward<TQueue>(
queue), *
buffer_, 0x00);
80 #endif // DataFormats_Portable_interface_PortableDeviceObject_h Product const & operator*() const
PortableDeviceObject(TQueue const &queue)
~PortableDeviceObject()=default
Product const & value() const
ConstBuffer buffer() const
PortableDeviceObject()=default
PortableDeviceObject(TDev const &device)
cms::alpakatools::device_buffer< TDev, Product > Buffer
void zeroInitialise(TQueue &&queue)
Product const * data() const
std::optional< Buffer > buffer_
ConstBuffer const_buffer() const
cms::alpakatools::const_device_buffer< TDev, Product > ConstBuffer
Product const * const_data() const
PortableDeviceObject & operator=(PortableDeviceObject const &)=delete
Product const & const_value() const
Product const * operator->() const