ComputeManager Class Reference
HiCR
|
#include <computeManager.hpp>

Public Member Functions | |
__INLINE__ std::unique_ptr< HiCR::ProcessingUnit > | createProcessingUnit (std::shared_ptr< HiCR::ComputeResource > computeResource) const override |
__INLINE__ std::unique_ptr< HiCR::ExecutionState > | createExecutionState (std::shared_ptr< HiCR::ExecutionUnit > executionUnit, void *const argument=nullptr) const override |
![]() | |
virtual | ~ComputeManager ()=default |
virtual std::unique_ptr< HiCR::ExecutionState > | createExecutionState (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::ExecutionUnit > | createExecutionUnit (const std::function< void(void *)> &executionUnit) |
Protected Member Functions | |
__INLINE__ void | initializeImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) override |
__INLINE__ void | startImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit, std::unique_ptr< HiCR::ExecutionState > &executionState) override |
__INLINE__ void | suspendImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) override |
__INLINE__ void | resumeImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) override |
__INLINE__ void | terminateImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) override |
__INLINE__ void | awaitImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) override |
__INLINE__ nosv::ProcessingUnit * | getPUPointer (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit) |
![]() | |
virtual void | initializeImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)=0 |
virtual void | startImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit, std::unique_ptr< HiCR::ExecutionState > &executionState)=0 |
virtual void | suspendImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)=0 |
virtual void | resumeImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)=0 |
virtual void | terminateImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)=0 |
virtual void | awaitImpl (std::unique_ptr< HiCR::ProcessingUnit > &processingUnit)=0 |
Detailed Description
This class represents an abstract definition of a compute manager. That is, the set of functions to be implemented by a given backend that allows the discovery of compute resources, the definition of replicable execution units (functions or kernels to run), and the instantiation of execution states, that represent the execution lifetime of an execution unit.
Member Function Documentation
◆ awaitImpl()
|
inlineoverrideprotected |
Internal implementation of the await function
- Parameters
-
[in] processingUnit The processing to wait for
◆ createExecutionState()
|
inlineoverride |
This function enables the creation of an empty execution state object.
The instantiation of its internal memory structures is delayed until explicit initialization to reduce memory usage when, for example, scheduling many tasks that do not need to execute at the same time.
- Parameters
-
[in] executionUnit The replicable state-less execution unit to instantiate into an execution state [in] argument Argument (closure) to pass to the execution unit to make this execution state unique
- Returns
- A unique pointer to the newly create execution state. It needs to be unique because the state cannot be simultaneously executed my multiple processing units
◆ createExecutionUnit()
|
inlinestatic |
This function enables the creation of an execution unit.
Its default constructor takes a simple replicable CPU-executable function
- Parameters
-
[in] executionUnit The replicable function to execute
- Returns
- The newly created execution unit
◆ createProcessingUnit()
|
inlineoverridevirtual |
Creates a new processing unit from the provided compute resource
- Parameters
-
[in] computeResource This 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.
◆ getPUPointer()
|
inlineprotected |
Getting the pointer of the casted nOS-V PU one
- Parameters
-
[in] processingUnit The processing unit casted into the nosv one
- Returns
- the dynamicly casted pointer of the processingUnit
◆ initializeImpl()
|
inlineoverrideprotected |
Backend-specific implementation of the initialize function
- Parameters
-
[in] processingUnit The processing unit to initialize
◆ resumeImpl()
|
inlineoverrideprotected |
Internal implementation of the resume function
- Parameters
-
[in] processingUnit The processing unit to resume
◆ startImpl()
|
inlineoverrideprotected |
Internal implmentation of the start function
- Parameters
-
[in] processingUnit The processing unit to initiate computation with [in] executionState The execution state to start running with the given processing unit
◆ suspendImpl()
|
inlineoverrideprotected |
Internal implementation of the suspend function
- Parameters
-
[in] processingUnit The processing unit to suspend
◆ terminateImpl()
|
inlineoverrideprotected |
Internal implementation of the terminate function
- Parameters
-
[in] processingUnit The processing unit to terminate
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/backends/nosv/computeManager.hpp
Generated by