geopm
3.1.1.dev595+gde7d25dd
GEOPM - Global Extensible Open Power Manager
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
c
d
e
g
h
i
j
k
l
m
n
p
r
s
t
v
w
Functions
_
a
c
d
e
g
h
i
k
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
Variables
a
b
c
d
f
h
i
j
m
n
p
r
s
t
u
v
w
Enumerations
Enumerator
g
m
n
Related Symbols
Files
File List
File Members
All
_
c
d
g
m
Functions
g
m
Typedefs
Enumerations
Enumerator
g
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
libgeopmd
include
geopm_field.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 - 2025 Intel Corporation
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#ifndef GEOPM_FIELD_H_INCLUDE
7
#define GEOPM_FIELD_H_INCLUDE
8
#include <stdint.h>
9
#include <string.h>
10
11
#include "
geopm_public.h
"
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
24
static
inline
uint64_t geopm_signal_to_field(
double
signal)
25
{
26
uint64_t result;
27
static_assert
(
sizeof
result ==
sizeof
signal,
28
"geopm_signal_to_field requires that signals and fields are the same size"
);
29
memcpy(&result, &signal,
sizeof
(result));
30
return
result;
31
}
32
39
static
inline
double
geopm_field_to_signal(uint64_t field)
40
{
41
double
result;
42
static_assert
(
sizeof
result ==
sizeof
field,
43
"geopm_field_to_signal requires that signals and fields are the same size"
);
44
memcpy(&result, &field,
sizeof
(result));
45
return
result;
46
}
47
48
#ifdef __cplusplus
49
}
50
#endif
51
#endif
geopm_public.h
Generated by
1.9.8