geopm
3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
libgeopmd
src
MSR.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 - 2024 Intel Corporation
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#ifndef MSR_HPP_INCLUDE
7
#define MSR_HPP_INCLUDE
8
9
#include <string>
10
#include <map>
11
12
namespace
geopm
13
{
16
class
MSR
17
{
18
public
:
19
enum
m_function_e
{
20
M_FUNCTION_SCALE
,
// Only apply scalar value (applied by all functions)
21
M_FUNCTION_LOG_HALF
,
// 2.0 ^ -X
22
M_FUNCTION_7_BIT_FLOAT
,
// 2 ^ Y * (1.0 + Z / 4.0) : Y in [0:5), Z in [5:7)
23
M_FUNCTION_LOGIC
,
// A bit that controls logic
24
M_FUNCTION_OVERFLOW
,
// Counter that may overflow
25
M_NUM_FUNCTION
26
};
27
29
static
m_function_e
string_to_function
(
const
std::string &str);
30
private
:
31
static
const
std::map<std::string, m_function_e> M_FUNCTION_STRING;
32
};
33
}
34
35
#endif
geopm::MSR
This class encodes how to access fields within an MSR, but does not hold the state of any registers.
Definition:
MSR.hpp:17
geopm::MSR::m_function_e
m_function_e
Definition:
MSR.hpp:19
geopm::MSR::M_FUNCTION_OVERFLOW
@ M_FUNCTION_OVERFLOW
Definition:
MSR.hpp:24
geopm::MSR::M_FUNCTION_LOGIC
@ M_FUNCTION_LOGIC
Definition:
MSR.hpp:23
geopm::MSR::M_FUNCTION_LOG_HALF
@ M_FUNCTION_LOG_HALF
Definition:
MSR.hpp:21
geopm::MSR::M_FUNCTION_SCALE
@ M_FUNCTION_SCALE
Definition:
MSR.hpp:20
geopm::MSR::M_FUNCTION_7_BIT_FLOAT
@ M_FUNCTION_7_BIT_FLOAT
Definition:
MSR.hpp:22
geopm::MSR::M_NUM_FUNCTION
@ M_NUM_FUNCTION
Definition:
MSR.hpp:25
geopm::MSR::string_to_function
static m_function_e string_to_function(const std::string &str)
Convert a string to the corresponding m_function_e value.
Definition:
MSR.cpp:20
geopm
Definition:
Agg.cpp:20
Generated by
1.9.1