DPC++ Runtime
Runtime libraries for oneAPI DPC++
_pi_event Struct Reference

PI Event mapping to CUevent. More...

#include <cuda/pi_cuda.hpp>

Inheritance diagram for _pi_event:
Collaboration diagram for _pi_event:

Public Types

using native_type = CUevent
 
using native_type = hipEvent_t
 

Public Member Functions

pi_result record ()
 
pi_result wait ()
 
pi_result start ()
 
native_type get () const noexcept
 
pi_queue get_queue () const noexcept
 
CUstream get_stream () const noexcept
 
pi_uint32 get_compute_stream_token () const noexcept
 
pi_command_type get_command_type () const noexcept
 
pi_uint32 get_reference_count () const noexcept
 
bool is_recorded () const noexcept
 
bool is_started () const noexcept
 
bool is_completed () const noexcept
 
pi_int32 get_execution_status () const noexcept
 
pi_context get_context () const noexcept
 
pi_uint32 increment_reference_count ()
 
pi_uint32 decrement_reference_count ()
 
pi_uint32 get_event_id () const noexcept
 
bool backend_has_ownership () const noexcept
 
pi_uint64 get_queued_time () const
 
pi_uint64 get_start_time () const
 
pi_uint64 get_end_time () const
 
pi_result release ()
 
 ~_pi_event ()
 
 _pi_event ()
 
pi_result record ()
 
pi_result wait ()
 
pi_result start ()
 
native_type get () const noexcept
 
pi_queue get_queue () const noexcept
 
hipStream_t get_stream () const noexcept
 
pi_uint32 get_compute_stream_token () const noexcept
 
pi_command_type get_command_type () const noexcept
 
pi_uint32 get_reference_count () const noexcept
 
bool is_recorded () const noexcept
 
bool is_started () const noexcept
 
bool is_completed () const noexcept
 
pi_int32 get_execution_status () const noexcept
 
pi_context get_context () const noexcept
 
pi_uint32 increment_reference_count ()
 
pi_uint32 decrement_reference_count ()
 
pi_uint32 get_event_id () const noexcept
 
pi_uint64 get_queued_time () const
 
pi_uint64 get_start_time () const
 
pi_uint64 get_end_time () const
 
pi_result release ()
 
 ~_pi_event ()
 
 _pi_event (ze_event_handle_t ZeEvent, ze_event_pool_handle_t ZeEventPool, pi_context Context, pi_command_type CommandType, bool OwnZeEvent)
 
bool isHostVisible () const
 
pi_result getOrCreateHostVisibleEvent (ze_event_handle_t &HostVisibleEvent)
 
bool isProfilingEnabled () const
 
bool hasExternalRefs ()
 
pi_result reset ()
 
- Public Member Functions inherited from _pi_object
 _pi_object ()
 
virtual ~_pi_object ()=default
 
 _pi_object ()
 

Static Public Member Functions

static pi_event make_native (pi_command_type type, pi_queue queue, CUstream stream, pi_uint32 stream_token=std::numeric_limits< pi_uint32 >::max())
 
static pi_event make_with_native (pi_context context, CUevent eventNative)
 
static pi_event make_native (pi_command_type type, pi_queue queue, hipStream_t stream, pi_uint32 stream_token=std::numeric_limits< pi_uint32 >::max())
 

Public Attributes

cm_support::CmEvent * CmEventPtr = nullptr
 
cm_support::CmQueue * OwnerQueue = nullptr
 
pi_context Context = nullptr
 
bool IsDummyEvent = false
 
ze_event_handle_t ZeEvent
 
bool OwnZeEvent
 
ze_event_pool_handle_t ZeEventPool
 
pi_event HostVisibleEvent = {nullptr}
 
pi_queue Queue = {nullptr}
 
pi_command_type CommandType
 
void * CommandData
 
_pi_ze_event_list_t WaitList
 
bool CleanedUp = {false}
 
bool Completed = {false}
 
bool IsDiscarded = {false}
 
std::atomic< pi_uint32RefCountExternal {0}
 
- Public Attributes inherited from _pi_object
std::atomic< pi_uint32RefCount
 
ReferenceCounter RefCount
 
pi_shared_mutex Mutex
 

Detailed Description

PI Event mapping to CUevent.

PI Event mapping to hipEvent_t.

Definition at line 608 of file pi_cuda.hpp.

Member Typedef Documentation

◆ native_type [1/2]

Definition at line 610 of file pi_cuda.hpp.

◆ native_type [2/2]

using _pi_event::native_type = hipEvent_t

Definition at line 587 of file pi_hip.hpp.

Constructor & Destructor Documentation

◆ ~_pi_event() [1/2]

_pi_event::~_pi_event ( )

Definition at line 517 of file pi_cuda.cpp.

References cuda_piContextRelease(), and cuda_piQueueRelease().

◆ _pi_event() [1/2]

_pi_event::_pi_event ( )
inline

Definition at line 202 of file pi_esimd_emulator.hpp.

Referenced by make_native(), and make_with_native().

◆ ~_pi_event() [2/2]

_pi_event::~_pi_event ( )

◆ _pi_event() [2/2]

_pi_event::_pi_event ( ze_event_handle_t  ZeEvent,
ze_event_pool_handle_t  ZeEventPool,
pi_context  Context,
pi_command_type  CommandType,
bool  OwnZeEvent 
)
inline

Definition at line 1222 of file pi_level_zero.hpp.

Member Function Documentation

◆ backend_has_ownership()

bool _pi_event::backend_has_ownership ( ) const
inlinenoexcept

Definition at line 656 of file pi_cuda.hpp.

Referenced by release().

◆ decrement_reference_count() [1/2]

pi_uint32 _pi_event::decrement_reference_count ( )
inline

Definition at line 652 of file pi_cuda.hpp.

◆ decrement_reference_count() [2/2]

pi_uint32 _pi_event::decrement_reference_count ( )
inline

Definition at line 629 of file pi_hip.hpp.

◆ get() [1/2]

native_type _pi_event::get ( ) const
inlinenoexcept

Definition at line 618 of file pi_cuda.hpp.

◆ get() [2/2]

native_type _pi_event::get ( ) const
inlinenoexcept

Definition at line 595 of file pi_hip.hpp.

◆ get_command_type() [1/2]

pi_command_type _pi_event::get_command_type ( ) const
inlinenoexcept

Definition at line 626 of file pi_cuda.hpp.

◆ get_command_type() [2/2]

pi_command_type _pi_event::get_command_type ( ) const
inlinenoexcept

Definition at line 603 of file pi_hip.hpp.

◆ get_compute_stream_token() [1/2]

pi_uint32 _pi_event::get_compute_stream_token ( ) const
inlinenoexcept

Definition at line 624 of file pi_cuda.hpp.

Referenced by _pi_queue::get_next_compute_stream().

◆ get_compute_stream_token() [2/2]

pi_uint32 _pi_event::get_compute_stream_token ( ) const
inlinenoexcept

Definition at line 601 of file pi_hip.hpp.

◆ get_context() [1/2]

pi_context _pi_event::get_context ( ) const
inlinenoexcept

Definition at line 648 of file pi_cuda.hpp.

Referenced by cuda_piEventsWait(), and hip_piEventsWait().

◆ get_context() [2/2]

pi_context _pi_event::get_context ( ) const
inlinenoexcept

Definition at line 625 of file pi_hip.hpp.

◆ get_end_time() [1/2]

pi_uint64 _pi_event::get_end_time ( ) const

Definition at line 577 of file pi_cuda.cpp.

References _pi_platform::evBase_, is_recorded(), and is_started().

◆ get_end_time() [2/2]

pi_uint64 _pi_event::get_end_time ( ) const

◆ get_event_id() [1/2]

pi_uint32 _pi_event::get_event_id ( ) const
inlinenoexcept

Definition at line 654 of file pi_cuda.hpp.

◆ get_event_id() [2/2]

pi_uint32 _pi_event::get_event_id ( ) const
inlinenoexcept

Definition at line 631 of file pi_hip.hpp.

◆ get_execution_status() [1/2]

pi_int32 _pi_event::get_execution_status ( ) const
inlinenoexcept

◆ get_execution_status() [2/2]

pi_int32 _pi_event::get_execution_status ( ) const
inlinenoexcept

◆ get_queue() [1/2]

pi_queue _pi_event::get_queue ( ) const
inlinenoexcept

Definition at line 620 of file pi_cuda.hpp.

◆ get_queue() [2/2]

pi_queue _pi_event::get_queue ( ) const
inlinenoexcept

Definition at line 597 of file pi_hip.hpp.

◆ get_queued_time() [1/2]

pi_uint64 _pi_event::get_queued_time ( ) const

Definition at line 559 of file pi_cuda.cpp.

References _pi_platform::evBase_, and is_started().

◆ get_queued_time() [2/2]

pi_uint64 _pi_event::get_queued_time ( ) const

◆ get_reference_count() [1/2]

pi_uint32 _pi_event::get_reference_count ( ) const
inlinenoexcept

Definition at line 628 of file pi_cuda.hpp.

◆ get_reference_count() [2/2]

pi_uint32 _pi_event::get_reference_count ( ) const
inlinenoexcept

Definition at line 605 of file pi_hip.hpp.

◆ get_start_time() [1/2]

pi_uint64 _pi_event::get_start_time ( ) const

Definition at line 568 of file pi_cuda.cpp.

References _pi_platform::evBase_, and is_started().

◆ get_start_time() [2/2]

pi_uint64 _pi_event::get_start_time ( ) const

◆ get_stream() [1/2]

CUstream _pi_event::get_stream ( ) const
inlinenoexcept

Definition at line 622 of file pi_cuda.hpp.

Referenced by _pi_queue::get_next_compute_stream().

◆ get_stream() [2/2]

hipStream_t _pi_event::get_stream ( ) const
inlinenoexcept

Definition at line 599 of file pi_hip.hpp.

◆ getOrCreateHostVisibleEvent()

pi_result _pi_event::getOrCreateHostVisibleEvent ( ze_event_handle_t HostVisibleEvent)

◆ hasExternalRefs()

bool _pi_event::hasExternalRefs ( )
inline

Definition at line 1309 of file pi_level_zero.hpp.

◆ increment_reference_count() [1/2]

pi_uint32 _pi_event::increment_reference_count ( )
inline

Definition at line 650 of file pi_cuda.hpp.

◆ increment_reference_count() [2/2]

pi_uint32 _pi_event::increment_reference_count ( )
inline

Definition at line 627 of file pi_hip.hpp.

◆ is_completed() [1/2]

bool _pi_event::is_completed ( ) const
noexcept

Definition at line 542 of file pi_cuda.cpp.

Referenced by get_execution_status().

◆ is_completed() [2/2]

bool _pi_event::is_completed ( ) const
noexcept

◆ is_recorded() [1/2]

bool _pi_event::is_recorded ( ) const
inlinenoexcept

Definition at line 630 of file pi_cuda.hpp.

Referenced by get_end_time(), get_execution_status(), and record().

◆ is_recorded() [2/2]

bool _pi_event::is_recorded ( ) const
inlinenoexcept

Definition at line 607 of file pi_hip.hpp.

◆ is_started() [1/2]

bool _pi_event::is_started ( ) const
inlinenoexcept

Definition at line 632 of file pi_cuda.hpp.

Referenced by get_end_time(), get_queued_time(), get_start_time(), record(), and start().

◆ is_started() [2/2]

bool _pi_event::is_started ( ) const
inlinenoexcept

Definition at line 609 of file pi_hip.hpp.

◆ isHostVisible()

◆ isProfilingEnabled()

bool _pi_event::isProfilingEnabled ( ) const
inline

◆ make_native() [1/2]

◆ make_native() [2/2]

static pi_event _pi_event::make_native ( pi_command_type  type,
pi_queue  queue,
hipStream_t  stream,
pi_uint32  stream_token = std::numeric_limits<pi_uint32>::max() 
)
inlinestatic

Definition at line 647 of file pi_hip.hpp.

References _pi_event(), and _pi_queue::get_context().

◆ make_with_native()

static pi_event _pi_event::make_with_native ( pi_context  context,
CUevent  eventNative 
)
inlinestatic

Definition at line 678 of file pi_cuda.hpp.

References _pi_event().

Referenced by cuda_piextEventCreateWithNativeHandle().

◆ record() [1/2]

pi_result _pi_event::record ( )

◆ record() [2/2]

pi_result _pi_event::record ( )

◆ release() [1/2]

◆ release() [2/2]

pi_result _pi_event::release ( )

◆ reset()

◆ start() [1/2]

pi_result _pi_event::start ( )

Definition at line 524 of file pi_cuda.cpp.

References is_started(), PI_QUEUE_PROFILING_ENABLE, and _pi_queue::properties_.

◆ start() [2/2]

pi_result _pi_event::start ( )

◆ wait() [1/2]

pi_result _pi_event::wait ( )

Definition at line 616 of file pi_cuda.cpp.

◆ wait() [2/2]

pi_result _pi_event::wait ( )

Member Data Documentation

◆ CleanedUp

bool _pi_event::CleanedUp = {false}

◆ CmEventPtr

cm_support::CmEvent* _pi_event::CmEventPtr = nullptr

Definition at line 204 of file pi_esimd_emulator.hpp.

Referenced by piEventRelease(), and piEventsWait().

◆ CommandData

void* _pi_event::CommandData

Definition at line 1269 of file pi_level_zero.hpp.

Referenced by CleanupCompletedEvent(), and piEventReleaseInternal().

◆ CommandType

pi_command_type _pi_event::CommandType

◆ Completed

bool _pi_event::Completed = {false}

Definition at line 1287 of file pi_level_zero.hpp.

Referenced by piEventGetInfo(), and _pi_queue::synchronize().

◆ Context

pi_context _pi_event::Context = nullptr

◆ HostVisibleEvent

◆ IsDiscarded

◆ IsDummyEvent

bool _pi_event::IsDummyEvent = false

Definition at line 207 of file pi_esimd_emulator.hpp.

Referenced by piEventRelease().

◆ OwnerQueue

cm_support::CmQueue* _pi_event::OwnerQueue = nullptr

Definition at line 205 of file pi_esimd_emulator.hpp.

Referenced by piEventRelease().

◆ OwnZeEvent

bool _pi_event::OwnZeEvent

Definition at line 1232 of file pi_level_zero.hpp.

Referenced by piEventReleaseInternal().

◆ Queue

◆ RefCountExternal

std::atomic<pi_uint32> _pi_event::RefCountExternal {0}

Definition at line 1307 of file pi_level_zero.hpp.

Referenced by piEventRelease(), and piEventRetain().

◆ WaitList

_pi_ze_event_list_t _pi_event::WaitList

Definition at line 1275 of file pi_level_zero.hpp.

Referenced by CleanupCompletedEvent().

◆ ZeEvent

◆ ZeEventPool

ze_event_pool_handle_t _pi_event::ZeEventPool

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