ComputeResource Class Reference

HiCR: HiCR::ComputeResource Class Reference
HiCR
HiCR::ComputeResource Class Referenceabstract

#include <computeResource.hpp>

Inheritance diagram for HiCR::ComputeResource:
HiCR::backend::ascend::ComputeResource HiCR::backend::hwloc::ComputeResource HiCR::backend::opencl::ComputeResource

Public Member Functions

virtual std::string getType () const =0
 
virtual ~ComputeResource ()=default
 
__INLINE__ nlohmann::json serialize () const
 
__INLINE__ void deserialize (const nlohmann::json &input)
 

Protected Member Functions

virtual void serializeImpl (nlohmann::json &output) const =0
 
virtual void deserializeImpl (const nlohmann::json &input)=0
 

Detailed Description

This class represents an abstract definition for a Compute Resource that:

  • Represents a single autonomous unit of computing power (e.g., CPU core, device)
  • This is a copy-able class that only contains metadata

Constructor & Destructor Documentation

◆ ~ComputeResource()

virtual HiCR::ComputeResource::~ComputeResource ( )
virtualdefault

Member Function Documentation

◆ deserialize()

__INLINE__ void HiCR::ComputeResource::deserialize ( const nlohmann::json &  input)
inline

De-serialization function to re-construct the serialized compute resource information coming (typically) from remote instances

Parameters
[in]inputJSON-formatted serialized compute resource information

◆ deserializeImpl()

virtual void HiCR::ComputeResource::deserializeImpl ( const nlohmann::json &  input)
protectedpure virtual

Backend-specific implementation of the deserialize function

Parameters
[in]inputSerialized compute resource information corresponding to the specific backend's topology manager

Implemented in HiCR::backend::hwloc::ComputeResource.

◆ getType()

virtual std::string HiCR::ComputeResource::getType ( ) const
pure virtual

Indicates what type of compute unit is contained in this instance

Returns
A string containing a human-readable description of the compute resource type

Implemented in HiCR::backend::ascend::ComputeResource, HiCR::backend::hwloc::ComputeResource, and HiCR::backend::opencl::ComputeResource.

◆ serialize()

__INLINE__ nlohmann::json HiCR::ComputeResource::serialize ( ) const
inline

Serialization function to enable sharing compute resource information

Returns
JSON-formatted serialized compute resource information

◆ serializeImpl()

virtual void HiCR::ComputeResource::serializeImpl ( nlohmann::json &  output) const
protectedpure virtual

Backend-specific implemtation of the serialize function that allows adding more information than the one provided by default by HiCR

Parameters
[out]outputJSON-formatted serialized compute resource information

Implemented in HiCR::backend::hwloc::ComputeResource.


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