alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::onHost::cpu::Event< T_Device > Struct Template Reference

#include <Event.hpp>

Inheritance diagram for alpaka::onHost::cpu::Event< T_Device >:

Public Member Functions

 Event (Event &&)=delete
 Event (Event const &)=delete
 Event (internal::concepts::DeviceHandle auto device, uint32_t const idx)
 ~Event ()
bool operator!= (Event const &other) const
Eventoperator= (Event &&)=delete
Eventoperator= (Event const &)=delete
bool operator== (Event const &other) const

Private Member Functions

auto getDevice () const
auto getDeviceKind () const
std::string getName () const
std::shared_ptr< EventgetSharedPtr ()
bool isEventComplete () noexcept
 Check if the event is complete.
bool isReady () noexcept
 Check if the event is ready.
void wait ()

Private Attributes

Handle< T_Device > m_device
std::size_t m_enqueueCount = 0u
 The time this event has been ready the last time. Ready means that the event was not waiting within a queue (not enqueued or already completed). If m_enqueueCount == m_LastReadyEnqueueCount, the event is currently not enqueued.
std::shared_future< void > m_future
 The number of times this event has been enqueued.
uint32_t m_idx = 0u
 The mutex used to synchronize access to the event.
std::size_t m_LastReadyEnqueueCount = 0u
std::mutex m_mutex
 The future signaling the event completion.

Friends

struct alpaka::internal::GetApi
struct alpaka::internal::GetDeviceType
struct alpaka::internal::GetName
struct internal::Enqueue
struct internal::GetNativeHandle
struct internal::IsEventComplete
struct internal::Wait
struct internal::WaitFor
struct onHost::internal::GetDevice

Detailed Description

template<typename T_Device>
struct alpaka::onHost::cpu::Event< T_Device >

Definition at line 25 of file Event.hpp.

Constructor & Destructor Documentation

◆ Event() [1/3]

template<typename T_Device>
alpaka::onHost::cpu::Event< T_Device >::Event ( internal::concepts::DeviceHandle auto device,
uint32_t const idx )
inline

Definition at line 28 of file Event.hpp.

◆ ~Event()

template<typename T_Device>
alpaka::onHost::cpu::Event< T_Device >::~Event ( )
inline

Definition at line 35 of file Event.hpp.

◆ Event() [2/3]

template<typename T_Device>
alpaka::onHost::cpu::Event< T_Device >::Event ( Event< T_Device > const & )
delete

◆ Event() [3/3]

template<typename T_Device>
alpaka::onHost::cpu::Event< T_Device >::Event ( Event< T_Device > && )
delete

Member Function Documentation

◆ getDevice()

template<typename T_Device>
auto alpaka::onHost::cpu::Event< T_Device >::getDevice ( ) const
inlineprivate

Definition at line 89 of file Event.hpp.

◆ getDeviceKind()

template<typename T_Device>
auto alpaka::onHost::cpu::Event< T_Device >::getDeviceKind ( ) const
inlineprivate

Definition at line 84 of file Event.hpp.

◆ getName()

template<typename T_Device>
std::string alpaka::onHost::cpu::Event< T_Device >::getName ( ) const
inlineprivate

Definition at line 75 of file Event.hpp.

◆ getSharedPtr()

template<typename T_Device>
std::shared_ptr< Event > alpaka::onHost::cpu::Event< T_Device >::getSharedPtr ( )
inlineprivate

Definition at line 94 of file Event.hpp.

◆ isEventComplete()

template<typename T_Device>
bool alpaka::onHost::cpu::Event< T_Device >::isEventComplete ( )
inlineprivatenoexcept

Check if the event is complete.

Attention
Should not be called if the event lock is acquired, because it could lead to a deadlock.
Returns
true if the event is complete, false otherwise

Definition at line 121 of file Event.hpp.

◆ isReady()

template<typename T_Device>
bool alpaka::onHost::cpu::Event< T_Device >::isReady ( )
inlineprivatenoexcept

Check if the event is ready.

Attention
Do not call this method without holding the event lock.
Returns
true if the event is ready, false otherwise

Definition at line 109 of file Event.hpp.

◆ operator!=()

template<typename T_Device>
bool alpaka::onHost::cpu::Event< T_Device >::operator!= ( Event< T_Device > const & other) const
inline

Definition at line 52 of file Event.hpp.

◆ operator=() [1/2]

template<typename T_Device>
Event & alpaka::onHost::cpu::Event< T_Device >::operator= ( Event< T_Device > && )
delete

◆ operator=() [2/2]

template<typename T_Device>
Event & alpaka::onHost::cpu::Event< T_Device >::operator= ( Event< T_Device > const & )
delete

◆ operator==()

template<typename T_Device>
bool alpaka::onHost::cpu::Event< T_Device >::operator== ( Event< T_Device > const & other) const
inline

Definition at line 47 of file Event.hpp.

◆ wait()

template<typename T_Device>
void alpaka::onHost::cpu::Event< T_Device >::wait ( )
inlineprivate

Definition at line 131 of file Event.hpp.

◆ alpaka::internal::GetApi

template<typename T_Device>
friend struct alpaka::internal::GetApi
friend

Definition at line 146 of file Event.hpp.

◆ alpaka::internal::GetDeviceType

template<typename T_Device>
friend struct alpaka::internal::GetDeviceType
friend

Definition at line 82 of file Event.hpp.

◆ alpaka::internal::GetName

template<typename T_Device>
friend struct alpaka::internal::GetName
friend

Definition at line 73 of file Event.hpp.

◆ internal::Enqueue

template<typename T_Device>
friend struct internal::Enqueue
friend

Definition at line 81 of file Event.hpp.

◆ internal::GetNativeHandle

template<typename T_Device>
friend struct internal::GetNativeHandle
friend

Definition at line 80 of file Event.hpp.

◆ internal::IsEventComplete

template<typename T_Device>
friend struct internal::IsEventComplete
friend

Definition at line 101 of file Event.hpp.

◆ internal::Wait

template<typename T_Device>
friend struct internal::Wait
friend

Definition at line 129 of file Event.hpp.

◆ internal::WaitFor

template<typename T_Device>
friend struct internal::WaitFor
friend

Definition at line 128 of file Event.hpp.

◆ onHost::internal::GetDevice

template<typename T_Device>
friend struct onHost::internal::GetDevice
friend

Definition at line 99 of file Event.hpp.

Member Data Documentation

◆ m_device

template<typename T_Device>
Handle<T_Device> alpaka::onHost::cpu::Event< T_Device >::m_device
private

Definition at line 58 of file Event.hpp.

◆ m_enqueueCount

template<typename T_Device>
std::size_t alpaka::onHost::cpu::Event< T_Device >::m_enqueueCount = 0u
private

The time this event has been ready the last time. Ready means that the event was not waiting within a queue (not enqueued or already completed). If m_enqueueCount == m_LastReadyEnqueueCount, the event is currently not enqueued.

Definition at line 66 of file Event.hpp.

◆ m_future

template<typename T_Device>
std::shared_future<void> alpaka::onHost::cpu::Event< T_Device >::m_future
private

The number of times this event has been enqueued.

Definition at line 64 of file Event.hpp.

◆ m_idx

template<typename T_Device>
uint32_t alpaka::onHost::cpu::Event< T_Device >::m_idx = 0u
private

The mutex used to synchronize access to the event.

Definition at line 59 of file Event.hpp.

◆ m_LastReadyEnqueueCount

template<typename T_Device>
std::size_t alpaka::onHost::cpu::Event< T_Device >::m_LastReadyEnqueueCount = 0u
private

Definition at line 71 of file Event.hpp.

◆ m_mutex

template<typename T_Device>
std::mutex alpaka::onHost::cpu::Event< T_Device >::m_mutex
mutableprivate

The future signaling the event completion.

Definition at line 62 of file Event.hpp.


The documentation for this struct was generated from the following file: