1 #include "caffe2/utils/cpuid.h" 5 const CpuId& GetCpuId() {
6 static CpuId cpuid_singleton;
7 return cpuid_singleton;
10 CAFFE2_API uint32_t CpuId::f1c_ = 0;
11 CAFFE2_API uint32_t CpuId::f1d_ = 0;
12 CAFFE2_API uint32_t CpuId::f7b_ = 0;
13 CAFFE2_API uint32_t CpuId::f7c_ = 0;
18 __cpuid(static_cast<int*>(reg), 0);
21 __cpuid(static_cast<int*>(reg), 1);
22 f1c_ = uint32_t(reg[2]);
23 f1d_ = uint32_t(reg[3]);
26 __cpuidex(static_cast<int*>(reg), 7, 0);
27 f7b_ = uint32_t(reg[1]);
28 f7c_ = uint32_t(reg[2]);
30 #elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && \ 49 :
"=a"(f1a),
"=c"(f1c_),
"=d"(f1d_)
57 "movl %%ebx, %%eax\n\r" 59 :
"=a"(f7b_),
"=c"(f7c_)
63 #elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) 65 __asm__(
"cpuid" :
"=a"(n) :
"a"(0) :
"ebx",
"ecx",
"edx");
68 __asm__(
"cpuid" :
"=a"(f1a),
"=c"(f1c_),
"=d"(f1d_) :
"a"(1) :
"ebx");
73 :
"=a"(f7a),
"=b"(f7b_),
"=c"(f7c_)
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...