ComputeManager Class Reference

HiCR: HiCR::backend::boost::ComputeManager Class Reference
HiCR
HiCR::backend::boost::ComputeManager Class Reference

#include <computeManager.hpp>

Inheritance diagram for HiCR::backend::boost::ComputeManager:
HiCR::ComputeManager

Public Member Functions

 ComputeManager ()
 
 ~ComputeManager () override=default
 
__INLINE__ std::unique_ptr< HiCR::ExecutionStatecreateExecutionState (std::shared_ptr< HiCR::ExecutionUnit > executionUnit, void *const argument=nullptr) const override
 
__INLINE__ std::unique_ptr< HiCR::ProcessingUnitcreateProcessingUnit (std::shared_ptr< HiCR::ComputeResource > computeResource) const override
 
- Public Member Functions inherited from HiCR::ComputeManager
virtual std::unique_ptr< HiCR::ExecutionStatecreateExecutionState (std::shared_ptr< HiCR::ExecutionUnit > executionUnit, void *const argument=nullptr) const =0
 
__INLINE__ void initialize (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)
 
__INLINE__ void start (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit, std::unique_ptr< HiCR::ExecutionState > &executionState)
 
__INLINE__ void suspend (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)
 
__INLINE__ void resume (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)
 
__INLINE__ void terminate (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)
 
__INLINE__ void await (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)
 

Static Public Member Functions

static __INLINE__ std::shared_ptr< HiCR::ExecutionUnitcreateExecutionUnit (const Coroutine::coroutineFc_t &coroutineFunction)
 

Additional Inherited Members

- Protected Member Functions inherited from HiCR::ComputeManager
virtual void startImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit, std::unique_ptr< HiCR::ExecutionState > &executionState)=0
 

Detailed Description

Implementation of the Boost compute manager.

Note
The compute manager does not offer a processing unit implementation. However, the execution unit and states are fully compatible with the processing unit offered by pthreads backend

Constructor & Destructor Documentation

◆ ComputeManager()

HiCR::backend::boost::ComputeManager::ComputeManager ( )
inline

Default constructor

◆ ~ComputeManager()

HiCR::backend::boost::ComputeManager::~ComputeManager ( )
overridevirtualdefault

Default destructor

Reimplemented from HiCR::ComputeManager.

Member Function Documentation

◆ createExecutionState()

__INLINE__ std::unique_ptr< HiCR::ExecutionState > HiCR::backend::boost::ComputeManager::createExecutionState ( std::shared_ptr< HiCR::ExecutionUnit executionUnit,
void *const  argument = nullptr 
) const
inlineoverride

Creates a new execution state (coroutine)

Parameters
[in]executionUnitThe (lambda) function to run
[in]argumentThe argument to pass to the lambda function
Returns
The newly created execution state

◆ createExecutionUnit()

static __INLINE__ std::shared_ptr< HiCR::ExecutionUnit > HiCR::backend::boost::ComputeManager::createExecutionUnit ( const Coroutine::coroutineFc_t coroutineFunction)
inlinestatic

This function enables the creation of an execution unit.

Its default constructor takes a simple replicable CPU-executable function

Parameters
[in]coroutineFunctionThe replicable function to execute
Returns
The newly created execution unit

◆ createProcessingUnit()

__INLINE__ std::unique_ptr< HiCR::ProcessingUnit > HiCR::backend::boost::ComputeManager::createProcessingUnit ( std::shared_ptr< HiCR::ComputeResource resource) const
inlineoverridevirtual

Creates a new processing unit from the provided compute resource

Parameters
[in]resourceThis is the identifier of the compute resource to use to instantiate into a processing unit. The identifier should be one of those provided by the backend. Providing an arbitrary identifier may lead to unexpected behavior.
Returns
A unique pointer to the newly created processing unit. It is important to preserve the uniqueness of this object, since it represents a physical resource (e.g., core) and we do not want to assign it to multiple workers.

Implements HiCR::ComputeManager.


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