ProcessingUnit Class Reference

HiCR: HiCR::ProcessingUnit Class Reference
HiCR
HiCR::ProcessingUnit Class Referenceabstract

#include <processingUnit.hpp>

Inheritance diagram for HiCR::ProcessingUnit:
HiCR::backend::ascend::ProcessingUnit HiCR::backend::nosv::ProcessingUnit HiCR::backend::opencl::ProcessingUnit HiCR::backend::pthreads::ProcessingUnit

Public Types

enum  state_t {
  uninitialized , ready , running , suspended ,
  terminating , terminated
}
 

Public Member Functions

 ProcessingUnit ()=delete
 
__INLINE__ ProcessingUnit (std::shared_ptr< HiCR::ComputeResource > computeResource)
 
virtual ~ProcessingUnit ()=default
 
__INLINE__ ProcessingUnit::state_t getState () const
 
__INLINE__ std::shared_ptr< ComputeResourcegetComputeResource ()
 
virtual std::string getType ()=0
 

Friends

class HiCR::ComputeManager
 

Detailed Description

This class represents an abstract definition for a Processing Unit resource in HiCR that:

  • Represents a single compute resource that has been instantiated for execution (as opposed of those who shall remain unused or unassigned).
  • Is capable of executing or contributing to the execution of tasks.
  • Is assigned, for example, to a worker to perform the work necessary to execute a task.
  • This is a non-copy-able class

Member Enumeration Documentation

◆ state_t

Complete state set that a worker can be in

Enumerator
uninitialized 

The worker object has been instantiated but not initialized

ready 

The worker has been ininitalized (or is back from executing) and can currently run

running 

The worker has started executing

suspended 

The worker has started executing

terminating 

The worker has been issued for termination (but still running)

terminated 

The worker has terminated

Constructor & Destructor Documentation

◆ ProcessingUnit() [1/2]

HiCR::ProcessingUnit::ProcessingUnit ( )
delete

Disabled default constructor

◆ ProcessingUnit() [2/2]

__INLINE__ HiCR::ProcessingUnit::ProcessingUnit ( std::shared_ptr< HiCR::ComputeResource computeResource)
inline

Constructor for a processing unit

Parameters
computeResourceThe instance of the compute resource to instantiate, as indicated by the backend

◆ ~ProcessingUnit()

virtual HiCR::ProcessingUnit::~ProcessingUnit ( )
virtualdefault

Default destructor

Reimplemented in HiCR::backend::ascend::ProcessingUnit.

Member Function Documentation

◆ getComputeResource()

__INLINE__ std::shared_ptr< ComputeResource > HiCR::ProcessingUnit::getComputeResource ( )
inline

Returns the processing unit's associated compute resource

Returns
The identifier of the compute resource associated to this processing unit.

◆ getState()

__INLINE__ ProcessingUnit::state_t HiCR::ProcessingUnit::getState ( ) const
inline

Function to obtain the processing unit's state

Returns
Retruns the current state

◆ getType()

virtual std::string HiCR::ProcessingUnit::getType ( )
pure virtual

Gets the processing unit's type

Returns
A string, containing the processing unit's type

Implemented in HiCR::backend::ascend::ProcessingUnit, HiCR::backend::nosv::ProcessingUnit, HiCR::backend::opencl::ProcessingUnit, and HiCR::backend::pthreads::ProcessingUnit.


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