Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
caffe2
utils
cpuid.h
1
#pragma once
2
3
#include <cstdint>
4
5
#ifdef _MSC_VER
6
#include <intrin.h>
7
#endif
8
9
#include "caffe2/core/common.h"
10
11
namespace
caffe2
{
12
13
class
CpuId;
14
15
CAFFE2_API
const
CpuId& GetCpuId();
16
18
// Implementation of CpuId that is borrowed from folly.
20
27
class
CpuId
{
28
public
:
29
CpuId
();
30
31
#define X(name, r, bit) \
32
inline bool name() const { \
33
return ((r) & (1U << bit)) != 0; \
34
}
35
36
// cpuid(1): Processor Info and Feature Bits.
37
#define C(name, bit) X(name, f1c_, bit)
38
C
(sse3, 0)
39
C
(pclmuldq, 1)
40
C
(dtes64, 2)
41
C
(monitor, 3)
42
C
(dscpl, 4)
43
C
(vmx, 5)
44
C
(smx, 6)
45
C
(eist, 7)
46
C
(tm2, 8)
47
C
(ssse3, 9)
48
C
(cnxtid, 10)
49
C
(fma, 12)
50
C
(cx16, 13)
51
C
(xtpr, 14)
52
C
(pdcm, 15)
53
C
(pcid, 17)
54
C
(dca, 18)
55
C
(sse41, 19)
56
C
(sse42, 20)
57
C
(x2apic, 21)
58
C
(movbe, 22)
59
C
(popcnt, 23)
60
C
(tscdeadline, 24)
61
C
(aes, 25)
62
C
(xsave, 26)
63
C
(osxsave, 27)
64
C
(avx, 28)
65
C
(f16c, 29)
66
C
(rdrand, 30)
67
#undef C
68
69
#define D(name, bit) X(name, f1d_, bit)
70
D
(fpu, 0)
71
D
(vme, 1)
72
D
(de, 2)
73
D
(pse, 3)
74
D
(tsc, 4)
75
D
(msr, 5)
76
D
(pae, 6)
77
D
(mce, 7)
78
D
(cx8, 8)
79
D
(apic, 9)
80
D
(sep, 11)
81
D
(mtrr, 12)
82
D
(pge, 13)
83
D
(mca, 14)
84
D
(cmov, 15)
85
D
(pat, 16)
86
D
(pse36, 17)
87
D
(psn, 18)
88
D
(clfsh, 19)
89
D
(ds, 21)
90
D
(acpi, 22)
91
D
(mmx, 23)
92
D
(fxsr, 24)
93
D
(sse, 25)
94
D
(sse2, 26)
95
D
(ss, 27)
96
D
(htt, 28)
97
D
(tm, 29)
98
D
(pbe, 31)
99
#undef D
100
101
// cpuid(7): Extended Features.
102
#define B(name, bit) X(name, f7b_, bit)
103
B
(bmi1, 3)
104
B
(hle, 4)
105
B
(avx2, 5)
106
B
(smep, 7)
107
B
(bmi2, 8)
108
B
(erms, 9)
109
B
(invpcid, 10)
110
B
(rtm, 11)
111
B
(mpx, 14)
112
B
(avx512f, 16)
113
B
(avx512dq, 17)
114
B
(rdseed, 18)
115
B
(adx, 19)
116
B
(smap, 20)
117
B
(avx512ifma, 21)
118
B
(pcommit, 22)
119
B
(clflushopt, 23)
120
B
(clwb, 24)
121
B
(avx512pf, 26)
122
B
(avx512er, 27)
123
B
(avx512cd, 28)
124
B
(sha, 29)
125
B
(avx512bw, 30)
126
B
(avx512vl, 31)
127
#undef B
128
129
#define E(name, bit) X(name, f7c_, bit)
130
E
(prefetchwt1, 0)
131
E
(avx512vbmi, 1)
132
#undef E
133
134
#undef X
135
136
private
:
137
CAFFE2_API
static
uint32_t f1c_;
138
CAFFE2_API
static
uint32_t f1d_;
139
CAFFE2_API
static
uint32_t f7b_;
140
CAFFE2_API
static
uint32_t f7c_;
141
};
142
143
}
// namespace caffe2
E
Definition:
static.cpp:76
caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition:
blob.h:13
C
Definition:
static.cpp:64
B
Definition:
static.cpp:58
caffe2::CpuId
Identification of an Intel CPU.
Definition:
cpuid.h:27
D
Definition:
static.cpp:70
Generated on Thu Mar 21 2019 13:06:21 for Caffe2 - C++ API by
1.8.11