ExecutionState Class Reference
HiCR
|
#include <executionState.hpp>

Public Types | |
enum | state_t { uninitialized , initialized , running , suspended , finished } |
Public Member Functions | |
__INLINE__ void | resume () |
__INLINE__ void | suspend () |
__INLINE__ bool | checkFinalization () |
__INLINE__ state_t | getState () |
ExecutionState ()=delete | |
virtual | ~ExecutionState ()=default |
Protected Member Functions | |
ExecutionState (const std::shared_ptr< HiCR::ExecutionUnit > &executionUnit) | |
virtual void | resumeImpl ()=0 |
virtual void | suspendImpl ()=0 |
virtual bool | checkFinalizationImpl ()=0 |
Detailed Description
This class is an abstract representation of the lifetime of an execution unit. It exposes initialization, suspension and resume functionalities that should (ideally) be implemented for all execution/processing unit combinations.
Member Enumeration Documentation
◆ state_t
Complete state set that a task can be in
Constructor & Destructor Documentation
◆ ExecutionState() [1/2]
|
delete |
Default constructor is deleted to prevent instantiation without proper arguments
◆ ~ExecutionState()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::ascend::ExecutionState, and HiCR::backend::opencl::ExecutionState.
◆ ExecutionState() [2/2]
|
inlineprotected |
To save memory, the initialization of execution states (i.e., allocation of required structures) is deferred until this function is called.
- Parameters
-
[in] executionUnit Represents a replicable executable unit (e.g., function, kernel) to execute
Member Function Documentation
◆ checkFinalization()
|
inline |
Actively check for the finalization of an initialized execution state
- Returns
- True, if the execution has finalized; False, otherwise.
◆ checkFinalizationImpl()
|
protectedpure virtual |
Backend-specific implementation of the checkFinalization function
- Returns
- True, if the execution has finalized; False, otherwise.
Implemented in HiCR::backend::ascend::ExecutionState, HiCR::backend::boost::ExecutionState, HiCR::backend::nosv::ExecutionState, HiCR::backend::opencl::ExecutionState, and HiCR::backend::pthreads::ExecutionState.
◆ getState()
|
inline |
Returns the current state of the execution
- Returns
- The current execution state
◆ resume()
|
inline |
Starts a newly initialized execution states or resumes a suspended one
◆ resumeImpl()
|
protectedpure virtual |
Backend-specific implementation of the resume function
Implemented in HiCR::backend::ascend::ExecutionState, HiCR::backend::boost::ExecutionState, HiCR::backend::nosv::ExecutionState, HiCR::backend::opencl::ExecutionState, and HiCR::backend::pthreads::ExecutionState.
◆ suspend()
|
inline |
Suspends the execution of a running execution state
◆ suspendImpl()
|
protectedpure virtual |
Backend-specific implementation of the suspend function
Implemented in HiCR::backend::ascend::ExecutionState, HiCR::backend::opencl::ExecutionState, HiCR::backend::boost::ExecutionState, HiCR::backend::nosv::ExecutionState, and HiCR::backend::pthreads::ExecutionState.
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/executionState.hpp
Generated by