ExecutionState Class Reference

HiCR: HiCR::backend::ascend::ExecutionState Class Reference
HiCR
HiCR::backend::ascend::ExecutionState Class Referencefinal

#include <executionState.hpp>

Inheritance diagram for HiCR::backend::ascend::ExecutionState:
HiCR::ExecutionState

Public Member Functions

 ExecutionState (const std::shared_ptr< HiCR::ExecutionUnit > executionUnit)
 
 ~ExecutionState ()=default
 
__INLINE__ void setStream (const aclrtStream stream)
 
__INLINE__ void finalizeStream ()
 
- Public Member Functions inherited from HiCR::ExecutionState
__INLINE__ void resume ()
 
__INLINE__ void suspend ()
 
__INLINE__ bool checkFinalization ()
 
__INLINE__ state_t getState ()
 
 ExecutionState ()=delete
 

Protected Member Functions

__INLINE__ void resumeImpl () override
 
__INLINE__ void suspendImpl ()
 
__INLINE__ bool checkFinalizationImpl () override
 
- Protected Member Functions inherited from HiCR::ExecutionState
 ExecutionState (const std::shared_ptr< HiCR::ExecutionUnit > &executionUnit)
 

Additional Inherited Members

- Public Types inherited from HiCR::ExecutionState
enum  state_t {
  uninitialized , initialized , running , suspended ,
  finished
}
 

Detailed Description

This class represents the execution state of a stream of kernel for the Ascend backend. Since kernels are not preemptible, it does not offer suspend/resume functionality.

Constructor & Destructor Documentation

◆ ExecutionState()

HiCR::backend::ascend::ExecutionState::ExecutionState ( const std::shared_ptr< HiCR::ExecutionUnit executionUnit)
inline

Constructor for an ascend execution state

Parameters
executionUnitexecution unit containing the kernel to execute

◆ ~ExecutionState()

HiCR::backend::ascend::ExecutionState::~ExecutionState ( )
virtualdefault

Default destructor

Reimplemented from HiCR::ExecutionState.

Member Function Documentation

◆ checkFinalizationImpl()

__INLINE__ bool HiCR::backend::ascend::ExecutionState::checkFinalizationImpl ( )
inlineoverrideprotectedvirtual

Internal implementation of checkFinalization routine. It periodically query the ACL event on the stream to check for completion and automatically deletes the stream once it completes.

Returns
whether all the kernels described in the execution unit finished.

Implements HiCR::ExecutionState.

◆ finalizeStream()

__INLINE__ void HiCR::backend::ascend::ExecutionState::finalizeStream ( )
inline

Synchronize and destroy the currently used stream

◆ resumeImpl()

__INLINE__ void HiCR::backend::ascend::ExecutionState::resumeImpl ( )
inlineoverrideprotectedvirtual

Internal implementation of resume routine.

Implements HiCR::ExecutionState.

◆ setStream()

__INLINE__ void HiCR::backend::ascend::ExecutionState::setStream ( const aclrtStream  stream)
inline

Set the acl stream

Parameters
stream

◆ suspendImpl()

__INLINE__ void HiCR::backend::ascend::ExecutionState::suspendImpl ( )
inlineprotectedvirtual

Backend-specific implementation of the suspend function

Implements HiCR::ExecutionState.


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