Cache Class Reference

HiCR: HiCR::backend::hwloc::Cache Class Reference
HiCR
HiCR::backend::hwloc::Cache Class Reference

#include <cache.hpp>

Public Types

enum  cacheLevel_t {
  L1 = 1 , L2 = 2 , L3 = 3 , L4 = 4 ,
  L5 = 5
}
 

Public Member Functions

 Cache (const cacheLevel_t level, std::string type, const size_t size, const size_t lineSize, const bool shared)
 
 Cache (const nlohmann::json &input)
 
__INLINE__ size_t getSize () const
 
__INLINE__ size_t getLineSize () const
 
__INLINE__ cacheLevel_t getLevel () const
 
__INLINE__ bool getShared () const
 
__INLINE__ const std::string & getType () const
 
__INLINE__ nlohmann::json serialize () const
 
__INLINE__ void deserialize (const nlohmann::json &input)
 

Detailed Description

Object class representing a cache found in a CPU/Processing Unit

Member Enumeration Documentation

◆ cacheLevel_t

Type definition for a cache level (L1, L2, L3...)

Enumerator
L1 

Cache Level L1.

L2 

Cache Level L2.

L3 

Cache Level L3.

L4 

Cache Level L4.

L5 

Cache Level L5.

Constructor & Destructor Documentation

◆ Cache() [1/2]

HiCR::backend::hwloc::Cache::Cache ( const cacheLevel_t  level,
std::string  type,
const size_t  size,
const size_t  lineSize,
const bool  shared 
)
inline

Constructor for the cache class

Parameters
[in]levelThe level (L1, L1, L2, L3...) detected for this cache instance
[in]typeThe type (instruction, data, unified) for this cache
[in]lineSizeThe size of each cache line contained within
[in]sharedIndicates whether this cache is shared among others
[in]sizeThe size of the detected cache

◆ Cache() [2/2]

HiCR::backend::hwloc::Cache::Cache ( const nlohmann::json &  input)
inline

Deserializing constructor

The instance created will contain all information, if successful in deserializing it, corresponding to the passed cache This instance should NOT be used for anything else than reporting/printing the contained resources

Parameters
[in]inputA JSON-encoded serialized cache information

Member Function Documentation

◆ deserialize()

__INLINE__ void HiCR::backend::hwloc::Cache::deserialize ( const nlohmann::json &  input)
inline

De-serialization function to obtain the cache values from a serialized JSON object

Parameters
[in]inputJSON-formatted serialized cache information

◆ getLevel()

__INLINE__ cacheLevel_t HiCR::backend::hwloc::Cache::getLevel ( ) const
inline

Obtain the type of the cache object

Returns
The cache type in as a cacheType_t enum value

◆ getLineSize()

__INLINE__ size_t HiCR::backend::hwloc::Cache::getLineSize ( ) const
inline

Obtain the line size of the cache object

Returns
The cache line size in Bytes

◆ getShared()

__INLINE__ bool HiCR::backend::hwloc::Cache::getShared ( ) const
inline

Indicates whether the cache is shared among other procesing units

Returns
True, if the cache is shared; false, otherwise

◆ getSize()

__INLINE__ size_t HiCR::backend::hwloc::Cache::getSize ( ) const
inline

Obtain the size of the cache object

Returns
The cache size in Bytes

◆ getType()

__INLINE__ const std::string & HiCR::backend::hwloc::Cache::getType ( ) const
inline

Returns the cache type

Returns
The cache type (instruction, data, unified)

◆ serialize()

__INLINE__ nlohmann::json HiCR::backend::hwloc::Cache::serialize ( ) const
inline

Serialization function to enable sharing cache information

Returns
JSON-formatted serialized cache information

The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/backends/hwloc/cache.hpp