PAPI 7.1.0.0
Loading...
Searching...
No Matches
os_cpu_utils.c
Go to the documentation of this file.
1#include "sysdetect.h"
2#include "os_cpu_utils.h"
3#include "linux_cpu_utils.h"
4
5int
6os_cpu_get_vendor( char *vendor )
7{
8#if defined(__linux__)
9 return linux_cpu_get_vendor(vendor);
10#elif defined(__APPLE__) || defined(__MACH__)
11 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
12 return CPU_ERROR;
13#endif
14 return CPU_ERROR;
15}
16
17int
19{
20#if defined(__linux__)
22#elif defined(__APPLE__) || defined(__MACH__)
23 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
24 return CPU_ERROR;
25#endif
26 return CPU_ERROR;
27}
28
29int
31{
32#if defined(__linux__)
33 return linux_cpu_get_attribute(attr, value);
34#elif defined(__APPLE__) || defined(__MACH__)
35 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
36 return CPU_ERROR;
37#endif
38 return CPU_ERROR;
39}
40
41int
42os_cpu_get_attribute_at( CPU_attr_e attr, int loc, int *value )
43{
44#if defined(__linux__)
45 return linux_cpu_get_attribute_at(attr, loc, value);
46#elif defined(__APPLE__) || defined(__MACH__)
47 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
48 return CPU_ERROR;
49#endif
50 return CPU_ERROR;
51}
52
53int
55{
56#if defined(__linux__)
57 return linux_cpu_set_affinity(cpu);
58#elif defined(__APPLE__) || defined(__MACH__)
59 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
60 return CPU_ERROR;
61#endif
62 return CPU_ERROR;
63}
64
65int
67{
68#if defined(__linux__)
70#elif defined(__APPLE__) || defined(__MACH__)
71 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
72 return CPU_ERROR;
73#endif
74 return CPU_ERROR;
75}
76
77int
79{
80#if defined(__linux__)
82#elif defined(__APPLE__) || defined(__MACH__)
83 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
84 return CPU_ERROR;
85#endif
86 return CPU_ERROR;
87}
88
89int
91{
92#if defined(__linux__)
94#elif defined(__APPLE__) || defined(__MACH__)
95 #warning "WARNING! Darwin support of " __func__ " not yet implemented."
96 return CPU_ERROR;
97#endif
98 return CPU_ERROR;
99}
#define CPU_ERROR
Definition: cpu_utils.h:5
CPU_attr_e
Definition: cpu_utils.h:7
int linux_cpu_get_attribute_at(CPU_attr_e attr, int loc, int *value)
int linux_cpu_load_affinity(void)
int linux_cpu_get_name(char *name)
int linux_cpu_store_affinity(void)
int linux_cpu_get_num_supported(void)
int linux_cpu_set_affinity(int cpu)
int linux_cpu_get_vendor(char *vendor)
int linux_cpu_get_attribute(CPU_attr_e attr, int *value)
int os_cpu_get_attribute(CPU_attr_e attr, int *value)
Definition: os_cpu_utils.c:30
int os_cpu_get_num_supported(void)
Definition: os_cpu_utils.c:66
int os_cpu_set_affinity(int cpu)
Definition: os_cpu_utils.c:54
int os_cpu_load_affinity(void)
Definition: os_cpu_utils.c:90
int os_cpu_get_vendor(char *vendor)
Definition: os_cpu_utils.c:6
int os_cpu_get_attribute_at(CPU_attr_e attr, int loc, int *value)
Definition: os_cpu_utils.c:42
int os_cpu_get_name(char *name)
Definition: os_cpu_utils.c:18
int os_cpu_store_affinity(void)
Definition: os_cpu_utils.c:78
const char * name
Definition: rocs.c:225