ExecutionState Class Reference

HiCR: HiCR::backend::opencl::ExecutionState Class Reference
HiCR
HiCR::backend::opencl::ExecutionState Class Referencefinal

#include <executionState.hpp>

Inheritance diagram for HiCR::backend::opencl::ExecutionState:
HiCR::ExecutionState

Public Member Functions

 ExecutionState (const std::shared_ptr< HiCR::ExecutionUnit > executionUnit)
 
 ~ExecutionState ()=default
 
__INLINE__ void setQueue (cl::CommandQueue *queue)
 
__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 kernel for the OpenCL backend. Since kernels are not preemptible, it does not offer suspend/resume functionality.

Constructor & Destructor Documentation

◆ ExecutionState()

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

Constructor for an opencl execution state

Parameters
executionUnitexecution unit containing the kernel to execute

◆ ~ExecutionState()

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

Default destructor

Reimplemented from HiCR::ExecutionState.

Member Function Documentation

◆ checkFinalizationImpl()

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

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

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

Implements HiCR::ExecutionState.

◆ finalizeStream()

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

Synchronize and destroy the currently used queue

◆ resumeImpl()

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

Internal implementation of resume routine.

Implements HiCR::ExecutionState.

◆ setQueue()

__INLINE__ void HiCR::backend::opencl::ExecutionState::setQueue ( cl::CommandQueue *  queue)
inline

Set the OpenCL queue

Parameters
[in]queue

◆ suspendImpl()

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

Backend-specific implementation of the suspend function

Implements HiCR::ExecutionState.


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