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

Public Member Functions | |
virtual | ~ComputeManager ()=default |
virtual std::unique_ptr< HiCR::ProcessingUnit > | createProcessingUnit (std::shared_ptr< HiCR::ComputeResource > resource) const =0 |
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) |
Protected Member Functions | |
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.
Constructor & Destructor Documentation
◆ ~ComputeManager()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::ascend::ComputeManager, HiCR::backend::boost::ComputeManager, HiCR::backend::opencl::ComputeManager, and HiCR::backend::pthreads::ComputeManager.
Member Function Documentation
◆ await()
|
inline |
Suspends the execution of the caller until the given processing unit has finalized
- Parameters
-
[in] processingUnit The processing unit to wait for
◆ awaitImpl()
|
protectedpure virtual |
Internal implementation of the await function
- Parameters
-
[in] processingUnit The processing to wait for
◆ createExecutionState()
|
pure virtual |
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
◆ createProcessingUnit()
|
pure virtual |
Creates a new processing unit from the provided compute resource
- Parameters
-
[in] resource 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.
Implemented in HiCR::backend::boost::ComputeManager, HiCR::backend::nosv::ComputeManager, and HiCR::backend::pthreads::ComputeManager.
◆ initialize()
|
inline |
Initializes the a processing unit and leaves it ready to execute work
- Parameters
-
[in] processingUnit The procesing unit to initialize
◆ initializeImpl()
|
protectedpure virtual |
Backend-specific implementation of the initialize function
- Parameters
-
[in] processingUnit The processing unit to initialize
◆ resume()
|
inline |
Resumes the execution of the processing unit.
- Parameters
-
[in] processingUnit The processing unit to resume
◆ resumeImpl()
|
protectedpure virtual |
Internal implementation of the resume function
- Parameters
-
[in] processingUnit The processing unit to resume
◆ start()
|
inline |
Starts running an executing state on a processing unit
- Parameters
-
[in] processingUnit The processing unit to initiate computation with [in] executionState The execution state to start running with the given processing unit
◆ startImpl()
|
protectedpure virtual |
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
◆ suspend()
|
inline |
Triggers the suspension of the resource. All the elements that make the resource remain active in memory, but will not execute.
- Parameters
-
[in] processingUnit The processing unit to suspend
◆ suspendImpl()
|
protectedpure virtual |
Internal implementation of the suspend function
- Parameters
-
[in] processingUnit The processing unit to suspend
◆ terminate()
|
inline |
Requests the processing unit to finalize as soon as possible. This is an asynchronous operation, so returning from this function does not guarantee that the resource has terminated.
- Parameters
-
[in] processingUnit The processing unit to terminate
◆ terminateImpl()
|
protectedpure virtual |
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/core/computeManager.hpp
Generated by